mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
SSDP attributes can be present but empty (#60340)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
67684d68ff
commit
624d866239
@ -207,7 +207,7 @@ class HueFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
return self.async_abort(reason="not_hue_bridge")
|
return self.async_abort(reason="not_hue_bridge")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
ssdp.ATTR_SSDP_LOCATION not in discovery_info
|
not discovery_info.get(ssdp.ATTR_SSDP_LOCATION)
|
||||||
or ssdp.ATTR_UPNP_SERIAL not in discovery_info
|
or ssdp.ATTR_UPNP_SERIAL not in discovery_info
|
||||||
):
|
):
|
||||||
return self.async_abort(reason="not_hue_bridge")
|
return self.async_abort(reason="not_hue_bridge")
|
||||||
|
@ -41,9 +41,9 @@ def _is_complete_discovery(discovery_info: Mapping[str, Any]) -> bool:
|
|||||||
"""Test if discovery is complete and usable."""
|
"""Test if discovery is complete and usable."""
|
||||||
return (
|
return (
|
||||||
ssdp.ATTR_UPNP_UDN in discovery_info
|
ssdp.ATTR_UPNP_UDN in discovery_info
|
||||||
and ssdp.ATTR_SSDP_ST in discovery_info
|
and discovery_info.get(ssdp.ATTR_SSDP_ST)
|
||||||
and ssdp.ATTR_SSDP_LOCATION in discovery_info
|
and discovery_info.get(ssdp.ATTR_SSDP_LOCATION)
|
||||||
and ssdp.ATTR_SSDP_USN in discovery_info
|
and discovery_info.get(ssdp.ATTR_SSDP_USN)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class WiLightFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Handle a discovered WiLight."""
|
"""Handle a discovered WiLight."""
|
||||||
# Filter out basic information
|
# Filter out basic information
|
||||||
if (
|
if (
|
||||||
ssdp.ATTR_SSDP_LOCATION not in discovery_info
|
not discovery_info.get(ssdp.ATTR_SSDP_LOCATION)
|
||||||
or ssdp.ATTR_UPNP_MANUFACTURER not in discovery_info
|
or ssdp.ATTR_UPNP_MANUFACTURER not in discovery_info
|
||||||
or ssdp.ATTR_UPNP_SERIAL not in discovery_info
|
or ssdp.ATTR_UPNP_SERIAL not in discovery_info
|
||||||
or ssdp.ATTR_UPNP_MODEL_NAME not in discovery_info
|
or ssdp.ATTR_UPNP_MODEL_NAME not in discovery_info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user