mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Set correct ESPHome color mode when setting color temperature (#54596)
This commit is contained in:
parent
a892605a90
commit
844000556f
@ -157,7 +157,11 @@ class EsphomeLight(EsphomeEntity[LightInfo, LightState], LightEntity):
|
|||||||
if (color_temp := kwargs.get(ATTR_COLOR_TEMP)) is not None:
|
if (color_temp := kwargs.get(ATTR_COLOR_TEMP)) is not None:
|
||||||
data["color_temperature"] = color_temp
|
data["color_temperature"] = color_temp
|
||||||
if self._supports_color_mode:
|
if self._supports_color_mode:
|
||||||
data["color_mode"] = LightColorMode.COLOR_TEMPERATURE
|
supported_modes = self._native_supported_color_modes
|
||||||
|
if LightColorMode.COLOR_TEMPERATURE in supported_modes:
|
||||||
|
data["color_mode"] = LightColorMode.COLOR_TEMPERATURE
|
||||||
|
elif LightColorMode.COLD_WARM_WHITE in supported_modes:
|
||||||
|
data["color_mode"] = LightColorMode.COLD_WARM_WHITE
|
||||||
|
|
||||||
if (effect := kwargs.get(ATTR_EFFECT)) is not None:
|
if (effect := kwargs.get(ATTR_EFFECT)) is not None:
|
||||||
data["effect"] = effect
|
data["effect"] = effect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user