mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 12:55:46 +01:00
Fixed type mismatch between result_ field and preference of integration sensor (#1178)
This commit is contained in:
parent
1b2de953d0
commit
a5e1f8fe19
@ -10,7 +10,9 @@ static const char *TAG = "integration";
|
||||
void IntegrationSensor::setup() {
|
||||
if (this->restore_) {
|
||||
this->rtc_ = global_preferences.make_preference<float>(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();
|
||||
|
Loading…
Reference in New Issue
Block a user