From 6f22ffbedd8f9791c88343abdc75254feca487a7 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 30 Nov 2021 15:47:18 +0100 Subject: [PATCH] Use dataclass properties in enphase_envoy discovery (#60627) Co-authored-by: epenet --- homeassistant/components/enphase_envoy/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/enphase_envoy/config_flow.py b/homeassistant/components/enphase_envoy/config_flow.py index 6093a30ca68..0b163e331d6 100644 --- a/homeassistant/components/enphase_envoy/config_flow.py +++ b/homeassistant/components/enphase_envoy/config_flow.py @@ -104,9 +104,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): self, discovery_info: zeroconf.ZeroconfServiceInfo ) -> FlowResult: """Handle a flow initialized by zeroconf discovery.""" - self.serial = discovery_info[zeroconf.ATTR_PROPERTIES]["serialnum"] + self.serial = discovery_info.properties["serialnum"] await self.async_set_unique_id(self.serial) - self.ip_address = discovery_info[zeroconf.ATTR_HOST] + self.ip_address = discovery_info.host self._abort_if_unique_id_configured({CONF_HOST: self.ip_address}) for entry in self._async_current_entries(include_ignore=False): if (