Make sure we update the api version in philips_js discovery (#150604)

This commit is contained in:
Joakim Plate
2025-08-14 09:30:47 +02:00
committed by GitHub
parent 5a789cbbc8
commit bb3d571887
2 changed files with 5 additions and 4 deletions

View File

@@ -82,7 +82,7 @@ class PhilipsJSConfigFlow(ConfigFlow, domain=DOMAIN):
)
await hub.getSystem()
await hub.setTransport(hub.secured_transport)
await hub.setTransport(hub.secured_transport, hub.api_version_detected)
if not hub.system or not hub.name:
raise ConnectionFailure("System data or name is empty")

View File

@@ -125,7 +125,7 @@ async def test_pairing(hass: HomeAssistant, mock_tv_pairable, mock_setup_entry)
assert result["type"] is FlowResultType.FORM
assert result["errors"] == {}
mock_tv.setTransport.assert_called_with(True)
mock_tv.setTransport.assert_called_with(True, ANY)
mock_tv.pairRequest.assert_called()
result = await hass.config_entries.flow.async_configure(
@@ -204,7 +204,7 @@ async def test_pair_grant_failed(
assert result["type"] is FlowResultType.FORM
assert result["errors"] == {}
mock_tv.setTransport.assert_called_with(True)
mock_tv.setTransport.assert_called_with(True, ANY)
mock_tv.pairRequest.assert_called()
# Test with invalid pin
@@ -266,6 +266,7 @@ async def test_zeroconf_discovery(
"""Test we can setup from zeroconf discovery."""
mock_tv_pairable.secured_transport = secured_transport
mock_tv_pairable.api_version_detected = 6
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_ZEROCONF},
@@ -291,7 +292,7 @@ async def test_zeroconf_discovery(
assert result["type"] is FlowResultType.FORM
assert result["errors"] == {}
mock_tv_pairable.setTransport.assert_called_with(secured_transport)
mock_tv_pairable.setTransport.assert_called_with(secured_transport, 6)
mock_tv_pairable.pairRequest.assert_called()