mirror of
https://github.com/home-assistant/core.git
synced 2025-09-05 12:51:37 +02:00
Make sure we update the api version in philips_js discovery (#150604)
This commit is contained in:
@@ -82,7 +82,7 @@ class PhilipsJSConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
await hub.getSystem()
|
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:
|
if not hub.system or not hub.name:
|
||||||
raise ConnectionFailure("System data or name is empty")
|
raise ConnectionFailure("System data or name is empty")
|
||||||
|
@@ -125,7 +125,7 @@ async def test_pairing(hass: HomeAssistant, mock_tv_pairable, mock_setup_entry)
|
|||||||
assert result["type"] is FlowResultType.FORM
|
assert result["type"] is FlowResultType.FORM
|
||||||
assert result["errors"] == {}
|
assert result["errors"] == {}
|
||||||
|
|
||||||
mock_tv.setTransport.assert_called_with(True)
|
mock_tv.setTransport.assert_called_with(True, ANY)
|
||||||
mock_tv.pairRequest.assert_called()
|
mock_tv.pairRequest.assert_called()
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_configure(
|
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["type"] is FlowResultType.FORM
|
||||||
assert result["errors"] == {}
|
assert result["errors"] == {}
|
||||||
|
|
||||||
mock_tv.setTransport.assert_called_with(True)
|
mock_tv.setTransport.assert_called_with(True, ANY)
|
||||||
mock_tv.pairRequest.assert_called()
|
mock_tv.pairRequest.assert_called()
|
||||||
|
|
||||||
# Test with invalid pin
|
# Test with invalid pin
|
||||||
@@ -266,6 +266,7 @@ async def test_zeroconf_discovery(
|
|||||||
"""Test we can setup from zeroconf discovery."""
|
"""Test we can setup from zeroconf discovery."""
|
||||||
|
|
||||||
mock_tv_pairable.secured_transport = secured_transport
|
mock_tv_pairable.secured_transport = secured_transport
|
||||||
|
mock_tv_pairable.api_version_detected = 6
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={"source": config_entries.SOURCE_ZEROCONF},
|
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||||
@@ -291,7 +292,7 @@ async def test_zeroconf_discovery(
|
|||||||
assert result["type"] is FlowResultType.FORM
|
assert result["type"] is FlowResultType.FORM
|
||||||
assert result["errors"] == {}
|
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()
|
mock_tv_pairable.pairRequest.assert_called()
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user