Skip to content

Commit

Permalink
Treat Huawei LTE error code 100006 as unsupported functionality (#54253)
Browse files Browse the repository at this point in the history
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 #53280
  • Loading branch information
scop committed Aug 18, 2021
1 parent 28e421d commit 9947795
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions homeassistant/components/huawei_lte/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ def _get_data(self, key: str, func: Callable[[], Any]) -> None:
_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")
Expand All @@ -206,7 +201,13 @@ def _get_data(self, key: str, func: Callable[[], Any]) -> None:
)
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",
Expand Down

0 comments on commit 9947795

Please sign in to comment.