Fix netgear NoneType and discovery (#57904)
This commit is contained in:
parent
55c80b4093
commit
04f51e599a
2 changed files with 6 additions and 1 deletions
|
@ -142,7 +142,9 @@ class NetgearFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
updated_data[CONF_PORT] = DEFAULT_PORT
|
updated_data[CONF_PORT] = DEFAULT_PORT
|
||||||
for model in MODELS_V2:
|
for model in MODELS_V2:
|
||||||
if discovery_info.get(ssdp.ATTR_UPNP_MODEL_NUMBER, "").startswith(model):
|
if discovery_info.get(ssdp.ATTR_UPNP_MODEL_NUMBER, "").startswith(
|
||||||
|
model
|
||||||
|
) or discovery_info.get(ssdp.ATTR_UPNP_MODEL_NAME, "").startswith(model):
|
||||||
updated_data[CONF_PORT] = ORBI_PORT
|
updated_data[CONF_PORT] = ORBI_PORT
|
||||||
|
|
||||||
self.placeholders.update(updated_data)
|
self.placeholders.update(updated_data)
|
||||||
|
|
|
@ -199,6 +199,9 @@ class NetgearRouter:
|
||||||
ntg_devices = await self.async_get_attached_devices()
|
ntg_devices = await self.async_get_attached_devices()
|
||||||
now = dt_util.utcnow()
|
now = dt_util.utcnow()
|
||||||
|
|
||||||
|
if ntg_devices is None:
|
||||||
|
return
|
||||||
|
|
||||||
if _LOGGER.isEnabledFor(logging.DEBUG):
|
if _LOGGER.isEnabledFor(logging.DEBUG):
|
||||||
_LOGGER.debug("Netgear scan result: \n%s", ntg_devices)
|
_LOGGER.debug("Netgear scan result: \n%s", ntg_devices)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue