added option to set polling interval

This commit is contained in:
Patrick762 committed 2023-08-26 14:44:03 +02:00
1 parent 6361e661c0
commit ed10127a90
6 files changed
+26 -7

No files matched your search

+2 -2
View File
@@ -129,13 +129,13 @@ class DummyDevice(BluettiDevice):
class PollingCoordinator(DataUpdateCoordinator):
"""Polling coordinator."""
def __init__(self, hass: HomeAssistant, address, device_name: str):
def __init__(self, hass: HomeAssistant, address, device_name: str, polling_interval: int):
"""Initialize coordinator."""
super().__init__(
hass,
_LOGGER,
name="Bluetti polling coordinator",
update_interval=timedelta(seconds=20),
update_interval=timedelta(seconds=polling_interval),
)
self._address = address
self.notify_future = None