Explicitly pass in the config_entry in lametric coordinator (#138120)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-09 20:09:11 +01:00 committed by GitHub
parent 9e7f8b7bff
commit faf4ad07fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,14 +21,15 @@ class LaMetricDataUpdateCoordinator(DataUpdateCoordinator[Device]):
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None: def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Initialize the LaMatric coordinator.""" """Initialize the LaMatric coordinator."""
self.config_entry = entry
self.lametric = LaMetricDevice( self.lametric = LaMetricDevice(
host=entry.data[CONF_HOST], host=entry.data[CONF_HOST],
api_key=entry.data[CONF_API_KEY], api_key=entry.data[CONF_API_KEY],
session=async_get_clientsession(hass), session=async_get_clientsession(hass),
) )
super().__init__(hass, LOGGER, name=DOMAIN, update_interval=SCAN_INTERVAL) super().__init__(
hass, LOGGER, config_entry=entry, name=DOMAIN, update_interval=SCAN_INTERVAL
)
async def _async_update_data(self) -> Device: async def _async_update_data(self) -> Device:
"""Fetch device information of the LaMetric device.""" """Fetch device information of the LaMetric device."""