From 071296865b225fcc6c22174c13f2e2a6e074b741 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 30 Nov 2021 10:16:06 +0100 Subject: [PATCH] Use dataclass properties in lookin discovery (#60585) Co-authored-by: epenet --- homeassistant/components/lookin/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/lookin/config_flow.py b/homeassistant/components/lookin/config_flow.py index af42febbb3f..2b4df9cc027 100644 --- a/homeassistant/components/lookin/config_flow.py +++ b/homeassistant/components/lookin/config_flow.py @@ -31,8 +31,8 @@ class LookinFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): self, discovery_info: zeroconf.ZeroconfServiceInfo ) -> FlowResult: """Start a discovery flow from zeroconf.""" - uid: str = discovery_info[zeroconf.ATTR_HOSTNAME][: -len(".local.")] - host: str = discovery_info[zeroconf.ATTR_HOST] + uid: str = discovery_info.hostname[: -len(".local.")] + host: str = discovery_info.host await self.async_set_unique_id(uid.upper()) self._abort_if_unique_id_configured(updates={CONF_HOST: host})