mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use dataclass properties in xiaomi_aqara discovery (#60636)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
30bb2c82c6
commit
601ad8f71a
@ -150,9 +150,9 @@ class XiaomiAqaraFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||||
) -> FlowResult:
|
) -> FlowResult:
|
||||||
"""Handle zeroconf discovery."""
|
"""Handle zeroconf discovery."""
|
||||||
name = discovery_info[zeroconf.ATTR_NAME]
|
name = discovery_info.name
|
||||||
self.host = discovery_info[zeroconf.ATTR_HOST]
|
self.host = discovery_info.host
|
||||||
mac_address = discovery_info[zeroconf.ATTR_PROPERTIES].get("mac")
|
mac_address = discovery_info.properties.get("mac")
|
||||||
|
|
||||||
if not name or not self.host or not mac_address:
|
if not name or not self.host or not mac_address:
|
||||||
return self.async_abort(reason="not_xiaomi_aqara")
|
return self.async_abort(reason="not_xiaomi_aqara")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user