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 97dbddf commit e6cb089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ class Zigbee extends utils.Adapter {
for (const converter of converters) {
const publish = (payload) => {
this.log.debug(`Publish ${safeJsonStringify(payload)} to ${safeJsonStringify(devId)}`);
if (payload) {
if (typeof payload === 'object') {
this.publishToState(devId, model, payload);
}
};
Expand All @@ -576,7 +576,7 @@ class Zigbee extends utils.Adapter {

const payload = await new Promise((resolve, reject) => {
const payload = converter.convert(mappedModel, message, publish, options, meta);
if (payload) {
if (typeof payload === 'object') {
resolve(payload);
}
});
Expand Down

0 comments on commit e6cb089

Please sign in to comment.