Explicitly pass in the config_entry in linear_garage_door coordinator (#138109)
explicitly pass in the config_entry in coordinatorpull/138123/head
parent
cd8e1beb37
commit
eebe182001
|
@ -31,7 +31,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
},
|
||||
)
|
||||
|
||||
coordinator = LinearUpdateCoordinator(hass)
|
||||
coordinator = LinearUpdateCoordinator(hass, entry)
|
||||
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
|
|
|
@ -34,15 +34,16 @@ class LinearUpdateCoordinator(DataUpdateCoordinator[dict[str, LinearDevice]]):
|
|||
_devices: list[dict[str, Any]] | None = None
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(self, hass: HomeAssistant) -> None:
|
||||
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
|
||||
"""Initialize DataUpdateCoordinator for Linear."""
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name="Linear Garage Door",
|
||||
update_interval=timedelta(seconds=60),
|
||||
)
|
||||
self.site_id = self.config_entry.data["site_id"]
|
||||
self.site_id = config_entry.data["site_id"]
|
||||
|
||||
async def _async_update_data(self) -> dict[str, LinearDevice]:
|
||||
"""Get the data for Linear."""
|
||||
|
|
Loading…
Reference in New Issue