Fix executor job
This commit is contained in:
parent
a937ea479c
commit
6ded929af1
|
@ -15,8 +15,11 @@ class KumiSensors:
|
||||||
self.host = host
|
self.host = host
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
|
|
||||||
|
def fetch_data(self) -> dict:
|
||||||
|
return json.load(urlopen(self.host))
|
||||||
|
|
||||||
async def get_data(self) -> dict:
|
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:
|
async def connect(self) -> bool:
|
||||||
"""Test if we can connect to the host."""
|
"""Test if we can connect to the host."""
|
||||||
|
|
Loading…
Reference in a new issue