From 8348878e7e2534e8d3c8105a648509fc3026283e Mon Sep 17 00:00:00 2001 From: Hans Oischinger Date: Tue, 17 Mar 2020 21:19:57 +0100 Subject: [PATCH] Introduce safe scan_interval for vicare (#32915) --- homeassistant/components/vicare/climate.py | 4 ++++ homeassistant/components/vicare/water_heater.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/homeassistant/components/vicare/climate.py b/homeassistant/components/vicare/climate.py index 1b101cc7612..ef5533523f8 100644 --- a/homeassistant/components/vicare/climate.py +++ b/homeassistant/components/vicare/climate.py @@ -1,4 +1,5 @@ """Viessmann ViCare climate device.""" +from datetime import timedelta import logging import requests @@ -79,6 +80,9 @@ HA_TO_VICARE_PRESET_HEATING = { PYVICARE_ERROR = "error" +# Scan interval of 15 minutes seems to be safe to not hit the ViCare server rate limit +SCAN_INTERVAL = timedelta(seconds=900) + def setup_platform(hass, config, add_entities, discovery_info=None): """Create the ViCare climate devices.""" diff --git a/homeassistant/components/vicare/water_heater.py b/homeassistant/components/vicare/water_heater.py index eea3d81faf6..fdac2962739 100644 --- a/homeassistant/components/vicare/water_heater.py +++ b/homeassistant/components/vicare/water_heater.py @@ -1,4 +1,5 @@ """Viessmann ViCare water_heater device.""" +from datetime import timedelta import logging import requests @@ -42,6 +43,9 @@ HA_TO_VICARE_HVAC_DHW = { PYVICARE_ERROR = "error" +# Scan interval of 15 minutes seems to be safe to not hit the ViCare server rate limit +SCAN_INTERVAL = timedelta(seconds=900) + def setup_platform(hass, config, add_entities, discovery_info=None): """Create the ViCare water_heater devices."""