mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 23:18:10 +01:00
Ignore NaN states in the integration component (#3767)
This commit is contained in:
parent
4788a6182e
commit
7a4cf13e0c
1 changed files with 2 additions and 0 deletions
|
@ -23,6 +23,8 @@ void IntegrationSensor::setup() {
|
||||||
}
|
}
|
||||||
void IntegrationSensor::dump_config() { LOG_SENSOR("", "Integration Sensor", this); }
|
void IntegrationSensor::dump_config() { LOG_SENSOR("", "Integration Sensor", this); }
|
||||||
void IntegrationSensor::process_sensor_value_(float value) {
|
void IntegrationSensor::process_sensor_value_(float value) {
|
||||||
|
if (std::isnan(value))
|
||||||
|
return;
|
||||||
const uint32_t now = millis();
|
const uint32_t now = millis();
|
||||||
const double old_value = this->last_value_;
|
const double old_value = this->last_value_;
|
||||||
const double new_value = value;
|
const double new_value = value;
|
||||||
|
|
Loading…
Reference in a new issue