Skip to content

Commit

Permalink
https://github.com/andreypopov/node-red-contrib-zigbee2mqtt/issues/109
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypopov committed Feb 1, 2023
1 parent 5c662cf commit 59d3120
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nodes/out.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module.exports = function(RED) {
switch (command) {
case 'state':
if (payload === 'toggle') {
if ('position' in device.current_values) {
if (device.current_values && 'position' in device.current_values) {
payload = device.current_values.position > 0 ? 'close' : 'open';
}
}
Expand All @@ -119,7 +119,7 @@ module.exports = function(RED) {
case 'lock':
command = 'state';
if (payload === 'toggle') {
if ('lock_state' in
if (device.current_values && 'lock_state' in
device.current_values && device.current_values.lock_state === 'locked') {
payload = 'unlock';
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"name": "node-red-contrib-zigbee2mqtt",
"description": "Zigbee2mqtt connectivity nodes for node-red",
"version": "2.6.5-a19",
"version": "2.7.1",
"dependencies": {
"eventsource": "^2.0.2",
"mqtt": "^4.3.7",
Expand Down

0 comments on commit 59d3120

Please sign in to comment.