Fix Fritz shutdown race condition (#57148)

This commit is contained in:
Simone Chemelli 2021-10-06 05:26:18 +02:00 committed by GitHub
parent 9de3bd77d8
commit d51d70d3be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,12 @@ class FritzBoxTools:
def _update_hosts_info(self) -> list[HostInfo]: def _update_hosts_info(self) -> list[HostInfo]:
"""Retrieve latest hosts information from the FRITZ!Box.""" """Retrieve latest hosts information from the FRITZ!Box."""
return self.fritz_hosts.get_hosts_info() # type: ignore [no-any-return] try:
return self.fritz_hosts.get_hosts_info() # type: ignore [no-any-return]
except Exception as ex: # pylint: disable=[broad-except]
if not self.hass.is_stopping:
raise HomeAssistantError("Error refreshing hosts info") from ex
return []
def _update_device_info(self) -> tuple[bool, str | None]: def _update_device_info(self) -> tuple[bool, str | None]:
"""Retrieve latest device information from the FRITZ!Box.""" """Retrieve latest device information from the FRITZ!Box."""