This commit is contained in:
Koen Kanters
2018-12-03 17:48:21 +01:00
parent 0786f22ce6
commit bede1032e6
+16
View File
@@ -150,6 +150,22 @@ class DevicePublish {
}
);
});
// When there is a transition in the message the state of the device gets out of sync.
// Therefore; at the end of the transition, read the new state from the device.
if (topic.type === 'set' && converted.zclData.transtime) {
const time = converted.zclData.transtime * 100;
const getConverted = converter.convert(json[key], json, 'get');
setTimeout(() => {
// Add job to queue
this.queue.push((queueCallback) => {
this.zigbee.publish(
ieeeAddr, getConverted.cid, getConverted.cmd, getConverted.cmdType,
getConverted.zclData, getConverted.cfg, endpoint, () => queueCallback()
);
});
}, time);
}
});
return true;