From 86a102e08110ccdda4f23f392e9ae144238acd80 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 6 Nov 2018 21:20:03 +0100 Subject: [PATCH] Only mock state after set. #518 --- lib/extension/devicePublish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/extension/devicePublish.js b/lib/extension/devicePublish.js index 8963ec569..320c0e279 100644 --- a/lib/extension/devicePublish.js +++ b/lib/extension/devicePublish.js @@ -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'];