diff --git a/lib/extension/devicePublish.js b/lib/extension/devicePublish.js index c8c309a2..9aa21394 100644 --- a/lib/extension/devicePublish.js +++ b/lib/extension/devicePublish.js @@ -163,10 +163,10 @@ class DevicePublish { (error, rsp) => { // Devices do not report when they go off, this ensures state (on/off) is always in sync. if (entity.type === 'device' && topic.type === 'set' && - !error && (key.startsWith('state') || key === 'brightness')) { + !error && (key.startsWith('state') || key.startsWith('brightness'))) { const msg = {}; const _key = topic.postfix ? `state_${topic.postfix}` : 'state'; - msg[_key] = key === 'brightness' ? 'ON' : json['state']; + msg[_key] = key.startsWith('brightness') ? 'ON' : json['state']; this.publishDeviceState(device, msg, true); }