Try all Samsung TV websocket ports (#33001)

* Update bridge.py

* add test

* silence pylint

* correct pylint

* add some tests

* Update test_media_player.py
This commit is contained in:
escoand authored and GitHub committed 2020-03-21 16:50:18 +01:00
1 parent 57820be92a
commit 2bb29485be
3 files changed
+133 -26

No files matched your search

+6 -1
View File
@@ -206,6 +206,7 @@ class SamsungTVWSBridge(SamsungTVBridge):
CONF_TIMEOUT: 31,
}
result = None
try:
LOGGER.debug("Try config: %s", config)
with SamsungTVWS(
@@ -223,9 +224,13 @@ class SamsungTVWSBridge(SamsungTVBridge):
return RESULT_SUCCESS
except WebSocketException:
LOGGER.debug("Working but unsupported config: %s", config)
return RESULT_NOT_SUPPORTED
result = RESULT_NOT_SUPPORTED
except (OSError, ConnectionFailure) as err:
LOGGER.debug("Failing config: %s, error: %s", config, err)
# pylint: disable=useless-else-on-loop
else:
if result:
return result
return RESULT_NOT_SUCCESSFUL