Bump python-fritzhome to 0.6.11 (#115904)
This commit is contained in:
parent
d4b801af32
commit
10228ee1a2
4 changed files with 18 additions and 14 deletions
|
@ -82,9 +82,9 @@ class FritzboxDataUpdateCoordinator(DataUpdateCoordinator[FritzboxCoordinatorDat
|
|||
def _update_fritz_devices(self) -> FritzboxCoordinatorData:
|
||||
"""Update all fritzbox device data."""
|
||||
try:
|
||||
self.fritz.update_devices()
|
||||
self.fritz.update_devices(ignore_removed=False)
|
||||
if self.has_templates:
|
||||
self.fritz.update_templates()
|
||||
self.fritz.update_templates(ignore_removed=False)
|
||||
except RequestConnectionError as ex:
|
||||
raise UpdateFailed from ex
|
||||
except HTTPError:
|
||||
|
@ -93,9 +93,9 @@ class FritzboxDataUpdateCoordinator(DataUpdateCoordinator[FritzboxCoordinatorDat
|
|||
self.fritz.login()
|
||||
except LoginError as ex:
|
||||
raise ConfigEntryAuthFailed from ex
|
||||
self.fritz.update_devices()
|
||||
self.fritz.update_devices(ignore_removed=False)
|
||||
if self.has_templates:
|
||||
self.fritz.update_templates()
|
||||
self.fritz.update_templates(ignore_removed=False)
|
||||
|
||||
devices = self.fritz.get_devices()
|
||||
device_data = {}
|
||||
|
@ -124,14 +124,18 @@ class FritzboxDataUpdateCoordinator(DataUpdateCoordinator[FritzboxCoordinatorDat
|
|||
self.new_devices = device_data.keys() - self.data.devices.keys()
|
||||
self.new_templates = template_data.keys() - self.data.templates.keys()
|
||||
|
||||
if (
|
||||
self.data.devices.keys() - device_data.keys()
|
||||
or self.data.templates.keys() - template_data.keys()
|
||||
):
|
||||
self.cleanup_removed_devices(list(device_data) + list(template_data))
|
||||
|
||||
return FritzboxCoordinatorData(devices=device_data, templates=template_data)
|
||||
|
||||
async def _async_update_data(self) -> FritzboxCoordinatorData:
|
||||
"""Fetch all device data."""
|
||||
return await self.hass.async_add_executor_job(self._update_fritz_devices)
|
||||
new_data = await self.hass.async_add_executor_job(self._update_fritz_devices)
|
||||
|
||||
if (
|
||||
self.data.devices.keys() - new_data.devices.keys()
|
||||
or self.data.templates.keys() - new_data.templates.keys()
|
||||
):
|
||||
self.cleanup_removed_devices(
|
||||
list(new_data.devices) + list(new_data.templates)
|
||||
)
|
||||
|
||||
return new_data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue