From 59c62a261bbcd4591d0827a1bd448b89cb5c92c5 Mon Sep 17 00:00:00 2001 From: michaeldavie Date: Thu, 25 Jul 2019 07:56:33 -0400 Subject: [PATCH] Add scan interval to config of Environment Canada sensor (#25414) * Make refresh period configurable * Remove throttle, set SCAN_INTERVAL * Move SCAN_INTERVAL to module --- homeassistant/components/environment_canada/sensor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/environment_canada/sensor.py b/homeassistant/components/environment_canada/sensor.py index 9bfb205f4e5..70b98eeebdd 100755 --- a/homeassistant/components/environment_canada/sensor.py +++ b/homeassistant/components/environment_canada/sensor.py @@ -15,11 +15,12 @@ from homeassistant.const import ( TEMP_CELSIUS, CONF_LATITUDE, CONF_LONGITUDE, ATTR_ATTRIBUTION, ATTR_LOCATION) from homeassistant.helpers.entity import Entity -from homeassistant.util import Throttle import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) +SCAN_INTERVAL = timedelta(minutes=10) + ATTR_UPDATED = 'updated' ATTR_STATION = 'station' ATTR_DETAIL = 'alert detail' @@ -29,8 +30,6 @@ CONF_ATTRIBUTION = "Data provided by Environment Canada" CONF_STATION = 'station' CONF_LANGUAGE = 'language' -MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=1) - def validate_station(station): """Check that the station ID is well-formed.""" @@ -110,7 +109,6 @@ class ECSensor(Entity): """Return the units of measurement.""" return self._unit - @Throttle(MIN_TIME_BETWEEN_UPDATES) def update(self): """Update current conditions.""" self.ec_data.update()