Ignore NaN states in the integration component (#3767)

This commit is contained in:
anatoly-savchenkov authored and Jesse Hills committed 2022-09-06 13:12:00 +12:00
1 parent c8eb30ef27
commit d2ce62aa13
1 file changed
+2
@@ -23,6 +23,8 @@ void IntegrationSensor::setup() {
}
void IntegrationSensor::dump_config() { LOG_SENSOR("", "Integration Sensor", this); }
void IntegrationSensor::process_sensor_value_(float value) {
if (std::isnan(value))
return;
const uint32_t now = millis();
const double old_value = this->last_value_;
const double new_value = value;