mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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.
This commit is contained in:
parent
80f2c2b124
commit
474909b515
@ -65,7 +65,8 @@ class FibaroLight(FibaroDevice, Light):
|
|||||||
self._update_lock = asyncio.Lock()
|
self._update_lock = asyncio.Lock()
|
||||||
if 'levelChange' in fibaro_device.interfaces:
|
if 'levelChange' in fibaro_device.interfaces:
|
||||||
self._supported_flags |= SUPPORT_BRIGHTNESS
|
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
|
self._supported_flags |= SUPPORT_COLOR
|
||||||
if 'setW' in fibaro_device.actions:
|
if 'setW' in fibaro_device.actions:
|
||||||
self._supported_flags |= SUPPORT_WHITE_VALUE
|
self._supported_flags |= SUPPORT_WHITE_VALUE
|
||||||
@ -168,7 +169,9 @@ class FibaroLight(FibaroDevice, Light):
|
|||||||
if self._supported_flags & SUPPORT_BRIGHTNESS:
|
if self._supported_flags & SUPPORT_BRIGHTNESS:
|
||||||
self._brightness = float(self.fibaro_device.properties.value)
|
self._brightness = float(self.fibaro_device.properties.value)
|
||||||
# Color handling
|
# 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
|
# Fibaro communicates the color as an 'R, G, B, W' string
|
||||||
rgbw_s = self.fibaro_device.properties.color
|
rgbw_s = self.fibaro_device.properties.color
|
||||||
if rgbw_s == '0,0,0,0' and\
|
if rgbw_s == '0,0,0,0' and\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user