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:
@@ -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); });
|
||||
}
|
||||
|
Reference in New Issue
Block a user