Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for pmsa003i #18214

Merged
merged 4 commits into from
Mar 20, 2023
Merged

Support for pmsa003i #18214

merged 4 commits into from
Mar 20, 2023

Conversation

FunJp
Copy link
Contributor

@FunJp FunJp commented Mar 17, 2023

Description:

Add support for the PMSA003I I2C air quality sensor

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.7
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@arendst
Copy link
Owner

arendst commented Mar 18, 2023

Thx. Looks almost ok.

Pls put the global vars in a struct to solve possible duplications.

Removed all global variable and use the PM25_AQI_Data struct from Adafruit library
Fix typo Xsns100 to Xsns104
Fix Typo XI2C_71 to XI2C_78
@FunJp
Copy link
Contributor Author

FunJp commented Mar 19, 2023

Hey,

I assume that this was what you had in mind about all the global variables ? If you also would prefer to also have the followings in the struct just let me know.

bool pmsa003i_type = false; bool pmsa003i_ready = false; uint8_t warmup_counter; // count for warmup

Also, while looking thru other sensor, I notice that the xsns_18_pms5003.ino could also benefits from using a similar struct. I won't touch it in this PR, but it might be worth a look too at some point

@arendst
Copy link
Owner

arendst commented Mar 19, 2023

Yeah I like to have them all in a struct but then do not call it data as being the most obvious variable name....

Call it related to your driver like Pmsa003i which is most probably unique within the tasmota global variable world.

@arendst
Copy link
Owner

arendst commented Mar 20, 2023

Thx.

@arendst arendst merged commit 5661a67 into arendst:development Mar 20, 2023
arendst added a commit that referenced this pull request Mar 20, 2023
- Add support for PMSA003I Air Quality Sensor by Jean-Pierre Deschamps (#18214)
- Add support for DingTian virtual switch/button/relay (#18223)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants