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

Invert occupancy for Tuya _TZE200_3towulqd #3858

Merged
merged 3 commits into from
Feb 13, 2025
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
9 changes: 5 additions & 4 deletions tests/test_tuya_motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ZCL_TUYA_MOTION_V4 = b"\tL\x01\x00\x05\x69\x01\x00\x01\x01" # DP 105
ZCL_TUYA_MOTION_V5 = b"\tL\x01\x00\x05\x01\x01\x00\x01\x04" # DP 1, motion is 0x04
ZCL_TUYA_MOTION_V6 = b"\tL\x01\x00\x05\x01\x04\x00\x01\x02" # DP 1, enum
ZCL_TUYA_MOTION_v7 = b"\tL\x01\x00\x05\x01\x01\x00\x01\x00" # DP 1, Inv


zhaquirks.setup()
Expand Down Expand Up @@ -52,10 +53,10 @@
("_TZE204_kyhbrfyl", "TS0601", ZCL_TUYA_MOTION),
("_TZ6210_duv6fhwt", "TS0601", ZCL_TUYA_MOTION),
("_TZE204_1youk3hj", "TS0601", ZCL_TUYA_MOTION),
("_TZE200_3towulqd", "TS0601", ZCL_TUYA_MOTION),
("_TZE200_1ibpyhdc", "TS0601", ZCL_TUYA_MOTION),
("_TZE200_bh3n6gk8", "TS0601", ZCL_TUYA_MOTION),
("_TZE200_ttcovulf", "TS0601", ZCL_TUYA_MOTION),
("_TZE200_3towulqd", "TS0601", ZCL_TUYA_MOTION_v7),
("_TZE200_1ibpyhdc", "TS0601", ZCL_TUYA_MOTION_v7),
("_TZE200_bh3n6gk8", "TS0601", ZCL_TUYA_MOTION_v7),
("_TZE200_ttcovulf", "TS0601", ZCL_TUYA_MOTION_v7),
("_TZE204_sxm7l9xa", "TS0601", ZCL_TUYA_MOTION_V4),
("_TZE204_e5m9c5hl", "TS0601", ZCL_TUYA_MOTION_V4),
("_TZE204_dapwryy7", "TS0601", ZCL_TUYA_MOTION_V6),
Expand Down
2 changes: 1 addition & 1 deletion zhaquirks/tuya/tuya_motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ class TuyaSensitivityMode(t.enum8):
dp_id=1,
ep_attribute=TuyaOccupancySensing.ep_attribute,
attribute_name=OccupancySensing.AttributeDefs.occupancy.name,
converter=lambda x: x == 1,
converter=lambda x: x == 0,
)
.adds(TuyaOccupancySensing)
.tuya_battery(dp_id=4)
Expand Down
Loading