mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-29 07:08:56 +00:00
Only mock state after set. #518
This commit is contained in:
@@ -107,7 +107,7 @@ class DevicePublish {
|
||||
endpoint,
|
||||
(error, rsp) => {
|
||||
// Devices do not report when they go off, this ensures state (on/off) is always in sync.
|
||||
if (!error && (key.startsWith('state') || key === 'brightness')) {
|
||||
if (type === 'set' && !error && (key.startsWith('state') || key === 'brightness')) {
|
||||
const msg = {};
|
||||
const _key = prefix ? `state_${prefix}` : 'state';
|
||||
msg[_key] = key === 'brightness' ? 'ON' : json['state'];
|
||||
|
||||
Reference in New Issue
Block a user