From 2f79760fb422590fe62f676a8a07ae635525c618 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 30 Nov 2021 10:15:46 +0100 Subject: [PATCH] Use dataclass properties in guardian discovery (#60586) Co-authored-by: epenet --- homeassistant/components/guardian/config_flow.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/guardian/config_flow.py b/homeassistant/components/guardian/config_flow.py index 78a4cbd90ea..b02d415b364 100644 --- a/homeassistant/components/guardian/config_flow.py +++ b/homeassistant/components/guardian/config_flow.py @@ -110,12 +110,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): ) -> FlowResult: """Handle the configuration via zeroconf.""" self.discovery_info = { - CONF_IP_ADDRESS: discovery_info[zeroconf.ATTR_HOST], - CONF_PORT: discovery_info[zeroconf.ATTR_PORT], + CONF_IP_ADDRESS: discovery_info.host, + CONF_PORT: discovery_info.port, } - pin = async_get_pin_from_discovery_hostname( - discovery_info[zeroconf.ATTR_HOSTNAME] - ) + pin = async_get_pin_from_discovery_hostname(discovery_info.hostname) await self._async_set_unique_id(pin) return await self._async_handle_discovery()