From 244c4be8cc33cb48dcb06eda54d8dee1ee53d7ca Mon Sep 17 00:00:00 2001 From: Guillermo Ruffino Date: Sat, 31 Aug 2019 13:45:06 -0300 Subject: [PATCH] fix integration sensor (#711) * fix integration sensor * revert rtc_.save conditional --- esphome/components/integration/integration_sensor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/integration/integration_sensor.cpp b/esphome/components/integration/integration_sensor.cpp index 9ddfd2ad0b..22fab290dd 100644 --- a/esphome/components/integration/integration_sensor.cpp +++ b/esphome/components/integration/integration_sensor.cpp @@ -61,7 +61,9 @@ void IntegrationSensor::process_sensor_value_(float value) { area = dt * new_value; break; } - this->publish_and_save_(this->last_value_ + area); + this->last_value_ = new_value; + this->last_update_ = now; + this->publish_and_save_(this->result_ + area); } } // namespace integration