Update tplink coordinators to update hub-attached children (#135586)

This commit is contained in:
Steven B. 2025-01-28 12:17:35 +00:00 committed by GitHub
parent 7db6f44f2d
commit 7f3e56eb58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,12 @@ class TPLinkDataUpdateCoordinator(DataUpdateCoordinator[None]):
) -> None: ) -> None:
"""Initialize DataUpdateCoordinator to gather data for specific SmartPlug.""" """Initialize DataUpdateCoordinator to gather data for specific SmartPlug."""
self.device = device self.device = device
# The iot HS300 allows a limited number of concurrent requests and
# fetching the emeter information requires separate ones, so child
# coordinators are created below in get_child_coordinator.
self._update_children = not isinstance(device, IotStrip)
super().__init__( super().__init__(
hass, hass,
_LOGGER, _LOGGER,
@ -68,7 +74,7 @@ class TPLinkDataUpdateCoordinator(DataUpdateCoordinator[None]):
async def _async_update_data(self) -> None: async def _async_update_data(self) -> None:
"""Fetch all device and sensor data from api.""" """Fetch all device and sensor data from api."""
try: try:
await self.device.update(update_children=False) await self.device.update(update_children=self._update_children)
except AuthenticationError as ex: except AuthenticationError as ex:
raise ConfigEntryAuthFailed( raise ConfigEntryAuthFailed(
translation_domain=DOMAIN, translation_domain=DOMAIN,