From a5e1f8fe19cf3befca4cd719295d63f95adc556a Mon Sep 17 00:00:00 2001 From: Frank Bakker Date: Thu, 23 Jul 2020 23:40:40 +0200 Subject: [PATCH] Fixed type mismatch between result_ field and preference of integration sensor (#1178) --- 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 f9b5a43870..806c0ce567 100644 --- a/esphome/components/integration/integration_sensor.cpp +++ b/esphome/components/integration/integration_sensor.cpp @@ -10,7 +10,9 @@ static const char *TAG = "integration"; void IntegrationSensor::setup() { if (this->restore_) { this->rtc_ = global_preferences.make_preference(this->get_object_id_hash()); - this->rtc_.load(&this->result_); + float preference_value = 0; + this->rtc_.load(&preference_value); + this->result_ = preference_value; } this->last_update_ = millis();