mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Update tplink coordinators to update hub-attached children (#135586)
This commit is contained in:
parent
7db6f44f2d
commit
7f3e56eb58
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user