From ded242a8feca984f69871895ace3934ccd8ea33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 21 Jan 2021 14:34:24 +0200 Subject: [PATCH] Treat Huawei LTE response error code -1 as apparently unsupported (#45304) --- homeassistant/components/huawei_lte/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homeassistant/components/huawei_lte/__init__.py b/homeassistant/components/huawei_lte/__init__.py index c341f75c2e5..341f9c0a118 100644 --- a/homeassistant/components/huawei_lte/__init__.py +++ b/homeassistant/components/huawei_lte/__init__.py @@ -15,6 +15,7 @@ from huawei_lte_api.AuthorizedConnection import AuthorizedConnection from huawei_lte_api.Client import Client from huawei_lte_api.Connection import Connection from huawei_lte_api.exceptions import ( + ResponseErrorException, ResponseErrorLoginRequiredException, ResponseErrorNotSupportedException, ) @@ -208,6 +209,14 @@ class Router: "%s requires authorization, excluding from future updates", key ) self.subscriptions.pop(key) + except ResponseErrorException as exc: + if exc.code != -1: + raise + _LOGGER.info( + "%s apparently not supported by device, excluding from future updates", + key, + ) + self.subscriptions.pop(key) except Timeout: grace_left = ( self.notify_last_attempt - time.monotonic() + NOTIFY_SUPPRESS_TIMEOUT