mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Skip unsupported LIFX Switches during discovery (#67726)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
8f69d31322
commit
9ea73e0d90
@ -74,6 +74,7 @@ MESSAGE_RETRIES = 8
|
|||||||
UNAVAILABLE_GRACE = 90
|
UNAVAILABLE_GRACE = 90
|
||||||
|
|
||||||
FIX_MAC_FW = AwesomeVersion("3.70")
|
FIX_MAC_FW = AwesomeVersion("3.70")
|
||||||
|
SWITCH_PRODUCT_IDS = [70, 71, 89]
|
||||||
|
|
||||||
SERVICE_LIFX_SET_STATE = "set_state"
|
SERVICE_LIFX_SET_STATE = "set_state"
|
||||||
|
|
||||||
@ -396,14 +397,18 @@ class LIFXManager:
|
|||||||
# Read initial state
|
# Read initial state
|
||||||
ack = AwaitAioLIFX().wait
|
ack = AwaitAioLIFX().wait
|
||||||
|
|
||||||
# Used to populate sw_version
|
# Get the product info first so that LIFX Switches
|
||||||
# no need to wait as we do not
|
# can be ignored.
|
||||||
# need it until later
|
version_resp = await ack(bulb.get_version)
|
||||||
bulb.get_hostfirmware()
|
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)
|
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:
|
if color_resp is None or version_resp is None:
|
||||||
_LOGGER.error("Failed to initialize %s", bulb.ip_addr)
|
_LOGGER.error("Failed to initialize %s", bulb.ip_addr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user