Use dataclass properties in bond discovery (#60590)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-11-30 10:58:06 +01:00 committed by GitHub
parent d537ec1d6f
commit fb94ed4e6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,8 +94,8 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
self, discovery_info: zeroconf.ZeroconfServiceInfo self, discovery_info: zeroconf.ZeroconfServiceInfo
) -> FlowResult: ) -> FlowResult:
"""Handle a flow initialized by zeroconf discovery.""" """Handle a flow initialized by zeroconf discovery."""
name: str = discovery_info[zeroconf.ATTR_NAME] name: str = discovery_info.name
host: str = discovery_info[zeroconf.ATTR_HOST] host: str = discovery_info.host
bond_id = name.partition(".")[0] bond_id = name.partition(".")[0]
await self.async_set_unique_id(bond_id) await self.async_set_unique_id(bond_id)
for entry in self._async_current_entries(): for entry in self._async_current_entries():