mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Ensure port is stored and used in SamsungTV legacy bridge (#143940)
* Ensure port is stored and used in SamsungTV legacy bridge * Tweak
This commit is contained in:
parent
441bca5bda
commit
ef023f084b
@ -150,7 +150,7 @@ class SamsungTVBridge(ABC):
|
|||||||
) -> SamsungTVBridge:
|
) -> SamsungTVBridge:
|
||||||
"""Get Bridge instance."""
|
"""Get Bridge instance."""
|
||||||
if method == METHOD_LEGACY or port == LEGACY_PORT:
|
if method == METHOD_LEGACY or port == LEGACY_PORT:
|
||||||
return SamsungTVLegacyBridge(hass, method, host, port)
|
return SamsungTVLegacyBridge(hass, method, host, port or LEGACY_PORT)
|
||||||
if method == METHOD_ENCRYPTED_WEBSOCKET or port == ENCRYPTED_WEBSOCKET_PORT:
|
if method == METHOD_ENCRYPTED_WEBSOCKET or port == ENCRYPTED_WEBSOCKET_PORT:
|
||||||
return SamsungTVEncryptedBridge(hass, method, host, port, entry_data)
|
return SamsungTVEncryptedBridge(hass, method, host, port, entry_data)
|
||||||
return SamsungTVWSBridge(hass, method, host, port, entry_data)
|
return SamsungTVWSBridge(hass, method, host, port, entry_data)
|
||||||
@ -262,14 +262,14 @@ class SamsungTVLegacyBridge(SamsungTVBridge):
|
|||||||
self, hass: HomeAssistant, method: str, host: str, port: int | None
|
self, hass: HomeAssistant, method: str, host: str, port: int | None
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize Bridge."""
|
"""Initialize Bridge."""
|
||||||
super().__init__(hass, method, host, LEGACY_PORT)
|
super().__init__(hass, method, host, port)
|
||||||
self.config = {
|
self.config = {
|
||||||
CONF_NAME: VALUE_CONF_NAME,
|
CONF_NAME: VALUE_CONF_NAME,
|
||||||
CONF_DESCRIPTION: VALUE_CONF_NAME,
|
CONF_DESCRIPTION: VALUE_CONF_NAME,
|
||||||
CONF_ID: VALUE_CONF_ID,
|
CONF_ID: VALUE_CONF_ID,
|
||||||
CONF_HOST: host,
|
CONF_HOST: host,
|
||||||
CONF_METHOD: method,
|
CONF_METHOD: method,
|
||||||
CONF_PORT: None,
|
CONF_PORT: port,
|
||||||
CONF_TIMEOUT: 1,
|
CONF_TIMEOUT: 1,
|
||||||
}
|
}
|
||||||
self._remote: Remote | None = None
|
self._remote: Remote | None = None
|
||||||
@ -301,7 +301,7 @@ class SamsungTVLegacyBridge(SamsungTVBridge):
|
|||||||
CONF_ID: VALUE_CONF_ID,
|
CONF_ID: VALUE_CONF_ID,
|
||||||
CONF_HOST: self.host,
|
CONF_HOST: self.host,
|
||||||
CONF_METHOD: self.method,
|
CONF_METHOD: self.method,
|
||||||
CONF_PORT: None,
|
CONF_PORT: self.port,
|
||||||
# We need this high timeout because waiting for auth popup
|
# We need this high timeout because waiting for auth popup
|
||||||
# is just an open socket
|
# is just an open socket
|
||||||
CONF_TIMEOUT: TIMEOUT_REQUEST,
|
CONF_TIMEOUT: TIMEOUT_REQUEST,
|
||||||
|
@ -173,7 +173,7 @@ AUTODETECT_LEGACY = {
|
|||||||
"description": "HomeAssistant",
|
"description": "HomeAssistant",
|
||||||
"id": "ha.component.samsung",
|
"id": "ha.component.samsung",
|
||||||
"method": "legacy",
|
"method": "legacy",
|
||||||
"port": None,
|
"port": LEGACY_PORT,
|
||||||
"host": "fake_host",
|
"host": "fake_host",
|
||||||
"timeout": TIMEOUT_REQUEST,
|
"timeout": TIMEOUT_REQUEST,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user