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:
1 parent
197736f66b
commit
a129bc05ae
3 files changed
+133
-26
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user