mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-06 04:48:27 +02:00
Add restore_value to template number (#2041)
This commit is contained in:
@@ -20,11 +20,13 @@ class TemplateNumber : public number::Number, public PollingComponent {
|
||||
Trigger<float> *get_set_trigger() const { return set_trigger_; }
|
||||
void set_optimistic(bool optimistic) { optimistic_ = optimistic; }
|
||||
void set_initial_value(float initial_value) { initial_value_ = initial_value; }
|
||||
void set_restore_value(bool restore_value) { this->restore_value_ = restore_value; }
|
||||
|
||||
protected:
|
||||
void control(float value) override;
|
||||
bool optimistic_{false};
|
||||
float initial_value_{NAN};
|
||||
bool restore_value_{false};
|
||||
Trigger<float> *set_trigger_ = new Trigger<float>();
|
||||
optional<std::function<optional<float>()>> f_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user