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 surepetcare coordinator (#137926)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
5871ece4df
commit
022119e74f
@ -38,8 +38,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
|
||||
try:
|
||||
hass.data[DOMAIN][entry.entry_id] = coordinator = SurePetcareDataCoordinator(
|
||||
entry,
|
||||
hass,
|
||||
entry,
|
||||
)
|
||||
except SurePetcareAuthenticationError as error:
|
||||
_LOGGER.error("Unable to connect to surepetcare.io: Wrong credentials!")
|
||||
|
@ -33,7 +33,9 @@ SCAN_INTERVAL = timedelta(minutes=3)
|
||||
class SurePetcareDataCoordinator(DataUpdateCoordinator[dict[int, SurepyEntity]]):
|
||||
"""Handle Surepetcare data."""
|
||||
|
||||
def __init__(self, entry: ConfigEntry, hass: HomeAssistant) -> None:
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||
"""Initialize the data handler."""
|
||||
self.surepy = Surepy(
|
||||
entry.data[CONF_USERNAME],
|
||||
@ -51,6 +53,7 @@ class SurePetcareDataCoordinator(DataUpdateCoordinator[dict[int, SurepyEntity]])
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=entry,
|
||||
name=DOMAIN,
|
||||
update_interval=SCAN_INTERVAL,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user