Use coordinator async_setup in iotty (#129449)

This commit is contained in:
G Johansson 2024-10-29 20:07:13 +01:00 committed by GitHub
parent 3adc3d7732
commit 409c8783fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,14 +61,12 @@ class IottyDataUpdateCoordinator(DataUpdateCoordinator[IottyData]):
)
self._device_registry = dr.async_get(hass)
async def async_config_entry_first_refresh(self) -> None:
"""Override the first refresh to also fetch iotty devices list."""
async def _async_setup(self) -> None:
"""Get devices."""
_LOGGER.debug("Fetching devices list from iottyCloud")
self._devices = await self.iotty.get_devices()
_LOGGER.debug("There are %d devices", len(self._devices))
await super().async_config_entry_first_refresh()
async def _async_update_data(self) -> IottyData:
"""Fetch data from iottyCloud device."""
_LOGGER.debug("Fetching devices status from iottyCloud")