From b746e5f19ccc34346f34cd97f54197e7c534ded9 Mon Sep 17 00:00:00 2001 From: Frosh Date: Sun, 12 May 2024 20:32:46 +0200 Subject: [PATCH] Remove deprecated 'run_immediately' (#991) --- custom_components/adaptive_lighting/switch.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 2b23c71c..23ca14f9 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -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, ), ]