[lvgl] Number saves value on interactive change (#12315)
This commit is contained in:
@@ -29,15 +29,18 @@ class LVGLNumber : public number::Number, public Component {
|
||||
this->publish_state(value);
|
||||
}
|
||||
|
||||
void on_value() { this->publish_state(this->value_lambda_()); }
|
||||
void on_value() { this->publish_(this->value_lambda_()); }
|
||||
|
||||
protected:
|
||||
void control(float value) override {
|
||||
this->control_lambda_(value);
|
||||
void publish_(float value) {
|
||||
this->publish_state(value);
|
||||
if (this->restore_)
|
||||
this->pref_.save(&value);
|
||||
}
|
||||
void control(float value) override {
|
||||
this->control_lambda_(value);
|
||||
this->publish_(value);
|
||||
}
|
||||
std::function<void(float)> control_lambda_;
|
||||
std::function<float()> value_lambda_;
|
||||
lv_event_code_t event_;
|
||||
|
||||
Reference in New Issue
Block a user