mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 05:24:29 +00:00
Mock state ON when moveToLevelWithOnOff succeeds. https://github.com/Koenkk/zigbee-shepherd-converters/pull/81
This commit is contained in:
+3
-3
@@ -550,10 +550,10 @@ class Controller {
|
||||
|
||||
const callback = (error) => {
|
||||
// Devices do not report when they go off, this ensures state (on/off) is always in sync.
|
||||
if (!error && key.startsWith('state')) {
|
||||
if (!error && (key.startsWith('state') || key === 'brightness')) {
|
||||
const msg = {};
|
||||
const _key = topicPrefix ? `${key}_${topicPrefix}` : key;
|
||||
msg[_key] = json[key];
|
||||
const _key = topicPrefix ? `state_${topicPrefix}` : 'state';
|
||||
msg[_key] = key === 'brightness' ? 'ON' : json['state'];
|
||||
this.mqttPublishDeviceState(device, msg, true);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user