mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Pass config_entry as param to Shelly coordinator (#137276)
* Pass config_entry as param * diff approach
This commit is contained in:
parent
6fa87da5bd
commit
1654c28d74
@ -17,7 +17,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
entry.data[CONF_HOST],
|
entry.data[CONF_HOST],
|
||||||
entry.data[CONF_USERNAME],
|
entry.data[CONF_USERNAME],
|
||||||
entry.data[CONF_PASSWORD],
|
entry.data[CONF_PASSWORD],
|
||||||
entry.unique_id,
|
entry,
|
||||||
)
|
)
|
||||||
|
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
@ -50,7 +50,7 @@ class VodafoneStationRouter(DataUpdateCoordinator[UpdateCoordinatorDataType]):
|
|||||||
host: str,
|
host: str,
|
||||||
username: str,
|
username: str,
|
||||||
password: str,
|
password: str,
|
||||||
config_entry_unique_id: str | None,
|
config_entry: ConfigEntry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the scanner."""
|
"""Initialize the scanner."""
|
||||||
|
|
||||||
@ -58,13 +58,14 @@ class VodafoneStationRouter(DataUpdateCoordinator[UpdateCoordinatorDataType]):
|
|||||||
self.api = VodafoneStationSercommApi(host, username, password)
|
self.api = VodafoneStationSercommApi(host, username, password)
|
||||||
|
|
||||||
# Last resort as no MAC or S/N can be retrieved via API
|
# Last resort as no MAC or S/N can be retrieved via API
|
||||||
self._id = config_entry_unique_id
|
self._id = config_entry.unique_id
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass=hass,
|
hass=hass,
|
||||||
logger=_LOGGER,
|
logger=_LOGGER,
|
||||||
name=f"{DOMAIN}-{host}-coordinator",
|
name=f"{DOMAIN}-{host}-coordinator",
|
||||||
update_interval=timedelta(seconds=SCAN_INTERVAL),
|
update_interval=timedelta(seconds=SCAN_INTERVAL),
|
||||||
|
config_entry=config_entry,
|
||||||
)
|
)
|
||||||
device_reg = dr.async_get(self.hass)
|
device_reg = dr.async_get(self.hass)
|
||||||
device_list = dr.async_entries_for_config_entry(
|
device_list = dr.async_entries_for_config_entry(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user