Skip to content

Commit bb3d571

Browse files
authored
Make sure we update the api version in philips_js discovery (home-assistant#150604)
1 parent 5a789cb commit bb3d571

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

homeassistant/components/philips_js/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def _async_attempt_prepare(
8282
)
8383

8484
await hub.getSystem()
85-
await hub.setTransport(hub.secured_transport)
85+
await hub.setTransport(hub.secured_transport, hub.api_version_detected)
8686

8787
if not hub.system or not hub.name:
8888
raise ConnectionFailure("System data or name is empty")

tests/components/philips_js/test_config_flow.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async def test_pairing(hass: HomeAssistant, mock_tv_pairable, mock_setup_entry)
125125
assert result["type"] is FlowResultType.FORM
126126
assert result["errors"] == {}
127127

128-
mock_tv.setTransport.assert_called_with(True)
128+
mock_tv.setTransport.assert_called_with(True, ANY)
129129
mock_tv.pairRequest.assert_called()
130130

131131
result = await hass.config_entries.flow.async_configure(
@@ -204,7 +204,7 @@ async def test_pair_grant_failed(
204204
assert result["type"] is FlowResultType.FORM
205205
assert result["errors"] == {}
206206

207-
mock_tv.setTransport.assert_called_with(True)
207+
mock_tv.setTransport.assert_called_with(True, ANY)
208208
mock_tv.pairRequest.assert_called()
209209

210210
# Test with invalid pin
@@ -266,6 +266,7 @@ async def test_zeroconf_discovery(
266266
"""Test we can setup from zeroconf discovery."""
267267

268268
mock_tv_pairable.secured_transport = secured_transport
269+
mock_tv_pairable.api_version_detected = 6
269270
result = await hass.config_entries.flow.async_init(
270271
DOMAIN,
271272
context={"source": config_entries.SOURCE_ZEROCONF},
@@ -291,7 +292,7 @@ async def test_zeroconf_discovery(
291292
assert result["type"] is FlowResultType.FORM
292293
assert result["errors"] == {}
293294

294-
mock_tv_pairable.setTransport.assert_called_with(secured_transport)
295+
mock_tv_pairable.setTransport.assert_called_with(secured_transport, 6)
295296
mock_tv_pairable.pairRequest.assert_called()
296297

297298

0 commit comments

Comments
 (0)