From 22a123fd4b9d8dc41fe2de46bea3a02154ed9c58 Mon Sep 17 00:00:00 2001 From: Xiaonan Shen Date: Sun, 30 Aug 2020 00:34:25 +0800 Subject: [PATCH] Support acpartner in aqara discovery (#37926) --- homeassistant/components/xiaomi_aqara/config_flow.py | 5 ++++- homeassistant/components/xiaomi_aqara/const.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/xiaomi_aqara/config_flow.py b/homeassistant/components/xiaomi_aqara/config_flow.py index c42598c2665..6bf1aa4f4ee 100644 --- a/homeassistant/components/xiaomi_aqara/config_flow.py +++ b/homeassistant/components/xiaomi_aqara/config_flow.py @@ -18,6 +18,7 @@ from .const import ( CONF_SID, DEFAULT_DISCOVERY_RETRY, DOMAIN, + ZEROCONF_ACPARTNER, ZEROCONF_GATEWAY, ) @@ -158,7 +159,9 @@ class XiaomiAqaraFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return self.async_abort(reason="not_xiaomi_aqara") # Check if the discovered device is an xiaomi aqara gateway. - if not name.startswith(ZEROCONF_GATEWAY): + if not ( + name.startswith(ZEROCONF_GATEWAY) or name.startswith(ZEROCONF_ACPARTNER) + ): _LOGGER.debug( "Xiaomi device '%s' discovered with host %s, not identified as xiaomi aqara gateway", name, diff --git a/homeassistant/components/xiaomi_aqara/const.py b/homeassistant/components/xiaomi_aqara/const.py index 0eb117cdf3c..fcfa3939c2c 100644 --- a/homeassistant/components/xiaomi_aqara/const.py +++ b/homeassistant/components/xiaomi_aqara/const.py @@ -6,6 +6,7 @@ GATEWAYS_KEY = "gateways" LISTENER_KEY = "listener" ZEROCONF_GATEWAY = "lumi-gateway" +ZEROCONF_ACPARTNER = "lumi-acpartner" CONF_INTERFACE = "interface" CONF_PROTOCOL = "protocol"