File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ """Sonoff SWV - Zigbee smart water valve."""
2
+
3
+ from zigpy .quirks import CustomCluster
4
+ from zigpy .quirks .v2 import QuirkBuilder
5
+ import zigpy .types as t
6
+ from zigpy .zcl .foundation import BaseAttributeDefs , ZCLAttributeDef
7
+
8
+
9
+ class ValveState (t .enum8 ):
10
+ """Water valve state."""
11
+
12
+ Normal = 0
13
+ Water_Shortage = 1
14
+ Water_Leakage = 2
15
+ Water_Shortage_And_Leakage = 3
16
+
17
+
18
+ class EwelinkCluster (CustomCluster ):
19
+ """Ewelink specific cluster."""
20
+
21
+ cluster_id = 0xFC11
22
+
23
+ class AttributeDefs (BaseAttributeDefs ):
24
+ """Attribute definitions."""
25
+
26
+ water_valve_state = ZCLAttributeDef (
27
+ id = 0x500C ,
28
+ type = ValveState ,
29
+ )
30
+
31
+ @property
32
+ def _is_manuf_specific (self ):
33
+ return False
34
+
35
+
36
+ (
37
+ QuirkBuilder ("SONOFF" , "SWV" )
38
+ .replaces (EwelinkCluster )
39
+ .add_to_registry ()
40
+ ) # fmt: skip
You can’t perform that action at this time.
0 commit comments