mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Use coordinator async_setup in iotty (#129449)
This commit is contained in:
parent
3adc3d7732
commit
409c8783fe
@ -61,14 +61,12 @@ class IottyDataUpdateCoordinator(DataUpdateCoordinator[IottyData]):
|
|||||||
)
|
)
|
||||||
self._device_registry = dr.async_get(hass)
|
self._device_registry = dr.async_get(hass)
|
||||||
|
|
||||||
async def async_config_entry_first_refresh(self) -> None:
|
async def _async_setup(self) -> None:
|
||||||
"""Override the first refresh to also fetch iotty devices list."""
|
"""Get devices."""
|
||||||
_LOGGER.debug("Fetching devices list from iottyCloud")
|
_LOGGER.debug("Fetching devices list from iottyCloud")
|
||||||
self._devices = await self.iotty.get_devices()
|
self._devices = await self.iotty.get_devices()
|
||||||
_LOGGER.debug("There are %d devices", len(self._devices))
|
_LOGGER.debug("There are %d devices", len(self._devices))
|
||||||
|
|
||||||
await super().async_config_entry_first_refresh()
|
|
||||||
|
|
||||||
async def _async_update_data(self) -> IottyData:
|
async def _async_update_data(self) -> IottyData:
|
||||||
"""Fetch data from iottyCloud device."""
|
"""Fetch data from iottyCloud device."""
|
||||||
_LOGGER.debug("Fetching devices status from iottyCloud")
|
_LOGGER.debug("Fetching devices status from iottyCloud")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user