File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
custom_components/adaptive_lighting Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 8
8
"iot_class" : " calculated" ,
9
9
"issue_tracker" : " https://github.com/basnijholt/adaptive-lighting/issues" ,
10
10
"requirements" : [" ulid-transform" ],
11
- "version" : " 1.21.0 "
11
+ "version" : " 1.21.1 "
12
12
}
Original file line number Diff line number Diff line change 60
60
STATE_OFF ,
61
61
STATE_ON ,
62
62
)
63
+ from homeassistant .const import __version__ as ha_version
63
64
from homeassistant .core import (
64
65
CALLBACK_TYPE ,
65
66
Context ,
@@ -949,10 +950,15 @@ async def async_added_to_hass(self) -> None:
949
950
if self .hass .is_running :
950
951
await self ._setup_listeners ()
951
952
else :
953
+ kw = {}
954
+ year , month = (int (x ) for x in ha_version .split ("." )[:2 ])
955
+ if (year , month ) >= (2024 , 4 ):
956
+ # Added in https://github.com/home-assistant/core/pull/113020
957
+ kw ["run_immediately" ] = False
952
958
self .hass .bus .async_listen_once (
953
959
EVENT_HOMEASSISTANT_STARTED ,
954
960
self ._setup_listeners ,
955
- run_immediately = False ,
961
+ ** kw ,
956
962
)
957
963
last_state : State | None = await self .async_get_last_state ()
958
964
is_new_entry = last_state is None # newly added to HA
You can’t perform that action at this time.
0 commit comments