Skip to content

Commit

Permalink
The underlying climateguard/RadSens library returns 0 in case of
Browse files Browse the repository at this point in the history
error; Treat these as unknown values and don't publish a value.
  • Loading branch information
bakerkj committed Oct 28, 2022
1 parent 77a3a31 commit c118376
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions _CG_RadSens.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ class MyRadSens: public PollingComponent {
CurrentCPM_Sensor->publish_state(cpm.getCurrentCpm());
MaxCPM_Sensor->publish_state(cpm.getMaximumCpm());
}
IntensityDynamic_Sensor->publish_state(IntensityDynamic);
IntensityStatic_Sensor->publish_state(IntensityStatic);
if (IntensityDynamic != 0) {
IntensityDynamic_Sensor->publish_state(IntensityDynamic);
}
if (IntensityStatic != 0) {
IntensityStatic_Sensor->publish_state(IntensityStatic);
}
pulsesPrev = Pulses;
}
};

0 comments on commit c118376

Please sign in to comment.