Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions homeassistant/components/demo/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_COLOR_TEMP_KELVIN,
ATTR_EFFECT,
ATTR_HS_COLOR,
ATTR_RGBW_COLOR,
Expand All @@ -28,7 +28,7 @@

LIGHT_EFFECT_LIST = ["rainbow", "none"]

LIGHT_TEMPS = [240, 380]
LIGHT_TEMPS = [4166, 2631]

SUPPORT_DEMO = {ColorMode.HS, ColorMode.COLOR_TEMP}
SUPPORT_DEMO_HS_WHITE = {ColorMode.HS, ColorMode.WHITE}
Expand Down Expand Up @@ -185,8 +185,8 @@ def rgbww_color(self) -> tuple[int, int, int, int, int] | None:
return self._rgbww_color

@property
def color_temp(self) -> int:
"""Return the CT color temperature."""
def color_temp_kelvin(self) -> int | None:
"""Return the color temperature value in Kelvin."""
return self._ct

@property
Expand Down Expand Up @@ -216,9 +216,9 @@ async def async_turn_on(self, **kwargs: Any) -> None:
if ATTR_BRIGHTNESS in kwargs:
self._brightness = kwargs[ATTR_BRIGHTNESS]

if ATTR_COLOR_TEMP in kwargs:
if ATTR_COLOR_TEMP_KELVIN in kwargs:
self._color_mode = ColorMode.COLOR_TEMP
self._ct = kwargs[ATTR_COLOR_TEMP]
self._ct = kwargs[ATTR_COLOR_TEMP_KELVIN]

if ATTR_EFFECT in kwargs:
self._effect = kwargs[ATTR_EFFECT]
Expand Down
4 changes: 2 additions & 2 deletions tests/components/google_assistant/test_smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,15 @@ async def test_query_message(hass: HomeAssistant) -> None:
light.async_write_ha_state()

light2 = DemoLight(
None, "Another Light", state=True, hs_color=(180, 75), ct=400, brightness=78
None, "Another Light", state=True, hs_color=(180, 75), ct=2500, brightness=78
)
light2.hass = hass
light2.entity_id = "light.another_light"
light2._attr_device_info = None
light2._attr_name = "Another Light"
light2.async_write_ha_state()

light3 = DemoLight(None, "Color temp Light", state=True, ct=400, brightness=200)
light3 = DemoLight(None, "Color temp Light", state=True, ct=2500, brightness=200)
light3.hass = hass
light3.entity_id = "light.color_temp_light"
light3._attr_device_info = None
Expand Down