Index: limitlessled_rf/__init__.py ================================================================== --- limitlessled_rf/__init__.py +++ limitlessled_rf/__init__.py @@ -7,11 +7,11 @@ _remote_type_alias_map = { 'fut089': 'rgb+cct' } _remote_type_parameters_map = { 'rgbw': { - 'retries': 10, + 'retries': 5, 'delay': 0.05, 'channels': [9, 40, 71], 'syncword': [0x258B, 0x147A], 'features': [ 'can_set_brightness', @@ -190,11 +190,11 @@ zone = button_info.get('zone', 0) # Some buttons need to be converted to zones button_name = button_info['button'] if button_name in ['zone_on', 'zone_off', 'zone_max', 'zone_night']: - button_name = button_name + ':' + str(zone) + button_name = "{}:{}".format(button_name, zone) # Look up the button button_id = self._config['button_map'][button_name] # Compute message body @@ -202,13 +202,13 @@ # Compute the whole message so far message = header + body # Compute message trailer - ## Include a CRC, for good measure ? + ## Include a CRC, for good measure crc = len(message) + 1 - for byte in header + body: + for byte in message: crc = crc + byte crc = crc & 0xff trailer = [crc] message = message + trailer @@ -375,10 +375,11 @@ self._message_id = (self._message_id + 1) & 0xff return self._message_id def _send_button(self, button_info): # Include the remote ID unless one was supplied + button_info = button_info.copy() if 'remote_id' not in button_info: button_info['remote_id'] = self._id # Get the next message ID for this remote if 'message_id' not in button_info: @@ -469,15 +470,13 @@ self._send_button(step_command) return True def _step_brightness(self, brightness, brightness_min, brightness_max, zone = None): - self.on(zone) return self._step_value(brightness, brightness_min, brightness_max, 'brightness', zone) def _step_temperature(self, temperature, temperature_min, temperature_max, zone = None): - self.on(zone) return self._step_value(temperature, temperature_min, temperature_max, 'temperature', zone) def _max_brightness(self, zone = None): if zone is None: message = {'button': 'max'}