mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Explicitly pass in the config_entry in streamlabswater coordinator (#137927)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
43569df537
commit
bcc3e6d31c
@ -35,7 +35,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
|
|
||||||
api_key = entry.data[CONF_API_KEY]
|
api_key = entry.data[CONF_API_KEY]
|
||||||
client = StreamlabsClient(api_key)
|
client = StreamlabsClient(api_key)
|
||||||
coordinator = StreamlabsCoordinator(hass, client)
|
coordinator = StreamlabsCoordinator(hass, entry, client)
|
||||||
|
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ from datetime import timedelta
|
|||||||
|
|
||||||
from streamlabswater.streamlabswater import StreamlabsClient
|
from streamlabswater.streamlabswater import StreamlabsClient
|
||||||
|
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
@ -25,15 +26,19 @@ class StreamlabsData:
|
|||||||
class StreamlabsCoordinator(DataUpdateCoordinator[dict[str, StreamlabsData]]):
|
class StreamlabsCoordinator(DataUpdateCoordinator[dict[str, StreamlabsData]]):
|
||||||
"""Coordinator for Streamlabs."""
|
"""Coordinator for Streamlabs."""
|
||||||
|
|
||||||
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
client: StreamlabsClient,
|
client: StreamlabsClient,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Coordinator for Streamlabs."""
|
"""Coordinator for Streamlabs."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
LOGGER,
|
LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name="Streamlabs",
|
name="Streamlabs",
|
||||||
update_interval=timedelta(seconds=60),
|
update_interval=timedelta(seconds=60),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user