From b54aa2ecec81b518e1059c763b429ee178ac8ac1 Mon Sep 17 00:00:00 2001 From: "Ian C." <108159253+ic-dev21@users.noreply.github.com> Date: Tue, 27 Jan 2026 20:12:33 -0500 Subject: [PATCH] Reduce weather polling --- custom_components/hilo/const.py | 1 + custom_components/hilo/sensor.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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)