Index: limitlessled_rf/__init__.py ================================================================== --- limitlessled_rf/__init__.py +++ limitlessled_rf/__init__.py @@ -16,10 +16,11 @@ 'zones': [1, 2, 3, 4], 'features': [ 'can_set_brightness', 'has_brightness', 'has_white', + 'has_night', 'has_color' ], 'brightness_range': [0, 25], 'button_map': { 'slider': 0x00, @@ -61,10 +62,11 @@ 'zones': [1, 2, 3, 4], 'features': [ 'has_max_brightness', 'has_brightness', 'has_temperature', + 'has_night', 'is_white' ], 'button_map': { 'on': 0x05, 'off': 0x09, @@ -736,10 +738,24 @@ message['retries'] = self._config['retries'] * 2 message['delay'] = self._config['delay'] * 2 return self._send_button(message) + def night(self, zone = None): + # If the bulbs do not support night, nothing needs to be done + if 'has_night' not in self._config['features']: + return False + + if zone is None: + message = {'button': 'night'} + else: + message = { + 'button': 'zone_night', + 'zone': zone + } + return self._send_button(message) + def white(self, zone = None): # If the bulbs are already white, nothing needs to be done if 'is_white' in self._config['features']: return True