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

Fix SCD40 start low power command #15361

Merged
merged 3 commits into from
Apr 13, 2022
Merged

Conversation

stibus
Copy link

@stibus stibus commented Apr 13, 2022

Description:

Fixes the method FrogmoreScd40::startLowPowerPeriodicMeasurement where the return statement happened before setting the DuringMeasurement flag. As a consequence of this bug one would not be able to stop measurements once low power mode measurements have been activated.

Also implements a few small code clean-ups:

  • remove declaration of unused variable co2AvgExtra
  • clean-up inconsistent use of uint8_t duringMeasurement and bool DuringMeasurement
  • change all integer assignments to duringMeasurement to boolean assignments

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.3
  • I accept the CLA.

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

stibus added 3 commits April 13, 2022 00:15
In method `FrogMoreScd40::startLowPowerPeriodicMeasurement` the `return`
statement appeared before the update of the `DuringMeasurement` flag.
Thus, the class would wrongly assume not be in measurement mode and a
subsequent `stopPeriodicMeasurement` would fail. Moved the `return`
statement to after setting the flag.
- remove obsolete integer `duringMeasurement`
- change boolean `DuringMeasurement` to lower case
- replace integer assignments with boolean assignments
@arendst arendst merged commit 97a41af into arendst:development Apr 13, 2022
@stibus stibus deleted the fix/SCD40 branch April 13, 2022 14:41
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