Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
arteck authored Dec 23, 2023
1 parent 8d57381 commit 73fa2e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,12 @@ class Zigbee extends utils.Adapter {
};

// new toZigbee
if (typeof preparedValue === 'number') {
meta.message.state = preparedValue > 0 ? 'ON' : 'OFF';
} else {
meta.message.state = preparedValue;
if (preparedValue !== undefined) {
if (typeof preparedValue === 'number') {
meta.message.state = preparedValue > 0 ? 'ON' : 'OFF';
} else {
meta.message.state = preparedValue;
}
}

if (preparedOptions.hasOwnProperty('state')) {
Expand Down

0 comments on commit 73fa2e7

Please sign in to comment.