Remove min_save_interval from intergration and total_daily_energy (#3498)

This commit is contained in:
Jesse Hills
2022-06-30 16:47:56 +12:00
committed by GitHub
parent 6f83a49c63
commit bca96f91b2
7 changed files with 15 additions and 32 deletions
@@ -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); });