mirror of
https://github.com/home-assistant/core.git
synced 2025-08-17 03:21:40 +02:00
Fix WebSocketTimeoutException in SamsungTV (#68114)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
@@ -10,7 +10,7 @@ from samsungctl import Remote
|
|||||||
from samsungctl.exceptions import AccessDenied, ConnectionClosed, UnhandledResponse
|
from samsungctl.exceptions import AccessDenied, ConnectionClosed, UnhandledResponse
|
||||||
from samsungtvws import SamsungTVWS
|
from samsungtvws import SamsungTVWS
|
||||||
from samsungtvws.exceptions import ConnectionFailure, HttpApiError
|
from samsungtvws.exceptions import ConnectionFailure, HttpApiError
|
||||||
from websocket import WebSocketException
|
from websocket import WebSocketException, WebSocketTimeoutException
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
@@ -318,8 +318,8 @@ class SamsungTVWSBridge(SamsungTVBridge):
|
|||||||
|
|
||||||
def _get_app_list(self) -> dict[str, str] | None:
|
def _get_app_list(self) -> dict[str, str] | None:
|
||||||
"""Get installed app list."""
|
"""Get installed app list."""
|
||||||
if self._app_list is None:
|
if self._app_list is None and (remote := self._get_remote()):
|
||||||
if remote := self._get_remote():
|
with contextlib.suppress(WebSocketTimeoutException):
|
||||||
raw_app_list: list[dict[str, str]] = remote.app_list()
|
raw_app_list: list[dict[str, str]] = remote.app_list()
|
||||||
self._app_list = {
|
self._app_list = {
|
||||||
app["name"]: app["appId"]
|
app["name"]: app["appId"]
|
||||||
|
Reference in New Issue
Block a user