1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-19 03:32:20 +01:00

Add min_save_interval to total_energy/integration for memory wear (#1665)

Co-authored-by: Andreas Hergert <andreas.hergert@otrs.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
Andreas Hergert
2021-08-03 16:41:34 +02:00
committed by GitHub
parent 4c8a703084
commit 6516c64e67
7 changed files with 35 additions and 1 deletions

View File

@@ -16,6 +16,8 @@ void IntegrationSensor::setup() {
}
this->last_update_ = millis();
this->last_save_ = this->last_update_;
this->publish_and_save_(this->result_);
this->sensor_->add_on_state_callback([this](float state) { this->process_sensor_value_(state); });
}