Treat Huawei LTE error code 100006 as unsupported functionality (#54253)

Internet says 100006 could mean "parameter error", B2368-F20 is
reported to respond with that to lan/HostInfo requests.

While at it, handle the special case error codes and the "real" not
supported exception in the same block.

Closes https://github.com/home-assistant/core/issues/53280
This commit is contained in:
Ville Skyttä 2021-08-18 17:26:54 +03:00 committed by GitHub
parent 28e421dc53
commit 9947795068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,11 +185,6 @@ class Router:
_LOGGER.debug("Getting %s for subscribers %s", key, self.subscriptions[key])
try:
self.data[key] = func()
except ResponseErrorNotSupportedException:
_LOGGER.info(
"%s not supported by device, excluding from future updates", key
)
self.subscriptions.pop(key)
except ResponseErrorLoginRequiredException:
if isinstance(self.connection, AuthorizedConnection):
_LOGGER.debug("Trying to authorize again")
@ -206,7 +201,13 @@ class Router:
)
self.subscriptions.pop(key)
except ResponseErrorException as exc:
if exc.code != -1:
if not isinstance(
exc, ResponseErrorNotSupportedException
) and exc.code not in (
# additional codes treated as unusupported
-1,
100006,
):
raise
_LOGGER.info(
"%s apparently not supported by device, excluding from future updates",