Skip to content

Commit

Permalink
Invert occupancy for Tuya _TZE200_3towulqd (#3858)
Browse files Browse the repository at this point in the history
  • Loading branch information
prairiesnpr authored Feb 13, 2025
1 parent 7e475b2 commit 9265d8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit 9265d8a

Please sign in to comment.