Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions homeassistant/components/huawei_lte/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
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

Expand Down Expand Up @@ -78,7 +77,6 @@
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,
Expand Down Expand Up @@ -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."""
Expand Down Expand Up @@ -195,19 +192,6 @@ def _get_data(self, key: str, func: Callable[[], Any]) -> None:
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))
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/huawei_lte/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
UPDATE_SIGNAL = f"{DOMAIN}_update"

CONNECTION_TIMEOUT = 10
NOTIFY_SUPPRESS_TIMEOUT = 30

SERVICE_RESUME_INTEGRATION = "resume_integration"
SERVICE_SUSPEND_INTEGRATION = "suspend_integration"
Expand Down
3 changes: 0 additions & 3 deletions homeassistant/components/huawei_lte/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import logging
import time
from typing import Any

from huawei_lte_api.exceptions import ResponseErrorException
Expand Down Expand Up @@ -62,5 +61,3 @@ def send_message(self, message: str = "", **kwargs: Any) -> None:
_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()
Loading