Skip to content

Commit

Permalink
Added info log when the plugin starts to register devices and groups.…
Browse files Browse the repository at this point in the history
… Added empty bridge/config and bridge/definitions handlers.
  • Loading branch information
Luligu committed Jun 20, 2024
1 parent 621aeec commit 16e545e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,23 +327,23 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
this.log.debug('Setting flag to start when zigbee2mqtt sends devices: ', reason);
}

// if (this.debugEnabled) Logger.defaultLogLevel = Level.INFO;

if (!this.z2mDevicesRegistered && this.z2mBridgeDevices) {
this.log.info(`Registering ${this.z2mBridgeDevices.length} devices`);
for (const device of this.z2mBridgeDevices) {
await this.registerZigbeeDevice(device);
}
this.z2mDevicesRegistered = true;
}

if (!this.z2mGroupsRegistered && this.z2mBridgeGroups) {
this.log.info(`Registering ${this.z2mBridgeGroups.length} groups`);
for (const group of this.z2mBridgeGroups) {
await this.registerZigbeeGroup(group);
}
this.z2mGroupsRegistered = true;
}

// if (this.debugEnabled) Logger.defaultLogLevel = Level.DEBUG;
this.log.info(`Started zigbee2mqtt dynamic platform v${this.version}: ` + reason);
}

override async onConfigure() {
Expand Down
8 changes: 7 additions & 1 deletion src/zigbee2mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @file zigbee2mqtt.ts
* @author Luca Liguori
* @date 2023-06-30
* @version 2.2.28
* @version 2.2.29
*
* Copyright 2023, 2024 Luca Liguori.
*
Expand Down Expand Up @@ -795,6 +795,12 @@ export class Zigbee2MQTT extends EventEmitter {
} else if (topic.startsWith(this.mqttTopic + '/bridge/logging')) {
// const data = JSON.parse(payload.toString());
// this.log.debug('classZigbee2MQTT=>Message bridge/logging', data);
} else if (topic.startsWith(this.mqttTopic + '/bridge/config')) {
// const data = JSON.parse(payload.toString());
// this.log.debug('classZigbee2MQTT=>Message bridge/config', data);
} else if (topic.startsWith(this.mqttTopic + '/bridge/definitions')) {
// const data = JSON.parse(payload.toString());
// this.log.debug('classZigbee2MQTT=>Message bridge/definitions', data);
} else {
let entity = topic.replace(this.mqttTopic + '/', '');
let service = '';
Expand Down

0 comments on commit 16e545e

Please sign in to comment.