diff --git a/homeassistant/components/huawei_lte/__init__.py b/homeassistant/components/huawei_lte/__init__.py index 6126968eab6..62d7ade1a0c 100644 --- a/homeassistant/components/huawei_lte/__init__.py +++ b/homeassistant/components/huawei_lte/__init__.py @@ -8,7 +8,6 @@ from contextlib import suppress from dataclasses import dataclass, field from datetime import timedelta import logging -import time from typing import Any, NamedTuple, cast from xml.parsers.expat import ExpatError @@ -78,7 +77,6 @@ from .const import ( KEY_WLAN_HOST_LIST, KEY_WLAN_WIFI_FEATURE_SWITCH, KEY_WLAN_WIFI_GUEST_NETWORK_SWITCH, - NOTIFY_SUPPRESS_TIMEOUT, SERVICE_RESUME_INTEGRATION, SERVICE_SUSPEND_INTEGRATION, UPDATE_SIGNAL, @@ -124,7 +122,6 @@ class Router: inflight_gets: set[str] = field(default_factory=set, init=False) client: Client = field(init=False) suspended: bool = field(default=False, init=False) - notify_last_attempt: float = field(default=-1, init=False) def __post_init__(self) -> None: """Set up internal state on init.""" @@ -195,19 +192,6 @@ class Router: key, ) self.subscriptions.pop(key) - except Timeout: - grace_left = ( - self.notify_last_attempt - time.monotonic() + NOTIFY_SUPPRESS_TIMEOUT - ) - if grace_left > 0: - _LOGGER.debug( - "%s timed out, %.1fs notify timeout suppress grace remaining", - key, - grace_left, - exc_info=True, - ) - else: - raise finally: self.inflight_gets.discard(key) _LOGGER.debug("%s=%s", key, self.data.get(key)) diff --git a/homeassistant/components/huawei_lte/const.py b/homeassistant/components/huawei_lte/const.py index af9bfd330e9..eaeb5579237 100644 --- a/homeassistant/components/huawei_lte/const.py +++ b/homeassistant/components/huawei_lte/const.py @@ -17,7 +17,6 @@ DEFAULT_UNAUTHENTICATED_MODE = False UPDATE_SIGNAL = f"{DOMAIN}_update" CONNECTION_TIMEOUT = 10 -NOTIFY_SUPPRESS_TIMEOUT = 30 SERVICE_RESUME_INTEGRATION = "resume_integration" SERVICE_SUSPEND_INTEGRATION = "suspend_integration" diff --git a/homeassistant/components/huawei_lte/notify.py b/homeassistant/components/huawei_lte/notify.py index fc154de3811..682470bafd0 100644 --- a/homeassistant/components/huawei_lte/notify.py +++ b/homeassistant/components/huawei_lte/notify.py @@ -3,7 +3,6 @@ from __future__ import annotations import logging -import time from typing import Any from huawei_lte_api.exceptions import ResponseErrorException @@ -62,5 +61,3 @@ class HuaweiLteSmsNotificationService(BaseNotificationService): _LOGGER.debug("Sent to %s: %s", targets, resp) except ResponseErrorException as ex: _LOGGER.error("Could not send to %s: %s", targets, ex) - finally: - self.router.notify_last_attempt = time.monotonic()