mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-27 21:20:03 +00:00
Fix groups log messages. https://github.com/Koenkk/zigbee2mqtt/issues/1848
This commit is contained in:
+11
-4
@@ -137,7 +137,6 @@ class Groups {
|
||||
|
||||
updateDeviceGroup(ID, cmd, groupID) {
|
||||
let payload = null;
|
||||
const orignalCmd = cmd;
|
||||
if (cmd === 'add') {
|
||||
payload = {groupid: groupID, groupname: ''};
|
||||
cmd = 'add';
|
||||
@@ -159,10 +158,18 @@ class Groups {
|
||||
logger.info(`Successfully ${cmd} ${ieeeAddr} to ${groupID}`);
|
||||
|
||||
// Log to MQTT
|
||||
const lookup = {
|
||||
'add': 'device_group_add',
|
||||
'remove': 'device_group_remove',
|
||||
'removeAll': 'device_group_remove_all',
|
||||
};
|
||||
|
||||
this.mqtt.log({
|
||||
device: settings.getDevice(ieeeAddr).friendly_name,
|
||||
group: groupID,
|
||||
action: orignalCmd,
|
||||
type: lookup[cmd],
|
||||
message: {
|
||||
device: settings.getDevice(ieeeAddr).friendly_name,
|
||||
group: groupID,
|
||||
},
|
||||
});
|
||||
|
||||
// Update group cache
|
||||
|
||||
Reference in New Issue
Block a user