Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
arteck authored Jul 31, 2023
1 parent 3e97661 commit 3d9bd52
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class Zigbee extends utils.Adapter {

if (!converters.length) {
if (type !== 'readResponse') {
this.log.debug(`No converter available for '${mappedModel.model}' '${devId}' with cluster '${cluster}' and type '${type}'`
this.log.debug(`No converter available for '${mappedModel.model}' '${devId}' with cluster '${cluster}' and type '${type}'`;
);
}
return;
Expand All @@ -552,16 +552,20 @@ class Zigbee extends utils.Adapter {
}
};

for (const converter of converters) {
this.stController.collectOptions(devId, model, (options) => {
payload = converter.convert(mappedModel, message, publish, options, meta);

if (payload) {
if (Object.keys(payload).length) {
publish(payload);
try {
for (const converter of converters) {
this.stController.collectOptions(devId, model, (options) => {
payload = converter.convert(mappedModel, message, publish, options, meta);

if (payload) {
if (Object.keys(payload).length) {
publish(payload);
}
}
}
});
});
}
} catch (err) {
this.log.error(`convert problem with '${model}' '${devId}' `;
}
}

Expand Down

0 comments on commit 3d9bd52

Please sign in to comment.