Use ZeroconfServiceInfo in modern_forms (#60043)
This commit is contained in:
parent
95075448bd
commit
2270e920c3
2 changed files with 18 additions and 11 deletions
|
@ -30,14 +30,14 @@ class ModernFormsFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||
) -> FlowResult:
|
||||
"""Handle zeroconf discovery."""
|
||||
host = discovery_info["hostname"].rstrip(".")
|
||||
host = discovery_info[zeroconf.ATTR_HOSTNAME].rstrip(".")
|
||||
name, _ = host.rsplit(".")
|
||||
|
||||
self.context.update(
|
||||
{
|
||||
CONF_HOST: discovery_info["host"],
|
||||
CONF_HOST: discovery_info[zeroconf.ATTR_HOST],
|
||||
CONF_NAME: name,
|
||||
CONF_MAC: discovery_info["properties"].get(CONF_MAC),
|
||||
CONF_MAC: discovery_info[zeroconf.ATTR_PROPERTIES].get(CONF_MAC),
|
||||
"title_placeholders": {"name": name},
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue