diff --git a/custom_components/hilo/const.py b/custom_components/hilo/const.py index e61d071..50ab127 100755 --- a/custom_components/hilo/const.py +++ b/custom_components/hilo/const.py @@ -46,6 +46,7 @@ MAX_SUB_INTERVAL = 120 MIN_SCAN_INTERVAL = 60 REWARD_SCAN_INTERVAL = 7200 +WEATHER_SCAN_INTERVAL = 1800 CONF_TARIFF = { "rate d": { diff --git a/custom_components/hilo/sensor.py b/custom_components/hilo/sensor.py index a4a9e49..e94a6e7 100755 --- a/custom_components/hilo/sensor.py +++ b/custom_components/hilo/sensor.py @@ -67,6 +67,7 @@ REWARD_SCAN_INTERVAL, TARIFF_LIST, WEATHER_CONDITIONS, + WEATHER_SCAN_INTERVAL, ) from .entity import HiloEntity from .managers import EnergyManager, UtilityManager @@ -1247,7 +1248,7 @@ def __init__(self, hilo, device, scan_interval): f"{slugify(device.identifier)}-{slugify(self._attr_name)}" ) LOG.debug("Setting up OutdoorWeatherSensor entity: %s", self._attr_name) - self.scan_interval = timedelta(seconds=EVENT_SCAN_INTERVAL_REDUCTION) + self.scan_interval = timedelta(seconds=WEATHER_SCAN_INTERVAL) self._state = STATE_UNKNOWN self._weather = {} self.async_update = Throttle(self.scan_interval)(self._async_update)