Fix executor job

This commit is contained in:
Kumi 2021-05-23 10:13:53 +02:00
parent a937ea479c
commit 6ded929af1

View file

@ -15,8 +15,11 @@ class KumiSensors:
self.host = host
self.hass = hass
def fetch_data(self) -> dict:
return json.load(urlopen(self.host))
async def get_data(self) -> dict:
return await self.hass.async_add_executor_job(json.load(urlopen(self.host)))
return await self.hass.async_add_executor_job(self.fetch_data)
async def connect(self) -> bool:
"""Test if we can connect to the host."""