mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Explicitly pass in the config_entry in xbox coordinator (#137864)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
3ec872fbfe
commit
c17007e17b
@ -48,7 +48,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
consoles.dict(),
|
||||
)
|
||||
|
||||
coordinator = XboxUpdateCoordinator(hass, client, consoles)
|
||||
coordinator = XboxUpdateCoordinator(hass, entry, client, consoles)
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = {
|
||||
|
@ -20,6 +20,7 @@ from xbox.webapi.api.provider.smartglass.models import (
|
||||
SmartglassConsoleStatus,
|
||||
)
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
@ -64,9 +65,12 @@ class XboxData:
|
||||
class XboxUpdateCoordinator(DataUpdateCoordinator[XboxData]):
|
||||
"""Store Xbox Console Status."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
client: XboxLiveClient,
|
||||
consoles: SmartglassConsoleList,
|
||||
) -> None:
|
||||
@ -74,6 +78,7 @@ class XboxUpdateCoordinator(DataUpdateCoordinator[XboxData]):
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=DOMAIN,
|
||||
update_interval=timedelta(seconds=10),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user