From eb572093a79f215fd2832ca2cdaf47132efbabc0 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Thu, 10 Aug 2023 13:48:36 -0700 Subject: [PATCH] await switch.manager.adaptation_tasks --- custom_components/adaptive_lighting/switch.py | 2 -- tests/test_switch.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index eb005ef2..ad23253c 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -2259,8 +2259,6 @@ class AdaptiveLightingManager: elif state == STATE_OFF: # is turning on on(eid, event) - _LOGGER.debug("end of turn_on_off_event_listener()") - async def state_changed_event_listener(self, event: Event) -> None: """Track 'state_changed' events.""" entity_id = event.data.get(ATTR_ENTITY_ID, "") diff --git a/tests/test_switch.py b/tests/test_switch.py index 25bd359c..7c7caef8 100644 --- a/tests/test_switch.py +++ b/tests/test_switch.py @@ -590,6 +590,7 @@ async def test_manual_control( async def update(): await switch._update_attrs_and_maybe_adapt_lights(context=context, transition=0) + await asyncio.gather(*switch.manager.adaptation_tasks) await hass.async_block_till_done() async def turn_light(state, **kwargs):