mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 05:24:29 +00:00
Use device retain setting.
This commit is contained in:
+5
-1
@@ -130,7 +130,11 @@ 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 === 'state') {
|
||||
this.mqtt.publish(friendlyName, JSON.stringify({state: json[key]}), true);
|
||||
this.mqtt.publish(
|
||||
friendlyName,
|
||||
JSON.stringify({state: json[key]}),
|
||||
settings.get().devices[deviceID].retain,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user