Fix data update when guest client disappears in Fritz!Tools (#65564)
Co-authored-by: Simone Chemelli <simone.chemelli@gmail.com>pull/65584/head
parent
97c8427506
commit
80102e1e84
|
@ -220,8 +220,8 @@ class FritzBoxTools(update_coordinator.DataUpdateCoordinator):
|
||||||
"""Update FritzboxTools data."""
|
"""Update FritzboxTools data."""
|
||||||
try:
|
try:
|
||||||
await self.async_scan_devices()
|
await self.async_scan_devices()
|
||||||
except (FritzSecurityError, FritzConnectionException) as ex:
|
except FRITZ_EXCEPTIONS as ex:
|
||||||
raise update_coordinator.UpdateFailed from ex
|
raise update_coordinator.UpdateFailed(ex) from ex
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
|
@ -294,11 +294,19 @@ class FritzBoxTools(update_coordinator.DataUpdateCoordinator):
|
||||||
|
|
||||||
def _get_wan_access(self, ip_address: str) -> bool | None:
|
def _get_wan_access(self, ip_address: str) -> bool | None:
|
||||||
"""Get WAN access rule for given IP address."""
|
"""Get WAN access rule for given IP address."""
|
||||||
return not self.connection.call_action(
|
try:
|
||||||
"X_AVM-DE_HostFilter:1",
|
return not self.connection.call_action(
|
||||||
"GetWANAccessByIP",
|
"X_AVM-DE_HostFilter:1",
|
||||||
NewIPv4Address=ip_address,
|
"GetWANAccessByIP",
|
||||||
).get("NewDisallow")
|
NewIPv4Address=ip_address,
|
||||||
|
).get("NewDisallow")
|
||||||
|
except FRITZ_EXCEPTIONS as ex:
|
||||||
|
_LOGGER.debug(
|
||||||
|
"could not get WAN access rule for client device with IP '%s', error: %s",
|
||||||
|
ip_address,
|
||||||
|
ex,
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
async def async_scan_devices(self, now: datetime | None = None) -> None:
|
async def async_scan_devices(self, now: datetime | None = None) -> None:
|
||||||
"""Wrap up FritzboxTools class scan."""
|
"""Wrap up FritzboxTools class scan."""
|
||||||
|
|
Loading…
Reference in New Issue