Fix yolink abnormal status when LeakSensor detection mode changes to "no water detect" (#109575)

Add no water detect support
This commit is contained in:
Matrix 2024-02-04 15:27:57 +08:00 committed by GitHub
parent f6d2f6117a
commit 630c8b28ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,7 +63,7 @@ SENSOR_TYPES: tuple[YoLinkBinarySensorEntityDescription, ...] = (
YoLinkBinarySensorEntityDescription(
key="leak_state",
device_class=BinarySensorDeviceClass.MOISTURE,
value=lambda value: value == "alert" if value is not None else None,
value=lambda value: value in ("alert", "full") if value is not None else None,
exists_fn=lambda device: device.device_type == ATTR_DEVICE_LEAK_SENSOR,
),
YoLinkBinarySensorEntityDescription(