mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Initialize color temperature to value within range if possible (#2168)
This commit is contained in:
parent
9b48ff5775
commit
0c370d5897
1 changed files with 7 additions and 0 deletions
|
@ -39,6 +39,13 @@ void LightState::setup() {
|
|||
effect->init_internal(this);
|
||||
}
|
||||
|
||||
// When supported color temperature range is known, initialize color temperature setting within bounds.
|
||||
float min_mireds = this->get_traits().get_min_mireds();
|
||||
if (min_mireds > 0) {
|
||||
this->remote_values.set_color_temperature(min_mireds);
|
||||
this->current_values.set_color_temperature(min_mireds);
|
||||
}
|
||||
|
||||
auto call = this->make_call();
|
||||
LightStateRTCState recovered{};
|
||||
switch (this->restore_mode_) {
|
||||
|
|
Loading…
Reference in a new issue