mirror of
https://github.com/esphome/esphome.git
synced 2025-10-28 05:33:53 +00:00
Allow transforms and flashes to not update remote_values (#2313)
This commit is contained in:
@@ -228,13 +228,16 @@ void LightState::stop_effect_() {
|
||||
this->active_effect_index_ = 0;
|
||||
}
|
||||
|
||||
void LightState::start_transition_(const LightColorValues &target, uint32_t length) {
|
||||
void LightState::start_transition_(const LightColorValues &target, uint32_t length, bool set_remote_values) {
|
||||
this->transformer_ = this->output_->create_default_transition();
|
||||
this->transformer_->setup(this->current_values, target, length);
|
||||
this->remote_values = target;
|
||||
|
||||
if (set_remote_values) {
|
||||
this->remote_values = target;
|
||||
}
|
||||
}
|
||||
|
||||
void LightState::start_flash_(const LightColorValues &target, uint32_t length) {
|
||||
void LightState::start_flash_(const LightColorValues &target, uint32_t length, bool set_remote_values) {
|
||||
LightColorValues end_colors = this->remote_values;
|
||||
// If starting a flash if one is already happening, set end values to end values of current flash
|
||||
// Hacky but works
|
||||
@@ -243,7 +246,10 @@ void LightState::start_flash_(const LightColorValues &target, uint32_t length) {
|
||||
|
||||
this->transformer_ = make_unique<LightFlashTransformer>(*this);
|
||||
this->transformer_->setup(end_colors, target, length);
|
||||
this->remote_values = target;
|
||||
|
||||
if (set_remote_values) {
|
||||
this->remote_values = target;
|
||||
};
|
||||
}
|
||||
|
||||
void LightState::set_immediately_(const LightColorValues &target, bool set_remote_values) {
|
||||
|
||||
Reference in New Issue
Block a user