Pass config_entry explicitly in rachio (#130865)
parent
db5cc4fcd4
commit
1ac0b006b2
|
@ -8,6 +8,7 @@ from typing import Any
|
|||
from rachiopy import Rachio
|
||||
from requests.exceptions import Timeout
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.debounce import Debouncer
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
|
@ -38,6 +39,7 @@ class RachioUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||
self,
|
||||
hass: HomeAssistant,
|
||||
rachio: Rachio,
|
||||
config_entry: ConfigEntry,
|
||||
base_station,
|
||||
base_count: int,
|
||||
) -> None:
|
||||
|
@ -48,6 +50,7 @@ class RachioUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=f"{DOMAIN} update coordinator",
|
||||
# To avoid exceeding the rate limit, increase polling interval for
|
||||
# each additional base station on the account
|
||||
|
@ -76,6 +79,7 @@ class RachioScheduleUpdateCoordinator(DataUpdateCoordinator[list[dict[str, Any]]
|
|||
self,
|
||||
hass: HomeAssistant,
|
||||
rachio: Rachio,
|
||||
config_entry: ConfigEntry,
|
||||
base_station,
|
||||
) -> None:
|
||||
"""Initialize a Rachio schedule coordinator."""
|
||||
|
@ -85,6 +89,7 @@ class RachioScheduleUpdateCoordinator(DataUpdateCoordinator[list[dict[str, Any]]
|
|||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=f"{DOMAIN} schedule update coordinator",
|
||||
update_interval=timedelta(minutes=30),
|
||||
)
|
||||
|
|
|
@ -189,8 +189,10 @@ class RachioPerson:
|
|||
RachioBaseStation(
|
||||
rachio,
|
||||
base,
|
||||
RachioUpdateCoordinator(hass, rachio, base, base_count),
|
||||
RachioScheduleUpdateCoordinator(hass, rachio, base),
|
||||
RachioUpdateCoordinator(
|
||||
hass, rachio, self.config_entry, base, base_count
|
||||
),
|
||||
RachioScheduleUpdateCoordinator(hass, rachio, self.config_entry, base),
|
||||
)
|
||||
for base in base_stations
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue