From fb6bdfaba9563f8e2d52c78f5ff15fee6e42a5f0 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Thu, 20 Jul 2017 07:54:46 +0200 Subject: [PATCH] LIFX: assume default features for unknown products (#8553) This makes the detection work for prototypes as well. --- homeassistant/components/light/lifx.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/light/lifx.py b/homeassistant/components/light/lifx.py index a32aa0c4a6b6f..a6c5f8558755e 100644 --- a/homeassistant/components/light/lifx.py +++ b/homeassistant/components/light/lifx.py @@ -159,12 +159,18 @@ def cleanup(event): def lifxwhite(device): """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): """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):