diff --git a/kumisensors.py b/kumisensors.py index 163c321..f01f42c 100644 --- a/kumisensors.py +++ b/kumisensors.py @@ -13,15 +13,10 @@ class KumiSensors: if not "://" in host: host = "http://" + host self.host = host - self.data = None self.hass = hass - def fetch_data(self): - return json.load(urlopen(self.host)) - async def get_data(self) -> dict: - self.data = self.data or await self.hass.async_add_executor_job(self.fetch_data) - return self.data + return await self.hass.async_add_executor_job(json.load(urlopen(self.host))) async def connect(self) -> bool: """Test if we can connect to the host."""