Skip to content

Commit 56920c7

Browse files
authored
Fix contact sensor button count (#126)
1 parent 36b0359 commit 56920c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

switchbot/adv_parsers/contact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def process_wocontact(data: bytes, mfr_data: bytes | None) -> dict[str, bool | i
1111
"contact_open": data[3] & 0b00000010 == 0b00000010,
1212
"contact_timeout": data[3] & 0b00000110 == 0b00000110,
1313
"is_light": bool(data[3] & 0b00000001),
14-
"button_count": (data[7] & 0b11110000) >> 4,
14+
"button_count": (data[8] & 0b00001111),
1515
}

0 commit comments

Comments
 (0)