Skip to content

Commit cd6e70e

Browse files
committed
Add fullcolorsupport to lightbulb
1 parent ba3b28e commit cd6e70e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pyfritzhome/devicetypes/fritzhomedevicelightbulb.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The light bulb device class."""
2+
23
# -*- coding: utf-8 -*-
34

45
import logging
@@ -20,6 +21,7 @@ class FritzhomeDeviceLightBulb(FritzhomeDeviceBase):
2021
color_temp = None
2122
color_mode = None
2223
supported_color_mode = None
24+
fullcolorsupport = None
2325

2426
def _update_from_node(self, node):
2527
super()._update_from_node(node)
@@ -58,6 +60,10 @@ def _update_lightbulb_from_node(self, node):
5860
"supported_modes"
5961
)
6062

63+
self.fullcolorsupport = colorcontrol_element.attrib.get(
64+
"fullcolorsupport"
65+
)
66+
6167
except ValueError:
6268
pass
6369

@@ -120,7 +126,7 @@ def set_color(self, hsv, duration=0):
120126

121127
def set_unmapped_color(self, hsv, duration=0):
122128
"""Set unmapped HSV color (Free color selection)."""
123-
if self.has_color:
129+
if self.has_color and self.fullcolorsupport:
124130
self._fritz.set_color(self.ain, hsv, duration, False)
125131

126132
def get_color_temps(self):

tests/test_fritzhomedevicelightbulb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_device_init(self):
3838
assert device.state # Lightbulb is switched on
3939
assert device.color_mode == "1"
4040
assert device.supported_color_mode == "5"
41+
assert device.fullcolorsupport
4142
assert device.hue == 358
4243
assert device.saturation == 180
4344
assert device.color_temp is None
@@ -87,6 +88,7 @@ def test_device_init_color_temp_mode(self):
8788
assert device.state # Lightbulb is switched on
8889
assert device.color_mode == "4"
8990
assert device.supported_color_mode == "5"
91+
assert device.fullcolorsupport
9092
assert device.hue is None
9193
assert device.saturation is None
9294
assert device.color_temp == 2800

0 commit comments

Comments
 (0)