From 9ea73e0d9009c3dbcbefd3361ef23839b4c0595a Mon Sep 17 00:00:00 2001 From: Avi Miller Date: Fri, 18 Mar 2022 05:13:08 +1100 Subject: [PATCH] Skip unsupported LIFX Switches during discovery (#67726) Co-authored-by: J. Nick Koston --- homeassistant/components/lifx/light.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/lifx/light.py b/homeassistant/components/lifx/light.py index a7c52424d97..a6dd643655f 100644 --- a/homeassistant/components/lifx/light.py +++ b/homeassistant/components/lifx/light.py @@ -74,6 +74,7 @@ MESSAGE_RETRIES = 8 UNAVAILABLE_GRACE = 90 FIX_MAC_FW = AwesomeVersion("3.70") +SWITCH_PRODUCT_IDS = [70, 71, 89] SERVICE_LIFX_SET_STATE = "set_state" @@ -396,14 +397,18 @@ class LIFXManager: # Read initial state ack = AwaitAioLIFX().wait - # Used to populate sw_version - # no need to wait as we do not - # need it until later - bulb.get_hostfirmware() + # Get the product info first so that LIFX Switches + # can be ignored. + version_resp = await ack(bulb.get_version) + if version_resp and bulb.product in SWITCH_PRODUCT_IDS: + _LOGGER.warning( + "(Switch) action=skip_discovery, reason=unsupported, serial=%s, ip_addr=%s, type='LIFX Switch'", + str(bulb.mac_addr).replace(":", ""), + bulb.ip_addr, + ) + return False color_resp = await ack(bulb.get_color) - if color_resp: - version_resp = await ack(bulb.get_version) if color_resp is None or version_resp is None: _LOGGER.error("Failed to initialize %s", bulb.ip_addr)