mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use dataclass properties in wled discovery (#60573)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
e0b315041b
commit
9374ce87ba
@ -44,14 +44,14 @@ class WLEDFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Handle zeroconf discovery."""
|
"""Handle zeroconf discovery."""
|
||||||
|
|
||||||
# Hostname is format: wled-livingroom.local.
|
# Hostname is format: wled-livingroom.local.
|
||||||
host = discovery_info[zeroconf.ATTR_HOSTNAME].rstrip(".")
|
host = discovery_info.hostname.rstrip(".")
|
||||||
name, _ = host.rsplit(".")
|
name, _ = host.rsplit(".")
|
||||||
|
|
||||||
self.context.update(
|
self.context.update(
|
||||||
{
|
{
|
||||||
CONF_HOST: discovery_info[zeroconf.ATTR_HOST],
|
CONF_HOST: discovery_info.host,
|
||||||
CONF_NAME: name,
|
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},
|
"title_placeholders": {"name": name},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user