Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert PR #1984 #1999

Merged
merged 4 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_tuya_dimmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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\x04r\x03\x00\x00",
b"\x01\x04\x00\x00\x03\x02\x02\x00\x04\x00\x00\x03r",
expect_reply=True,
command_id=0,
)
Expand Down Expand Up @@ -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\x04b\x00\x00\x00",
b"\x01\x02\x00\x00\x01\x03\x02\x00\x04\x00\x00\x00b",
expect_reply=False,
command_id=0,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tuya_mcu.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async def test_tuya_methods(zigpy_device_from_quirk, quirk):
assert len(result_1[0].datapoints) == 1
assert result_1[0].datapoints[0].dp == 9
assert result_1[0].datapoints[0].data.dp_type == TuyaDPType.VALUE
assert result_1[0].datapoints[0].data.raw == b"b\x00\x00\x00"
assert result_1[0].datapoints[0].data.raw == b"\x00\x00\x00b"

tcd_2 = TuyaClusterData(
endpoint_id=7, cluster_attr="not_exists_attribute", attr_value=25
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tuya_valve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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\x0f\x00\x00\x00",
b"\x01\x02\x00\x00\x01\x05\x02\x00\x04\x00\x00\x00\x0f",
expect_reply=False,
command_id=0,
)
Expand Down
2 changes: 1 addition & 1 deletion zhaquirks/tuya/mcu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,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 = bytes(reversed(val[1:]))
tuya_data.raw = t.LVBytes.deserialize(val)[0]
self.debug("raw: %s", tuya_data.raw)
dpd = TuyaDatapointData(dp, tuya_data)
cmd_payload.datapoints = [dpd]
Expand Down