1
mirror of https://github.com/home-assistant/core synced 2024-08-06 09:34:49 +02:00

Adjust error handling scope in samsungtv (#66692)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-03-02 20:52:11 +01:00 committed by GitHub
parent b8861578ff
commit 26f2388fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -430,18 +430,16 @@ class SamsungTVWSBridge(SamsungTVBridge):
"""Create or return a remote control instance."""
if self._remote is None or not self._remote.is_alive():
# We need to create a new instance to reconnect.
LOGGER.debug("Create SamsungTVWSBridge for %s (%s)", CONF_NAME, self.host)
assert self.port
self._remote = SamsungTVWSAsyncRemote(
host=self.host,
port=self.port,
token=self.token,
timeout=TIMEOUT_WEBSOCKET,
name=VALUE_CONF_NAME,
)
try:
LOGGER.debug(
"Create SamsungTVWSBridge for %s (%s)", CONF_NAME, self.host
)
assert self.port
self._remote = SamsungTVWSAsyncRemote(
host=self.host,
port=self.port,
token=self.token,
timeout=TIMEOUT_WEBSOCKET,
name=VALUE_CONF_NAME,
)
await self._remote.start_listening()
# This is only happening when the auth was switched to DENY
# A removed auth will lead to socket timeout because waiting for auth popup is just an open socket