Skip to content

Commit

Permalink
Fix sending SENSEAIR_INVALID_RESPONSE
Browse files Browse the repository at this point in the history
  • Loading branch information
nurikk committed Dec 26, 2020
1 parent b57f97f commit da16093
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Source/zcl_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,17 @@ static void zclApp_ReadSensors(void) {
switch (sensorType) {
case SENSEAIR:
SenseAir_Read(&co2);
zclApp_Sensors.CO2_PPM = co2;
zclApp_Sensors.CO2 = (double)co2 / 1000000.0;
if (co2 != SENSEAIR_INVALID_RESPONSE) {
zclApp_Sensors.CO2_PPM = co2;
zclApp_Sensors.CO2 = (double)co2 / 1000000.0;
}
break;
case MHZ19:
MHZ19_Read(&co2);
zclApp_Sensors.CO2_PPM = co2;
zclApp_Sensors.CO2 = (double)co2 / 1000000.0;
if (co2 != SENSEAIR_INVALID_RESPONSE) {
zclApp_Sensors.CO2_PPM = co2;
zclApp_Sensors.CO2 = (double)co2 / 1000000.0;
}
break;

default:
Expand Down

0 comments on commit da16093

Please sign in to comment.