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
|
||||
from typing import Any
|
||||
|
||||
from requests.exceptions import Timeout as RequestsTimeout
|
||||
from samsungctl import Remote
|
||||
from samsungctl.exceptions import AccessDenied, ConnectionClosed, UnhandledResponse
|
||||
from samsungtvws import SamsungTVWS
|
||||
@ -321,7 +322,7 @@ class SamsungTVWSBridge(SamsungTVBridge):
|
||||
def device_info(self) -> dict[str, Any] | None:
|
||||
"""Try to gather infos of this TV."""
|
||||
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()
|
||||
return device_info
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user