Skip to content

Commit

Permalink
Check if message has onOff for state converters. Koenkk/zigbee2mqtt#1176
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk authored and qosmio committed Dec 25, 2019
1 parent ce63572 commit eeaeedf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,9 @@ const converters = {
cid: 'genOnOff',
type: 'devChange',
convert: (model, msg, publish, options) => {
return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'};
if (msg.data.data.hasOwnProperty('onOff')) {
return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'};
}
},
},
xiaomi_power: {
Expand Down

0 comments on commit eeaeedf

Please sign in to comment.