File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
"""Door/Windows sensors."""
2
2
3
- from zigpy .quirks .v2 import QuirkBuilder
3
+ from zigpy .quirks .v2 import BinarySensorDeviceClass , QuirkBuilder
4
4
from zigpy .zcl .clusters .general import BinaryInput
5
+ from zigpy .zcl .clusters .security import IasZone
5
6
6
7
from zhaquirks import PowerConfigurationCluster
7
8
@@ -25,5 +26,14 @@ class DevelcoPowerConfiguration(PowerConfigurationCluster):
25
26
.replaces (DevelcoPowerConfiguration , endpoint_id = 35 )
26
27
# The binary input cluster is a duplicate
27
28
.prevent_default_entity_creation (endpoint_id = 35 , cluster_id = BinaryInput .cluster_id )
29
+ .binary_sensor (
30
+ endpoint_id = 35 ,
31
+ cluster_id = IasZone .cluster_id ,
32
+ attribute_name = IasZone .AttributeDefs .zone_status .name ,
33
+ device_class = BinarySensorDeviceClass .TAMPER ,
34
+ attribute_converter = lambda value : bool (value & IasZone .ZoneStatus .Tamper ),
35
+ unique_id_suffix = "tamper" ,
36
+ fallback_name = "Tamper" ,
37
+ )
28
38
.add_to_registry ()
29
39
)
You can’t perform that action at this time.
0 commit comments