From c1b1d46d4eae250e35321082c03d5a0dd4528686 Mon Sep 17 00:00:00 2001 From: Olof Hellqvist Date: Tue, 7 May 2024 17:23:56 +0200 Subject: [PATCH 1/2] Changing to async task --- custom_components/casambi/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/casambi/manifest.json b/custom_components/casambi/manifest.json index b7b916e..ee87f7d 100644 --- a/custom_components/casambi/manifest.json +++ b/custom_components/casambi/manifest.json @@ -14,6 +14,6 @@ "aiocasambi==0.285" ], "ssdp": [], - "version": "0.127", + "version": "0.128", "zeroconf": [] } \ No newline at end of file From 96ec8b9a81612bf4b48795dfa68a82f27d89e4b5 Mon Sep 17 00:00:00 2001 From: Olof Hellqvist Date: Tue, 7 May 2024 17:25:08 +0200 Subject: [PATCH 2/2] Adding the change --- custom_components/casambi/casambi/CasambiController.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/casambi/casambi/CasambiController.py b/custom_components/casambi/casambi/CasambiController.py index f5bc7b2..5796a79 100644 --- a/custom_components/casambi/casambi/CasambiController.py +++ b/custom_components/casambi/casambi/CasambiController.py @@ -1,6 +1,7 @@ """ Support for Casambi lights. """ + import logging import aiocasambi @@ -131,7 +132,7 @@ def signalling_callback(self, signal, data): self.set_all_lights_offline() _LOGGER.debug("signalling_callback: creating reconnection") - self._hass.loop.create_task(self.async_reconnect()) + self._hass.loop.async_create_task(self.async_reconnect()) elif signal == SIGNAL_CONNECTION_STATE and (data == STATE_DISCONNECTED): _LOGGER.debug("signalling_callback websocket STATE_DISCONNECTED") @@ -139,7 +140,7 @@ def signalling_callback(self, signal, data): self.set_all_lights_offline() _LOGGER.debug("signalling_callback: creating reconnection") - self._hass.loop.create_task(self.async_reconnect()) + self._hass.loop.async_create_task(self.async_reconnect()) elif signal == SIGNAL_UNIT_PULL_UPDATE: # Update units that is specified for unit in data: