diff --git a/tests/test_tuya_dimmer.py b/tests/test_tuya_dimmer.py index bd08cae7ef..97679ef2a4 100644 --- a/tests/test_tuya_dimmer.py +++ b/tests/test_tuya_dimmer.py @@ -48,7 +48,7 @@ async def test_command(zigpy_device_from_quirk, quirk): m1.assert_called_with( 61184, 4, - b"\x01\x04\x00\x00\x03\x02\x02\x00\x04\x00\x00\x03r", + b"\x01\x04\x00\x00\x03\x02\x02\x00\x04r\x03\x00\x00", expect_reply=True, command_id=0, ) @@ -78,7 +78,7 @@ async def test_write_attr(zigpy_device_from_quirk, quirk): m1.assert_called_with( 61184, 2, - b"\x01\x02\x00\x00\x01\x03\x02\x00\x04\x00\x00\x00b", + b"\x01\x02\x00\x00\x01\x03\x02\x00\x04b\x00\x00\x00", expect_reply=False, command_id=0, ) diff --git a/tests/test_tuya_mcu.py b/tests/test_tuya_mcu.py index be1d25d582..0bd1ea2580 100644 --- a/tests/test_tuya_mcu.py +++ b/tests/test_tuya_mcu.py @@ -135,7 +135,7 @@ async def test_tuya_methods(zigpy_device_from_quirk, quirk): assert len(result_1.datapoints) == 1 assert result_1.datapoints[0].dp == 9 assert result_1.datapoints[0].data.dp_type == TuyaDPType.VALUE - assert result_1.datapoints[0].data.raw == b"\x00\x00\x00b" + assert result_1.datapoints[0].data.raw == b"b\x00\x00\x00" tcd_2 = TuyaClusterData( endpoint_id=7, cluster_attr="not_exists_attribute", attr_value=25 diff --git a/tests/test_tuya_valve.py b/tests/test_tuya_valve.py index d07ded2f80..f4a7785a8a 100644 --- a/tests/test_tuya_valve.py +++ b/tests/test_tuya_valve.py @@ -61,7 +61,7 @@ async def test_write_attr_psbzs(zigpy_device_from_quirk, quirk): m1.assert_called_with( 61184, 2, - b"\x01\x02\x00\x00\x01\x05\x02\x00\x04\x00\x00\x00\x0f", + b"\x01\x02\x00\x00\x01\x05\x02\x00\x04\x0f\x00\x00\x00", expect_reply=False, command_id=0, ) diff --git a/zhaquirks/tuya/mcu/__init__.py b/zhaquirks/tuya/mcu/__init__.py index dd650eed19..ad9718ae45 100644 --- a/zhaquirks/tuya/mcu/__init__.py +++ b/zhaquirks/tuya/mcu/__init__.py @@ -217,7 +217,7 @@ def from_cluster_data(self, data: TuyaClusterData) -> Optional[TuyaCommand]: tuya_data = TuyaData() tuya_data.dp_type = datapoint_type tuya_data.function = 0 - tuya_data.raw = t.LVBytes.deserialize(val)[0] + tuya_data.raw = bytes(reversed(val[1:])) self.debug("raw: %s", tuya_data.raw) dpd = TuyaDatapointData(dp, tuya_data) cmd_payload.datapoints = [dpd]