mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-10-07 18:07:08 +02:00
Fix test_proactive_adaptation_with_separate_commands (#970)
* Add link script * Set run_immediately=False * Add await hass.async_block_till_done() * Use scripts/link * Rename scripts * Links in devcontainer * Install from setup script
This commit is contained in:
parent
47cbda5c5e
commit
d23f6ec63a
10 changed files with 29 additions and 46 deletions
|
|
@ -952,6 +952,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
self.hass.bus.async_listen_once(
|
||||
EVENT_HOMEASSISTANT_STARTED,
|
||||
self._setup_listeners,
|
||||
run_immediately=False,
|
||||
)
|
||||
last_state: State | None = await self.async_get_last_state()
|
||||
is_new_entry = last_state is None # newly added to HA
|
||||
|
|
@ -1658,10 +1659,12 @@ 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