mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 16:17:20 +00:00
Explicitly pass in the config_entry in linear_garage_door coordinator (#138109)
explicitly pass in the config_entry in coordinator
This commit is contained in:
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()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
|
||||||
|
@ -34,15 +34,16 @@ class LinearUpdateCoordinator(DataUpdateCoordinator[dict[str, LinearDevice]]):
|
|||||||
_devices: list[dict[str, Any]] | None = None
|
_devices: list[dict[str, Any]] | None = None
|
||||||
config_entry: ConfigEntry
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant) -> None:
|
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
|
||||||
"""Initialize DataUpdateCoordinator for Linear."""
|
"""Initialize DataUpdateCoordinator for Linear."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name="Linear Garage Door",
|
name="Linear Garage Door",
|
||||||
update_interval=timedelta(seconds=60),
|
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]:
|
async def _async_update_data(self) -> dict[str, LinearDevice]:
|
||||||
"""Get the data for Linear."""
|
"""Get the data for Linear."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user