File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ """Module for Sunricher devices."""
Original file line number Diff line number Diff line change 1+ """Sunricher Button device."""
2+
3+ from zigpy .quirks .v2 import QuirkBuilder
4+
5+ from zhaquirks .const import (
6+ COMMAND ,
7+ COMMAND_MOVE_ON_OFF ,
8+ COMMAND_OFF ,
9+ COMMAND_ON ,
10+ COMMAND_STOP_ON_OFF ,
11+ LONG_PRESS ,
12+ LONG_RELEASE ,
13+ RIGHT ,
14+ SHORT_PRESS ,
15+ TURN_OFF ,
16+ TURN_ON ,
17+ )
18+
19+ (
20+ QuirkBuilder ("Sunricher" , "ZGRC-KEY-004" )
21+ .device_automation_triggers (
22+ {
23+ (SHORT_PRESS , TURN_ON ): {COMMAND : COMMAND_ON },
24+ (SHORT_PRESS , TURN_OFF ): {COMMAND : COMMAND_OFF },
25+ (LONG_PRESS , RIGHT ): {COMMAND : COMMAND_MOVE_ON_OFF },
26+ (LONG_RELEASE , RIGHT ): {COMMAND : COMMAND_STOP_ON_OFF },
27+ }
28+ )
29+ .add_to_registry ()
30+ )
You can’t perform that action at this time.
0 commit comments