mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use dataclass properties in modern_forms discovery (#60584)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
efebd1b657
commit
7182827818
@ -30,14 +30,14 @@ class ModernFormsFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||
) -> FlowResult:
|
||||
"""Handle zeroconf discovery."""
|
||||
host = discovery_info[zeroconf.ATTR_HOSTNAME].rstrip(".")
|
||||
host = discovery_info.hostname.rstrip(".")
|
||||
name, _ = host.rsplit(".")
|
||||
|
||||
self.context.update(
|
||||
{
|
||||
CONF_HOST: discovery_info[zeroconf.ATTR_HOST],
|
||||
CONF_HOST: discovery_info.host,
|
||||
CONF_NAME: name,
|
||||
CONF_MAC: discovery_info[zeroconf.ATTR_PROPERTIES].get(CONF_MAC),
|
||||
CONF_MAC: discovery_info.properties.get(CONF_MAC),
|
||||
"title_placeholders": {"name": name},
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user