From cf137ab5868650449c6160658c07dcd7b4107a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Thu, 20 Sep 2018 08:36:12 +0200 Subject: [PATCH 1/2] Avoid calling yr update every second for a minute one every hour --- homeassistant/components/sensor/yr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/yr.py b/homeassistant/components/sensor/yr.py index f081be1a2f13a..1241d5ba062fd 100644 --- a/homeassistant/components/sensor/yr.py +++ b/homeassistant/components/sensor/yr.py @@ -91,7 +91,7 @@ async def async_setup_platform(hass, config, async_add_entities, async_add_entities(dev) weather = YrData(hass, coordinates, forecast, dev) - async_track_utc_time_change(hass, weather.updating_devices, minute=31) + async_track_utc_time_change(hass, weather.updating_devices, minute=31, second=0) await weather.fetching_data() From ee1df6ae38c0c804cefa923906f375964da022d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Thu, 20 Sep 2018 09:35:39 +0200 Subject: [PATCH 2/2] style --- homeassistant/components/sensor/yr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/yr.py b/homeassistant/components/sensor/yr.py index 1241d5ba062fd..0cb9c3765ecab 100644 --- a/homeassistant/components/sensor/yr.py +++ b/homeassistant/components/sensor/yr.py @@ -91,7 +91,8 @@ async def async_setup_platform(hass, config, async_add_entities, async_add_entities(dev) weather = YrData(hass, coordinates, forecast, dev) - async_track_utc_time_change(hass, weather.updating_devices, minute=31, second=0) + async_track_utc_time_change(hass, weather.updating_devices, + minute=31, second=0) await weather.fetching_data()