Add polling to LetPot coordinator (#146823)
- Adds polling (update_interval) to the coordinator for the LetPot integration. Push remains the primary update mechanism for all entities, but: - Polling makes entities go unavailable when the device can't be reached, which otherwise won't happen. - Pump changes do not always trigger a status push by the device (not sure why), polling makes the integration catch up to reality.pull/145896/head^2
parent
ce52ef64db
commit
6204fd5363
|
@ -3,6 +3,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from letpot.deviceclient import LetPotDeviceClient
|
from letpot.deviceclient import LetPotDeviceClient
|
||||||
|
@ -42,6 +43,7 @@ class LetPotDeviceCoordinator(DataUpdateCoordinator[LetPotDeviceStatus]):
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
config_entry=config_entry,
|
config_entry=config_entry,
|
||||||
name=f"LetPot {device.serial_number}",
|
name=f"LetPot {device.serial_number}",
|
||||||
|
update_interval=timedelta(minutes=10),
|
||||||
)
|
)
|
||||||
self._info = info
|
self._info = info
|
||||||
self.device = device
|
self.device = device
|
||||||
|
|
|
@ -5,9 +5,9 @@ rules:
|
||||||
comment: |
|
comment: |
|
||||||
This integration does not provide additional actions.
|
This integration does not provide additional actions.
|
||||||
appropriate-polling:
|
appropriate-polling:
|
||||||
status: exempt
|
status: done
|
||||||
comment: |
|
comment: |
|
||||||
This integration only receives push-based updates.
|
Primarily uses push, but polls with a long interval for availability and missed updates.
|
||||||
brands: done
|
brands: done
|
||||||
common-modules: done
|
common-modules: done
|
||||||
config-flow-test-coverage: done
|
config-flow-test-coverage: done
|
||||||
|
@ -39,7 +39,7 @@ rules:
|
||||||
comment: |
|
comment: |
|
||||||
The integration does not have configuration options.
|
The integration does not have configuration options.
|
||||||
docs-installation-parameters: done
|
docs-installation-parameters: done
|
||||||
entity-unavailable: todo
|
entity-unavailable: done
|
||||||
integration-owner: done
|
integration-owner: done
|
||||||
log-when-unavailable: todo
|
log-when-unavailable: todo
|
||||||
parallel-updates: done
|
parallel-updates: done
|
||||||
|
|
Loading…
Reference in New Issue