mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Fix excepton for SamsungTV getting device info (#65151)
This commit is contained in:
parent
421f9716a7
commit
4ead2f2f7e
@ -5,6 +5,7 @@ from abc import ABC, abstractmethod
|
|||||||
import contextlib
|
import contextlib
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from requests.exceptions import Timeout as RequestsTimeout
|
||||||
from samsungctl import Remote
|
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
|
||||||
@ -321,7 +322,7 @@ class SamsungTVWSBridge(SamsungTVBridge):
|
|||||||
def device_info(self) -> dict[str, Any] | None:
|
def device_info(self) -> dict[str, Any] | None:
|
||||||
"""Try to gather infos of this TV."""
|
"""Try to gather infos of this TV."""
|
||||||
if remote := self._get_remote(avoid_open=True):
|
if remote := self._get_remote(avoid_open=True):
|
||||||
with contextlib.suppress(HttpApiError):
|
with contextlib.suppress(HttpApiError, RequestsTimeout):
|
||||||
device_info: dict[str, Any] = remote.rest_device_info()
|
device_info: dict[str, Any] = remote.rest_device_info()
|
||||||
return device_info
|
return device_info
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user