diff --git a/Modules/actuators.py b/Modules/actuators.py index c11d5f70f..2cf2d689a 100644 --- a/Modules/actuators.py +++ b/Modules/actuators.py @@ -250,13 +250,14 @@ def actuator_setcolor(self, nwkid, EPout, value, Color): force_color_command = get_deviceconf_parameter_value(self, self.ListOfDevices[nwkid]["Model"], "FORCE_COLOR_COMMAND", return_default=None) ColorCapabilitiesList = device_color_capabilities( self, nwkid, EPout) - + self.log.logging("Command", "Debug", "actuator_setcolor force_color_command %s" % force_color_command, nwkid) + if Hue_List["m"] == 2: # ColorModeTemp = 2 // White with color temperature. Valid fields: t handle_color_mode_2(self, nwkid, EPout, Hue_List) elif Hue_List["m"] == 3 and force_color_command == "TuyaMovetoHueandSaturation": - handle_color_mode_tuya( self, nwkid, EPout, Hue_List) + handle_color_mode_tuya( self, nwkid, EPout, Hue_List, value) elif Hue_List["m"] == 3: # ColorModeRGB = 3 // Color. Valid fields: r, g, b. @@ -362,7 +363,7 @@ def handle_color_mode_tuya( self, nwkid, EPout, Hue_List, value): hue, saturation, value), nwkid) if get_deviceconf_parameter_value(self, self.ListOfDevices[nwkid]["Model"], "TUYAColorControlRgbMode", return_default=None): tuya_color_control_rgbMode( self, nwkid, "01") - tuya_Move_To_Hue_Saturation( self, nwkid, EPout, hue, saturation, transitionHue) + tuya_Move_To_Hue_Saturation( self, nwkid, EPout, hue, saturation, transitionHue ) def actuator_identify(self, nwkid, ep, value=None): diff --git a/Modules/tuya.py b/Modules/tuya.py index 7cd97b855..c7a7f481f 100644 --- a/Modules/tuya.py +++ b/Modules/tuya.py @@ -1535,19 +1535,17 @@ def tuya_color_control_rgbMode( self, NwkId, mode): payload = "11" + sqn + "f0" + mode raw_APS_request(self, NwkId, "01", "0300", "0104", payload, zigpyzqn=sqn, zigate_ep=ZIGATE_EP, ackIsDisabled=False) -def tuya_Move_To_Hue_Saturation( self, NwkId, hue, saturation, transition): +def tuya_Move_To_Hue_Saturation( self, NwkId, EPout, hue, saturation, transition): # Command 0x06 self.log.logging("Tuya", "Debug", "tuya_Move_To_Hue_Saturation", NwkId) hue = "%02x" % hue saturation = "%02x" % saturation - - transition = "%04x" % struct.unpack("H", struct.pack(">H", transition, ))[0] sqn = get_and_inc_ZCL_SQN(self, NwkId) payload = "11" + sqn + "06" + hue + saturation + transition + "ff" - raw_APS_request(self, NwkId, "01", "0300", "0104", payload, zigpyzqn=sqn, zigate_ep=ZIGATE_EP, ackIsDisabled=False) + raw_APS_request(self, NwkId, EPout, "0300", "0104", payload, zigpyzqn=sqn, zigate_ep=ZIGATE_EP, ackIsDisabled=False) def tuya_Move_To_Hue_Saturation_Brightness( self, NwkId, epout, hue, saturation, brightness):