Skip to content

Commit

Permalink
Merge pull request #4 from bakerkj/bakerkj-ignore-errors
Browse files Browse the repository at this point in the history
Do not publish_state when underlying climateguard/RadSens library returns 0 for unknown value
  • Loading branch information
maaad authored Oct 30, 2022
2 parents 77a3a31 + c118376 commit 4259da1
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 4259da1

Please sign in to comment.