Use dataclass properties in hue discovery (#60598)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
601ad8f71a
commit
d75785d701
2 changed files with 34 additions and 9 deletions
|
@ -423,6 +423,26 @@ async def test_bridge_ssdp_missing_serial(hass):
|
|||
assert result["reason"] == "not_hue_bridge"
|
||||
|
||||
|
||||
async def test_bridge_ssdp_invalid_location(hass):
|
||||
"""Test if discovery info is a serial attribute."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
const.DOMAIN,
|
||||
context={"source": config_entries.SOURCE_SSDP},
|
||||
data=ssdp.SsdpServiceInfo(
|
||||
ssdp_usn="mock_usn",
|
||||
ssdp_st="mock_st",
|
||||
ssdp_location="http:///",
|
||||
upnp={
|
||||
ssdp.ATTR_UPNP_MANUFACTURER_URL: config_flow.HUE_MANUFACTURERURL[0],
|
||||
ssdp.ATTR_UPNP_SERIAL: "1234",
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
assert result["type"] == "abort"
|
||||
assert result["reason"] == "not_hue_bridge"
|
||||
|
||||
|
||||
async def test_bridge_ssdp_espalexa(hass):
|
||||
"""Test if discovery info is from an Espalexa based device."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue