File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
homeassistant/components/lifx Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 55import asyncio
66from collections .abc import Callable
77from datetime import timedelta
8- from typing import Any
8+ from typing import TYPE_CHECKING , Any
99
1010import aiolifx_effects
1111from aiolifx_themes .painter import ThemePainter
3131from homeassistant .helpers .service import async_extract_referenced_entity_ids
3232
3333from .const import _ATTR_COLOR_TEMP , ATTR_THEME , DATA_LIFX_MANAGER , DOMAIN
34- from .coordinator import LIFXUpdateCoordinator , Light
34+ from .coordinator import LIFXUpdateCoordinator
3535from .util import convert_8_to_16 , find_hsbk
3636
37+ if TYPE_CHECKING :
38+ from aiolifx .aiolifx import Light
39+
3740SCAN_INTERVAL = timedelta (seconds = 10 )
3841
3942SERVICE_EFFECT_COLORLOOP = "effect_colorloop"
@@ -426,8 +429,8 @@ async def _start_effect_sky(
426429 ) -> None :
427430 """Start the firmware-based Sky effect."""
428431 palette = kwargs .get (ATTR_PALETTE )
432+ theme = Theme ()
429433 if palette is not None :
430- theme = Theme ()
431434 for hsbk in palette :
432435 theme .add_hsbk (hsbk [0 ], hsbk [1 ], hsbk [2 ], hsbk [3 ])
433436
Original file line number Diff line number Diff line change @@ -843,7 +843,7 @@ async def test_sky_effect(hass: HomeAssistant) -> None:
843843 SERVICE_EFFECT_SKY ,
844844 {
845845 ATTR_ENTITY_ID : entity_id ,
846- ATTR_PALETTE : [] ,
846+ ATTR_PALETTE : None ,
847847 ATTR_SKY_TYPE : "Clouds" ,
848848 ATTR_CLOUD_SATURATION_MAX : 180 ,
849849 ATTR_CLOUD_SATURATION_MIN : 50 ,
@@ -854,7 +854,7 @@ async def test_sky_effect(hass: HomeAssistant) -> None:
854854 bulb .power_level = 65535
855855 bulb .effect = {
856856 "effect" : "SKY" ,
857- "palette" : [] ,
857+ "palette" : None ,
858858 "sky_type" : 2 ,
859859 "cloud_saturation_min" : 50 ,
860860 "cloud_saturation_max" : 180 ,
You can’t perform that action at this time.
0 commit comments