From 8f501805980f42fd713ee19f29fa549020da0ed3 Mon Sep 17 00:00:00 2001 From: pbalogh77 Date: Fri, 30 Nov 2018 17:23:25 +0100 Subject: [PATCH] Hotfix for Fibaro wall plug (#18845) Fibaro wall plug with a lamp plugged in was misrecognized as a color light, generating crashes in the update function. --- homeassistant/components/light/fibaro.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/light/fibaro.py b/homeassistant/components/light/fibaro.py index 96069d50335..7157dcfd31b 100644 --- a/homeassistant/components/light/fibaro.py +++ b/homeassistant/components/light/fibaro.py @@ -65,7 +65,8 @@ class FibaroLight(FibaroDevice, Light): self._update_lock = asyncio.Lock() if 'levelChange' in fibaro_device.interfaces: self._supported_flags |= SUPPORT_BRIGHTNESS - if 'color' in fibaro_device.properties: + if 'color' in fibaro_device.properties and \ + 'setColor' in fibaro_device.actions: self._supported_flags |= SUPPORT_COLOR if 'setW' in fibaro_device.actions: self._supported_flags |= SUPPORT_WHITE_VALUE @@ -168,7 +169,9 @@ class FibaroLight(FibaroDevice, Light): if self._supported_flags & SUPPORT_BRIGHTNESS: self._brightness = float(self.fibaro_device.properties.value) # Color handling - if self._supported_flags & SUPPORT_COLOR: + if self._supported_flags & SUPPORT_COLOR and \ + 'color' in self.fibaro_device.properties and \ + ',' in self.fibaro_device.properties.color: # Fibaro communicates the color as an 'R, G, B, W' string rgbw_s = self.fibaro_device.properties.color if rgbw_s == '0,0,0,0' and\