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