1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 21:23:48 +00:00

Color brightness fixes (#2008)

This commit is contained in:
Oxan van Leeuwen
2021-07-13 02:28:29 +02:00
committed by GitHub
parent 7dd16df846
commit fb8ec79a52
3 changed files with 21 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ LightCall LightState::make_call() { return LightCall(this); }
struct LightStateRTCState {
bool state{false};
float brightness{1.0f};
float color_brightness{1.0f};
float red{1.0f};
float green{1.0f};
float blue{1.0f};
@@ -65,6 +66,7 @@ void LightState::setup() {
call.set_state(recovered.state);
call.set_brightness_if_supported(recovered.brightness);
call.set_color_brightness_if_supported(recovered.color_brightness);
call.set_red_if_supported(recovered.red);
call.set_green_if_supported(recovered.green);
call.set_blue_if_supported(recovered.blue);
@@ -244,6 +246,7 @@ void LightState::save_remote_values_() {
LightStateRTCState saved;
saved.state = this->remote_values.is_on();
saved.brightness = this->remote_values.get_brightness();
saved.color_brightness = this->remote_values.get_color_brightness();
saved.red = this->remote_values.get_red();
saved.green = this->remote_values.get_green();
saved.blue = this->remote_values.get_blue();