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

Restructure Measurements class #256

Merged
merged 30 commits into from
Oct 22, 2024
Merged

Restructure Measurements class #256

merged 30 commits into from
Oct 22, 2024

Conversation

samuelbles07
Copy link
Collaborator

@samuelbles07 samuelbles07 commented Oct 20, 2024

Changes

Main changes is restructuring Measurement class on AgValue files. Each measurements has average value that are always calculated based on max period length (calculateMaxPeriod()) set for moving average calculation.

Other includes

  1. Every measurements data from each sensor have an average value which are sent to AirGradient server, MQTT and Local Server fetch. On oled display and led bar indication still using last reading value.
  2. Relative humidity now is in float 2 decimals precision (except showing on oled display)
  3. Remove ESP restart when PM sensor read failed on X times
  4. Interval for SHT sensor reading now set to 6s
  5. Optional debug every reading interval to serial monitor. Sensor debug to serial monitor is the moving average value
  6. PMSBase::compensate using float data type for arguments and return (previously int).
    • Directly return 0 when PM value is 0
  7. Send indication when consecutively update invalid value

To support OA that have 2 PMS sensor
Working average from main only
Tested on I-9PSL monitor
Update OneOpenAir post and mqtt to use new measurement toString
Just use plain enum instead of enum class
Remove unecessary legacy variables and function
average value to floating points
Set measurements type average value to invalid when invalidCounter reached max period
@samuelbles07 samuelbles07 marked this pull request as ready for review October 22, 2024 05:35
@samuelbles07 samuelbles07 merged commit eb76eff into develop Oct 22, 2024
20 checks passed
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.

1 participant