mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Explicitly pass in the config_entry in plaato coordinator (#138040)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
15b8687c53
commit
6cdc3acffb
@ -121,7 +121,9 @@ async def async_setup_coordinator(hass: HomeAssistant, entry: ConfigEntry):
|
||||
else:
|
||||
update_interval = timedelta(minutes=DEFAULT_SCAN_INTERVAL)
|
||||
|
||||
coordinator = PlaatoCoordinator(hass, auth_token, device_type, update_interval)
|
||||
coordinator = PlaatoCoordinator(
|
||||
hass, entry, auth_token, device_type, update_interval
|
||||
)
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
_set_entry_data(entry, hass, coordinator, auth_token)
|
||||
|
@ -5,6 +5,7 @@ import logging
|
||||
|
||||
from pyplaato.plaato import Plaato, PlaatoDeviceType
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
@ -18,9 +19,12 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class PlaatoCoordinator(DataUpdateCoordinator):
|
||||
"""Class to manage fetching data from the API."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
auth_token: str,
|
||||
device_type: PlaatoDeviceType,
|
||||
update_interval: timedelta,
|
||||
@ -34,6 +38,7 @@ class PlaatoCoordinator(DataUpdateCoordinator):
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=DOMAIN,
|
||||
update_interval=update_interval,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user