LIFX: assume default features for unknown products (#8553)
This makes the detection work for prototypes as well.
This commit is contained in:
parent
9cc3e7e47b
commit
8a42e1551a
1 changed files with 8 additions and 2 deletions
|
@ -159,12 +159,18 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
|
|
||||||
def lifxwhite(device):
|
def lifxwhite(device):
|
||||||
"""Return whether this is a white-only bulb."""
|
"""Return whether this is a white-only bulb."""
|
||||||
return not aiolifx().products.features_map[device.product]["color"]
|
features = aiolifx().products.features_map.get(device.product, None)
|
||||||
|
if features:
|
||||||
|
return not features["color"]
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def lifxmultizone(device):
|
def lifxmultizone(device):
|
||||||
"""Return whether this is a multizone bulb/strip."""
|
"""Return whether this is a multizone bulb/strip."""
|
||||||
return aiolifx().products.features_map[device.product]["multizone"]
|
features = aiolifx().products.features_map.get(device.product, None)
|
||||||
|
if features:
|
||||||
|
return features["multizone"]
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def find_hsbk(**kwargs):
|
def find_hsbk(**kwargs):
|
||||||
|
|
Loading…
Add table
Reference in a new issue