mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Adjust Plugwise debouncer to not refresh immediately (#66521)
This commit is contained in:
parent
6d10bd094f
commit
4dbd9b21b7
@ -6,6 +6,7 @@ from plugwise import Smile
|
|||||||
from plugwise.exceptions import PlugwiseException, XMLDataMissingError
|
from plugwise.exceptions import PlugwiseException, XMLDataMissingError
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.debounce import Debouncer
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
|
|
||||||
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, LOGGER
|
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, LOGGER
|
||||||
@ -30,6 +31,14 @@ class PlugwiseDataUpdateCoordinator(DataUpdateCoordinator[PlugwiseData]):
|
|||||||
update_interval=DEFAULT_SCAN_INTERVAL.get(
|
update_interval=DEFAULT_SCAN_INTERVAL.get(
|
||||||
str(api.smile_type), timedelta(seconds=60)
|
str(api.smile_type), timedelta(seconds=60)
|
||||||
),
|
),
|
||||||
|
# Don't refresh immediately, give the device time to process
|
||||||
|
# the change in state before we query it.
|
||||||
|
request_refresh_debouncer=Debouncer(
|
||||||
|
hass,
|
||||||
|
LOGGER,
|
||||||
|
cooldown=1.5,
|
||||||
|
immediate=False,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
self.api = api
|
self.api = api
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user