From d8dc89c701606ce7548f9cb936b7ff32a21d9732 Mon Sep 17 00:00:00 2001 From: Darko Bogdanovic Date: Wed, 26 Aug 2026 01:16:30 +0930 Subject: [PATCH] feat: add scan_interval parameter and update polling logic --- pyintesishome/intesishomelocal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyintesishome/intesishomelocal.py b/pyintesishome/intesishomelocal.py index ed515a8..32b5558 100644 --- a/pyintesishome/intesishomelocal.py +++ b/pyintesishome/intesishomelocal.py @@ -27,16 +27,16 @@ class IntesisHomeLocal(IntesisBase): """pyintesishome local class.""" - def __init__(self, host, username, password, loop=None, websession=None) -> None: + def __init__(self, host, username, password, loop=None, websession=None, scan_interval=30) -> None: """Constructor""" device_type = DEVICE_INTESISHOME_LOCAL self._session_id: str = "" self._datapoints: dict = {} - self._scan_interval = 6 + self._scan_interval = scan_interval # Ceiling on the backed-off poll interval while the device is # failing. These units are not powerful, and polling a struggling # one every _scan_interval can make matters worse. - self._max_scan_interval = 30 + self._max_scan_interval = max(60, scan_interval * 2) # Seconds without a successful poll before the device is reported # as disconnected. Deliberately expressed as elapsed time rather # than a failure count: a failed request can occupy anywhere from