From cb01137237d28c9280d5f70cc9d3d109b9143090 Mon Sep 17 00:00:00 2001 From: Jimmy Everling Date: Fri, 29 May 2020 20:43:13 +0200 Subject: [PATCH] Fixed 'Detected I/O inside the event loop' on update --- custom_components/panasonic_cc/panasonic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/panasonic_cc/panasonic.py b/custom_components/panasonic_cc/panasonic.py index e0dffc2..3a8d7bf 100644 --- a/custom_components/panasonic_cc/panasonic.py +++ b/custom_components/panasonic_cc/panasonic.py @@ -46,8 +46,8 @@ async def do_update(self): data= await self.hass.async_add_executor_job(self._api.get_device,self.id) except: _LOGGER.debug("Error trying to get device {id} state, probably expired token, trying to update it...".format(**self.device)) - self._api.login() - data = self._api.get_device(self.id) + await self.hass.async_add_executor_job(self._api.login) + data= await self.hass.async_add_executor_job(self._api.get_device,self.id) if data is None: self._available = False