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 sensor registration at Sensors::CO2scd30Init() and Sensors::CO2scd4xInit() #204

Merged
merged 9 commits into from
Feb 21, 2024

Conversation

melkati
Copy link
Contributor

@melkati melkati commented Feb 19, 2024

Description

I moved the sensor registration up in Sensors::CO2scd30Init() and Sensors::CO2scd4xInit() to fix (2).

I don't see any side effects. Tested with both sensors in CO2 Gadget and looks like it's working fine.

In Sensors::CO2scd30Init() I also changed In Sensors::CO2scd30Init() to multiply toffset * 100 to convert into hundredths of a degree C to comply with Sensirion's API.

Maybe we should do the same for Sensors::sen5xInit() but I don't have one to test.

Related Issues

This is one partial fix for issue #203

Tests

I added the following tests:

I don't see any side effects. Tested with both sensors in CO2 Gadget and looks like it's working fine.

Do not multiply scd30.getTemperatureOffset() by 100 (it´s already in hundreths of a degree C) to avoid setting temperature offset on each sensor init.
Do sensorRegister(SENSORS::SSCD30) prior to seeting offsets.
@melkati melkati changed the title Fix offset Fix sensor registration at Sensors::CO2scd30Init() and Sensors::CO2scd4xInit() Feb 19, 2024
@hpsaturn hpsaturn changed the base branch from master to fix_203_toffset February 20, 2024 13:32
src/Sensors.cpp Outdated Show resolved Hide resolved
@hpsaturn hpsaturn merged commit 622ff0b into kike-canaries:fix_203_toffset Feb 21, 2024
1 check 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.

2 participants