mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Remove deprecated 'run_immediately' (#991)
This commit is contained in:
parent
1a2cd7399d
commit
b746e5f19c
1 changed files with 0 additions and 9 deletions
|
|
@ -60,7 +60,6 @@ from homeassistant.const import (
|
|||
STATE_OFF,
|
||||
STATE_ON,
|
||||
)
|
||||
from homeassistant.const import __version__ as ha_version
|
||||
from homeassistant.core import (
|
||||
CALLBACK_TYPE,
|
||||
Context,
|
||||
|
|
@ -950,15 +949,9 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
if self.hass.is_running:
|
||||
await self._setup_listeners()
|
||||
else:
|
||||
kw = {}
|
||||
year, month = (int(x) for x in ha_version.split(".")[:2])
|
||||
if (year, month) >= (2024, 4):
|
||||
# Added in https://github.com/home-assistant/core/pull/113020
|
||||
kw["run_immediately"] = False
|
||||
self.hass.bus.async_listen_once(
|
||||
EVENT_HOMEASSISTANT_STARTED,
|
||||
self._setup_listeners,
|
||||
**kw,
|
||||
)
|
||||
last_state: State | None = await self.async_get_last_state()
|
||||
is_new_entry = last_state is None # newly added to HA
|
||||
|
|
@ -1665,12 +1658,10 @@ class AdaptiveLightingManager:
|
|||
self.hass.bus.async_listen(
|
||||
EVENT_CALL_SERVICE,
|
||||
self.turn_on_off_event_listener,
|
||||
run_immediately=False,
|
||||
),
|
||||
self.hass.bus.async_listen(
|
||||
EVENT_STATE_CHANGED,
|
||||
self.state_changed_event_listener,
|
||||
run_immediately=False,
|
||||
),
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue