From 0bb44c042c8a50d024a228a2c6d32b8332891eda Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 30 Nov 2021 10:07:58 +0100 Subject: [PATCH] Use dataclass properties in brother discovery (#60601) Co-authored-by: epenet --- homeassistant/components/brother/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/brother/config_flow.py b/homeassistant/components/brother/config_flow.py index 7a814e2e77c..39a196aa6cb 100644 --- a/homeassistant/components/brother/config_flow.py +++ b/homeassistant/components/brother/config_flow.py @@ -84,13 +84,13 @@ class BrotherConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): ) -> FlowResult: """Handle zeroconf discovery.""" # Hostname is format: brother.local. - self.host = discovery_info[zeroconf.ATTR_HOSTNAME].rstrip(".") + self.host = discovery_info.hostname.rstrip(".") # Do not probe the device if the host is already configured self._async_abort_entries_match({CONF_HOST: self.host}) snmp_engine = get_snmp_engine(self.hass) - model = discovery_info[zeroconf.ATTR_PROPERTIES].get("product") + model = discovery_info.properties.get("product") try: self.brother = Brother(self.host, snmp_engine=snmp_engine, model=model)