Support acpartner in aqara discovery (#37926)

This commit is contained in:
Xiaonan Shen 2020-08-30 00:34:25 +08:00 committed by GitHub
parent a9b611d3ed
commit 22a123fd4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -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,

View file

@ -6,6 +6,7 @@ GATEWAYS_KEY = "gateways"
LISTENER_KEY = "listener"
ZEROCONF_GATEWAY = "lumi-gateway"
ZEROCONF_ACPARTNER = "lumi-acpartner"
CONF_INTERFACE = "interface"
CONF_PROTOCOL = "protocol"