1
mirror of https://github.com/home-assistant/core synced 2024-07-24 16:42:06 +02:00

Treat Huawei LTE response error code -1 as apparently unsupported (#45304)

This commit is contained in:
Ville Skyttä 2021-01-21 14:34:24 +02:00 committed by GitHub
parent b601e7e497
commit ded242a8fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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