mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-03 10:31:37 +00:00
Refresh state after transition. https://github.com/Koenkk/zigbee-shepherd-converters/issues/155
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user