mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 12:27:13 +01:00
Fix saving light state for restore modes LIGHT_RESTORE_AND_OFF/ON (#4131)
This commit is contained in:
parent
50e8e92f0b
commit
57a1c207c2
@ -276,7 +276,15 @@ void LightState::set_immediately_(const LightColorValues &target, bool set_remot
|
|||||||
void LightState::save_remote_values_() {
|
void LightState::save_remote_values_() {
|
||||||
LightStateRTCState saved;
|
LightStateRTCState saved;
|
||||||
saved.color_mode = this->remote_values.get_color_mode();
|
saved.color_mode = this->remote_values.get_color_mode();
|
||||||
|
switch (this->restore_mode_) {
|
||||||
|
case LIGHT_RESTORE_AND_OFF:
|
||||||
|
case LIGHT_RESTORE_AND_ON:
|
||||||
|
saved.state = (this->restore_mode_ == LIGHT_RESTORE_AND_ON);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
saved.state = this->remote_values.is_on();
|
saved.state = this->remote_values.is_on();
|
||||||
|
break;
|
||||||
|
}
|
||||||
saved.brightness = this->remote_values.get_brightness();
|
saved.brightness = this->remote_values.get_brightness();
|
||||||
saved.color_brightness = this->remote_values.get_color_brightness();
|
saved.color_brightness = this->remote_values.get_color_brightness();
|
||||||
saved.red = this->remote_values.get_red();
|
saved.red = this->remote_values.get_red();
|
||||||
|
Loading…
Reference in New Issue
Block a user