[light] Fix schedule_show not enabling loop for idle addressable lights (#12302)
This commit is contained in:
@@ -70,7 +70,7 @@ class AddressableLight : public LightOutput, public Component {
|
||||
this->state_parent_ = state;
|
||||
}
|
||||
void update_state(LightState *state) override;
|
||||
void schedule_show() { this->state_parent_->next_write_ = true; }
|
||||
void schedule_show() { this->state_parent_->schedule_write_(); }
|
||||
|
||||
#ifdef USE_POWER_SUPPLY
|
||||
void set_power_supply(power_supply::PowerSupply *power_supply) { this->power_.set_parent(power_supply); }
|
||||
|
||||
@@ -305,8 +305,7 @@ void LightState::set_immediately_(const LightColorValues &target, bool set_remot
|
||||
this->remote_values = target;
|
||||
}
|
||||
this->output_->update_state(this);
|
||||
this->next_write_ = true;
|
||||
this->enable_loop();
|
||||
this->schedule_write_();
|
||||
}
|
||||
|
||||
void LightState::disable_loop_if_idle_() {
|
||||
|
||||
@@ -277,6 +277,12 @@ class LightState : public EntityBase, public Component {
|
||||
/// Disable loop if neither transformer nor effect is active
|
||||
void disable_loop_if_idle_();
|
||||
|
||||
/// Schedule a write to the light output and enable the loop to process it
|
||||
void schedule_write_() {
|
||||
this->next_write_ = true;
|
||||
this->enable_loop();
|
||||
}
|
||||
|
||||
/// Store the output to allow effects to have more access.
|
||||
LightOutput *output_;
|
||||
/// The currently active transformer for this light (transition/flash).
|
||||
|
||||
Reference in New Issue
Block a user