File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,17 @@ def process_wocontact(
1111
1212 battery = data [2 ] & 0b01111111 if data else None
1313 tested = bool (data [1 ] & 0b10000000 ) if data else None
14- contact_timeout = data [3 ] & 0b00000100 == 0b00000100 if data else False
1514
1615 if mfr_data and len (mfr_data ) >= 13 :
1716 motion_detected = bool (mfr_data [7 ] & 0b10000000 )
1817 contact_open = bool (mfr_data [7 ] & 0b00010000 )
18+ contact_timeout = bool (mfr_data [7 ] & 0b00100000 )
1919 button_count = mfr_data [12 ] & 0b00001111
2020 is_light = bool (mfr_data [7 ] & 0b01000000 )
2121 else :
2222 motion_detected = bool (data [1 ] & 0b01000000 )
23- contact_open = data [3 ] & 0b00000010 == 0b00000010
23+ contact_open = bool (data [3 ] & 0b00000010 )
24+ contact_timeout = bool (data [3 ] & 0b00000100 )
2425 button_count = data [8 ] & 0b00001111
2526 is_light = bool (data [3 ] & 0b00000001 )
2627
Original file line number Diff line number Diff line change @@ -504,8 +504,8 @@ def test_contact_sensor_mfr_no_service_data():
504504 "data" : {
505505 "battery" : None ,
506506 "button_count" : 4 ,
507- "contact_open" : False ,
508- "contact_timeout" : False ,
507+ "contact_open" : True ,
508+ "contact_timeout" : True ,
509509 "is_light" : False ,
510510 "motion_detected" : False ,
511511 "tested" : None ,
You can’t perform that action at this time.
0 commit comments