mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 12:43:28 +02:00
Remove min_save_interval from intergration and total_daily_energy (#3498)
This commit is contained in:
@@ -10,14 +10,13 @@ static const char *const TAG = "integration";
|
||||
|
||||
void IntegrationSensor::setup() {
|
||||
if (this->restore_) {
|
||||
this->rtc_ = global_preferences->make_preference<float>(this->get_object_id_hash());
|
||||
this->pref_ = global_preferences->make_preference<float>(this->get_object_id_hash());
|
||||
float preference_value = 0;
|
||||
this->rtc_.load(&preference_value);
|
||||
this->pref_.load(&preference_value);
|
||||
this->result_ = preference_value;
|
||||
}
|
||||
|
||||
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