File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ """Senoro Window Sensor (TS0601)."""
2+
3+ from zigpy .quirks .v2 import EntityPlatform , EntityType
4+ import zigpy .types as t
5+
6+ from zhaquirks .tuya import BatterySize
7+ from zhaquirks .tuya .builder import TuyaQuirkBuilder
8+
9+
10+ class OpeningStateEnum (t .enum8 ):
11+ """Enum for opening state."""
12+
13+ Open = 0
14+ Closed = 1
15+ Tilted = 2
16+
17+
18+ (
19+ TuyaQuirkBuilder ("_TZE200_ytx9fudw" , "TS0601" )
20+ .tuya_battery (
21+ dp_id = 2 ,
22+ battery_type = BatterySize .CR2032 ,
23+ battery_qty = 3 ,
24+ )
25+ .tuya_enum (
26+ dp_id = 101 ,
27+ attribute_name = "opening_state" ,
28+ enum_class = OpeningStateEnum ,
29+ entity_type = EntityType .STANDARD ,
30+ entity_platform = EntityPlatform .SENSOR ,
31+ translation_key = "opening" ,
32+ fallback_name = "Opening" ,
33+ )
34+ .skip_configuration ()
35+ .add_to_registry ()
36+ )
You can’t perform that action at this time.
0 commit comments