mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Explicitly pass in the config_entry in vesync (#137498)
* Explicitly pass in the config_entry in vesync * Feedback
This commit is contained in:
parent
44c79f4b9c
commit
3297b27dce
@ -52,7 +52,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
||||
hass.data[DOMAIN] = {}
|
||||
hass.data[DOMAIN][VS_MANAGER] = manager
|
||||
|
||||
coordinator = VeSyncDataCoordinator(hass, manager)
|
||||
coordinator = VeSyncDataCoordinator(hass, config_entry, manager)
|
||||
|
||||
# Store coordinator at domain level since only single integration instance is permitted.
|
||||
hass.data[DOMAIN][VS_COORDINATOR] = coordinator
|
||||
|
@ -7,6 +7,7 @@ import logging
|
||||
|
||||
from pyvesync import VeSync
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
@ -18,13 +19,18 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class VeSyncDataCoordinator(DataUpdateCoordinator[None]):
|
||||
"""Class representing data coordinator for VeSync devices."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant, manager: VeSync) -> None:
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, config_entry: ConfigEntry, manager: VeSync
|
||||
) -> None:
|
||||
"""Initialize."""
|
||||
self._manager = manager
|
||||
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name="VeSyncDataCoordinator",
|
||||
update_interval=timedelta(seconds=UPDATE_INTERVAL),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user