Prevent Netgear SSDP from updating host (#71240)
parent
8d40d9df85
commit
0580803b7d
|
@ -19,6 +19,7 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
|
from homeassistant.util.network import is_ipv4_address
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_CONSIDER_HOME,
|
CONF_CONSIDER_HOME,
|
||||||
|
@ -129,6 +130,9 @@ class NetgearFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
hostname = cast(str, hostname)
|
hostname = cast(str, hostname)
|
||||||
updated_data[CONF_HOST] = hostname
|
updated_data[CONF_HOST] = hostname
|
||||||
|
|
||||||
|
if not is_ipv4_address(str(hostname)):
|
||||||
|
return self.async_abort(reason="not_ipv4_address")
|
||||||
|
|
||||||
_LOGGER.debug("Netgear ssdp discovery info: %s", discovery_info)
|
_LOGGER.debug("Netgear ssdp discovery info: %s", discovery_info)
|
||||||
|
|
||||||
await self.async_set_unique_id(discovery_info.upnp[ssdp.ATTR_UPNP_SERIAL])
|
await self.async_set_unique_id(discovery_info.upnp[ssdp.ATTR_UPNP_SERIAL])
|
||||||
|
|
Loading…
Reference in New Issue