Explicitly pass in the config_entry in blink coordinator init (#137727)
explicitly pass in the config_entry in blink coordinator initpull/137742/head
parent
8f1a0eadc0
commit
c85f7d0794
|
@ -85,7 +85,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: BlinkConfigEntry) -> boo
|
||||||
auth_data = deepcopy(dict(entry.data))
|
auth_data = deepcopy(dict(entry.data))
|
||||||
blink.auth = Auth(auth_data, no_prompt=True, session=session)
|
blink.auth = Auth(auth_data, no_prompt=True, session=session)
|
||||||
blink.refresh_rate = entry.options.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL)
|
blink.refresh_rate = entry.options.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL)
|
||||||
coordinator = BlinkUpdateCoordinator(hass, blink)
|
coordinator = BlinkUpdateCoordinator(hass, entry, blink)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await blink.start()
|
await blink.start()
|
||||||
|
|
|
@ -23,12 +23,17 @@ type BlinkConfigEntry = ConfigEntry[BlinkUpdateCoordinator]
|
||||||
class BlinkUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
class BlinkUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
||||||
"""BlinkUpdateCoordinator - In charge of downloading the data for a site."""
|
"""BlinkUpdateCoordinator - In charge of downloading the data for a site."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, api: Blink) -> None:
|
config_entry: BlinkConfigEntry
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self, hass: HomeAssistant, config_entry: BlinkConfigEntry, api: Blink
|
||||||
|
) -> None:
|
||||||
"""Initialize the data service."""
|
"""Initialize the data service."""
|
||||||
self.api = api
|
self.api = api
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
update_interval=timedelta(seconds=SCAN_INTERVAL),
|
update_interval=timedelta(seconds=SCAN_INTERVAL),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue