File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 257257 { 'value' :'color_temp' , 'label' :'Color Temperature (50..400)' } ,
258258 { 'value' :'color_temp_move' , 'label' :'Color Temperature Move (50..400|stop)' } ,
259259 { 'value' :'color_temp_step' , 'label' :'Color Temperature Step (50..400)' } ,
260- { 'value' :'position' , 'label' :'Position' } ,
260+ { 'value' :'position' , 'label' :'Position (0..100)' } ,
261+ { 'value' :'lock' , 'label' :'Lock (lock|unlock|on|off|toggle)' } ,
261262 { 'value' :'alert' , 'label' :'Alert' }
262263 ]
263264 } ,
Original file line number Diff line number Diff line change @@ -111,6 +111,21 @@ module.exports = function(RED) {
111111 payload = parseInt ( payload ) ;
112112 break ;
113113
114+ case 'lock' :
115+ command = 'state' ;
116+ if ( payload === 'toggle' ) {
117+ if ( 'state' in device . current_values && device . current_values . state === 'lock' ) {
118+ payload = 'unlock' ;
119+ } else {
120+ payload = 'lock' ;
121+ }
122+ } else if ( payload === 'lock' || payload == 1 || payload === true ) {
123+ payload = 'lock' ;
124+ } else if ( payload === 'unlock' || payload == 0 || payload === false ) {
125+ payload = 'unlock' ;
126+ }
127+ break ;
128+
114129 case 'color' :
115130 payload = { "color" :payload } ;
116131 break ;
Original file line number Diff line number Diff line change 55 },
66 "name" : " node-red-contrib-zigbee2mqtt" ,
77 "description" : " Zigbee2mqtt connectivity nodes for node-red" ,
8- "version" : " 2.5.2 " ,
8+ "version" : " 2.6.0 " ,
99 "dependencies" : {
1010 "eventsource" : " ^2.0.2" ,
1111 "mqtt" : " ^4.3.7" ,
You can’t perform that action at this time.
0 commit comments