mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-24 06:42:26 +00:00
Fix report on/off for devices with multiple states (e.g. state_left/state_right). #117
This commit is contained in:
1 parent
95db22e12b
commit
0d6c001f2c
1 file changed
+2
-1
+2
-1
@@ -461,7 +461,8 @@ class Controller {
|
||||
// Devices do not report when they go off, this ensures state (on/off) is always in sync.
|
||||
if (!error && key.startsWith('state')) {
|
||||
const msg = {};
|
||||
msg[key] = json[key];
|
||||
const _key = topicPrefix ? `${key}_${topicPrefix}` : key;
|
||||
msg[_key] = json[key];
|
||||
this.mqttPublishDeviceState(deviceID, msg, true);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user