Skip to content

Commit 495490d

Browse files
authored
Remove passive detection of contact sensors (#219)
1 parent 8c38ab8 commit 495490d

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

switchbot/adv_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class SwitchbotSupportedType(TypedDict):
4949
"modelFriendlyName": "Contact Sensor",
5050
"func": process_wocontact,
5151
"manufacturer_id": 2409,
52-
"manufacturer_data_length": 13,
5352
},
5453
"H": {
5554
"modelName": SwitchbotModel.BOT,

tests/test_adv_parser.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -593,28 +593,10 @@ def test_contact_sensor_mfr_no_service_data():
593593
rssi=-70,
594594
)
595595
result = parse_advertisement_data(ble_device, adv_data)
596-
assert result == SwitchBotAdvertisement(
597-
address="aa:bb:cc:dd:ee:ff",
598-
data={
599-
"data": {
600-
"battery": None,
601-
"button_count": 4,
602-
"contact_open": True,
603-
"contact_timeout": True,
604-
"is_light": False,
605-
"motion_detected": False,
606-
"tested": None,
607-
},
608-
"isEncrypted": False,
609-
"model": "d",
610-
"modelFriendlyName": "Contact Sensor",
611-
"modelName": SwitchbotModel.CONTACT_SENSOR,
612-
"rawAdvData": None,
613-
},
614-
device=ble_device,
615-
rssi=-70,
616-
active=False,
617-
)
596+
# Passive detection of contact sensor is not supported
597+
# anymore since the Switchbot Curtain v3 was released
598+
# which uses the heuristics for the contact sensor.
599+
assert result is None
618600

619601

620602
def test_contact_sensor_srv():

0 commit comments

Comments
 (0)