@@ -131,15 +131,17 @@ def convert_hue(self, hue, legacy_color_wheel=False):
131
131
132
132
return hue % (self .MAX_HUE + 1 )
133
133
134
- def _build_command (self , cmd_1 , cmd_2 ):
134
+ def _build_command (self , cmd_1 , cmd_2 ,
135
+ select = False , select_command = None ):
135
136
"""
136
137
Constructs the complete command.
137
138
:param cmd_1: Light command 1.
138
139
:param cmd_2: Light command 2.
139
140
:return: The complete command.
140
141
"""
141
142
142
- return CommandV6 (cmd_1 , cmd_2 , self ._remote_style , self ._group_number )
143
+ return CommandV6 (cmd_1 , cmd_2 , self ._remote_style , self ._group_number ,
144
+ select , select_command )
143
145
144
146
145
147
class CommandSetBridgeLightV6 (CommandSetV6 ):
@@ -227,21 +229,33 @@ def night_light(self):
227
229
"""
228
230
return self ._build_command (0x01 , 0x06 )
229
231
230
- def brightness (self , brightness ):
232
+ def dimmer (self ):
231
233
"""
232
- Build command for setting the brightness of the led.
233
- :param brightness: Value to set (0.0-1.0).
234
+ Build command for setting the brightness one step dimmer.
234
235
:return: The command.
235
236
"""
236
- return self ._build_command (0x01 , self .convert_brightness ( brightness ))
237
+ return self ._build_command (0x01 , 0x02 , select = True , select_command = self .on ( ))
237
238
238
- def temperature (self , temperature ):
239
+ def brighter (self ):
239
240
"""
240
- Build command for setting the temperature of the led.
241
- :param temperature: Value to set (0.0-1.0).
241
+ Build command for setting the brightness one step brighter.
242
+ :return: The command.
243
+ """
244
+ return self ._build_command (0x01 , 0x01 , select = True , select_command = self .on ())
245
+
246
+ def cooler (self ):
247
+ """
248
+ Build command for setting the temperature one step cooler.
249
+ :return: The command.
250
+ """
251
+ return self ._build_command (0x01 , 0x04 , select = True , select_command = self .on ())
252
+
253
+ def warmer (self ):
254
+ """
255
+ Build command for setting the temperature one step warmer.
242
256
:return: The command.
243
257
"""
244
- return self ._build_command (0x01 , self .convert_temperature ( temperature ))
258
+ return self ._build_command (0x01 , 0x03 , select = True , select_command = self .on ( ))
245
259
246
260
class CommandSetDimmerV6 (CommandSetV6 ):
247
261
""" Command set for Dimmer LED dimmer (1CH MiLight dimmer) connected to wifi bridge v6. """
0 commit comments