Use dataclass properties in nam discovery (#60596)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-11-30 09:36:41 +01:00 committed by GitHub
parent 64afe738cc
commit 5003a1515b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,7 +126,7 @@ class NAMFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
self, discovery_info: zeroconf.ZeroconfServiceInfo
) -> FlowResult:
"""Handle zeroconf discovery."""
self.host = discovery_info[zeroconf.ATTR_HOST]
self.host = discovery_info.host
self.context["title_placeholders"] = {"host": self.host}
# Do not probe the device if the host is already configured