From 37f110f5d166266303e5345def7e62def250b0a6 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 29 Sep 2020 14:21:39 +0200 Subject: [PATCH] use locks --- custom_components/adaptive_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 47d892ff..ac592efb 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -569,7 +569,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): ) lock = self._locks.get(entity_id) if lock is None: - lock = asyncio.Lock() + lock = self._locks[entity_id] = asyncio.Lock() async with lock: if await self.turn_on_off_listener.maybe_cancel_adjusting( entity_id,