From fb94ed4e6b4cb1fd14d75159e461f70fd2516066 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 30 Nov 2021 10:58:06 +0100 Subject: [PATCH] Use dataclass properties in bond discovery (#60590) Co-authored-by: epenet --- homeassistant/components/bond/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/bond/config_flow.py b/homeassistant/components/bond/config_flow.py index cca8930532d..5fce8477a28 100644 --- a/homeassistant/components/bond/config_flow.py +++ b/homeassistant/components/bond/config_flow.py @@ -94,8 +94,8 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): self, discovery_info: zeroconf.ZeroconfServiceInfo ) -> FlowResult: """Handle a flow initialized by zeroconf discovery.""" - name: str = discovery_info[zeroconf.ATTR_NAME] - host: str = discovery_info[zeroconf.ATTR_HOST] + name: str = discovery_info.name + host: str = discovery_info.host bond_id = name.partition(".")[0] await self.async_set_unique_id(bond_id) for entry in self._async_current_entries():