Reduce coordinator cooldown for roku (#65973)
This commit is contained in:
parent
211db79f11
commit
18ac72f613
1 changed files with 8 additions and 0 deletions
|
@ -9,11 +9,14 @@ from rokuecp.models import Device
|
|||
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.debounce import Debouncer
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
REQUEST_REFRESH_DELAY = 0.35
|
||||
|
||||
SCAN_INTERVAL = timedelta(seconds=10)
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -41,6 +44,11 @@ class RokuDataUpdateCoordinator(DataUpdateCoordinator[Device]):
|
|||
_LOGGER,
|
||||
name=DOMAIN,
|
||||
update_interval=SCAN_INTERVAL,
|
||||
# We don't want an immediate refresh since the device
|
||||
# takes a moment to reflect the state change
|
||||
request_refresh_debouncer=Debouncer(
|
||||
hass, _LOGGER, cooldown=REQUEST_REFRESH_DELAY, immediate=False
|
||||
),
|
||||
)
|
||||
|
||||
async def _async_update_data(self) -> Device:
|
||||
|
|
Loading…
Add table
Reference in a new issue