mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 13:24:56 +02:00
total_daily_energy: allow to disable restore mode (#2795)
This commit is contained in:
@@ -17,6 +17,7 @@ enum TotalDailyEnergyMethod {
|
||||
|
||||
class TotalDailyEnergy : public sensor::Sensor, public Component {
|
||||
public:
|
||||
void set_restore(bool restore) { restore_ = restore; }
|
||||
void set_min_save_interval(uint32_t min_interval) { this->min_save_interval_ = min_interval; }
|
||||
void set_time(time::RealTimeClock *time) { time_ = time; }
|
||||
void set_parent(Sensor *parent) { parent_ = parent; }
|
||||
@@ -41,6 +42,7 @@ class TotalDailyEnergy : public sensor::Sensor, public Component {
|
||||
uint32_t last_update_{0};
|
||||
uint32_t last_save_{0};
|
||||
uint32_t min_save_interval_{0};
|
||||
bool restore_;
|
||||
float total_energy_{0.0f};
|
||||
float last_power_state_{0.0f};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user