From 00f71e5dfc4c26e9d2f465c9ee746991bd9e4fb1 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 1 Dec 2021 15:52:08 +0100 Subject: [PATCH] Use dataclass properties in screenlogic discovery (#60735) Co-authored-by: epenet --- homeassistant/components/screenlogic/config_flow.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/screenlogic/config_flow.py b/homeassistant/components/screenlogic/config_flow.py index ccb2dd38bb8..d9feec629e2 100644 --- a/homeassistant/components/screenlogic/config_flow.py +++ b/homeassistant/components/screenlogic/config_flow.py @@ -79,13 +79,13 @@ class ScreenlogicConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult: """Handle dhcp discovery.""" - mac = _extract_mac_from_name(discovery_info[dhcp.HOSTNAME]) + mac = _extract_mac_from_name(discovery_info.hostname) await self.async_set_unique_id(mac) self._abort_if_unique_id_configured( - updates={CONF_IP_ADDRESS: discovery_info[dhcp.IP_ADDRESS]} + updates={CONF_IP_ADDRESS: discovery_info.ip} ) - self.discovered_ip = discovery_info[dhcp.IP_ADDRESS] - self.context["title_placeholders"] = {"name": discovery_info[dhcp.HOSTNAME]} + self.discovered_ip = discovery_info.ip + self.context["title_placeholders"] = {"name": discovery_info.hostname} return await self.async_step_gateway_entry() async def async_step_gateway_select(self, user_input=None):