Explicitly pass in the config_entry in pvoutput coordinator (#138033)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-09 15:01:28 +01:00 committed by GitHub
parent 552a5b1bb1
commit 7e2eef7079
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,14 +21,15 @@ class PVOutputDataUpdateCoordinator(DataUpdateCoordinator[Status]):
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Initialize the PVOutput coordinator."""
self.config_entry = entry
self.pvoutput = PVOutput(
api_key=entry.data[CONF_API_KEY],
system_id=entry.data[CONF_SYSTEM_ID],
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) -> Status:
"""Fetch system status from PVOutput."""