From 3776655fccbc5f1368dac42af79f74615f762793 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Fri, 28 Jul 2023 08:32:33 +0200 Subject: [PATCH] Update main.js --- main.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main.js b/main.js index 24fc8ee0..0bc0d431 100644 --- a/main.js +++ b/main.js @@ -534,15 +534,17 @@ class Zigbee extends utils.Adapter { this.publishToState(devId, model, payload); } }; + + this.stController.collectOptions(devId, model, (options) => { + const converted = converter.convert(mappedModel, message, publish, options, meta); + if (converted) { + payload = {...payload, ...converted}; + } - const converted = converter.convert(mappedModel, message, publish, mappedModel.options, meta); - if (converted) { - payload = {...payload, ...converted}; - } - - if (Object.keys(payload).length) { - publish(payload); - } + if (Object.keys(payload).length) { + publish(payload); + } + }); } }