mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Explicitly pass in the config_entry in screenlogic coordinator init (#137463)
explicitly pass in the config_entry in coordinator init
This commit is contained in:
parent
c222ffb4ec
commit
ab80770252
@ -52,6 +52,8 @@ async def async_get_connect_info(
|
|||||||
class ScreenlogicDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
class ScreenlogicDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
||||||
"""Class to manage the data update for the Screenlogic component."""
|
"""Class to manage the data update for the Screenlogic component."""
|
||||||
|
|
||||||
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
@ -60,7 +62,6 @@ class ScreenlogicDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
|||||||
gateway: ScreenLogicGateway,
|
gateway: ScreenLogicGateway,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the Screenlogic Data Update Coordinator."""
|
"""Initialize the Screenlogic Data Update Coordinator."""
|
||||||
self.config_entry = config_entry
|
|
||||||
self.gateway = gateway
|
self.gateway = gateway
|
||||||
|
|
||||||
interval = timedelta(
|
interval = timedelta(
|
||||||
@ -69,6 +70,7 @@ class ScreenlogicDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
|||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
update_interval=interval,
|
update_interval=interval,
|
||||||
# Debounced option since the device takes
|
# Debounced option since the device takes
|
||||||
@ -91,7 +93,6 @@ class ScreenlogicDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
|||||||
|
|
||||||
async def _async_update_data(self) -> None:
|
async def _async_update_data(self) -> None:
|
||||||
"""Fetch data from the Screenlogic gateway."""
|
"""Fetch data from the Screenlogic gateway."""
|
||||||
assert self.config_entry is not None
|
|
||||||
try:
|
try:
|
||||||
if not self.gateway.is_connected:
|
if not self.gateway.is_connected:
|
||||||
connect_info = await async_get_connect_info(
|
connect_info = await async_get_connect_info(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user