mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Initialize color temperature to value within range if possible (#2168)
This commit is contained in:
parent
8bf0448f41
commit
9ee3463d07
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