Skip to content

Commit

Permalink
Release 2.1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Aug 21, 2024
1 parent 1680837 commit c20ec34
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matterbridge-zigbee2mqtt",
"version": "2.1.12",
"version": "2.1.13",
"description": "Matterbridge zigbee2mqtt plugin",
"author": "https://github.com/Luligu",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ZigbeeEntity extends EventEmitter {
this.en = gn;
this.ien = ign;
}
this.log = new AnsiLogger({ logName: this.entityName, logTimestampFormat: TimestampFormat.TIME_MILLIS, logDebug: platform.debugEnabled });
this.log = new AnsiLogger({ logName: this.entityName, logTimestampFormat: TimestampFormat.TIME_MILLIS, logLevel: platform.debugEnabled ? LogLevel.DEBUG : LogLevel.INFO });
this.log.debug(`Created MatterEntity: ${this.entityName}`);

this.platform.z2m.on('MESSAGE-' + this.entityName, (payload: Payload) => {
Expand Down
4 changes: 2 additions & 2 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
config.blackList = this.blackList;

if (config.type === 'MatterbridgeExtension') {
this.z2m = new Zigbee2MQTT(this.mqttHost, this.mqttPort, this.mqttTopic, this.mqttUsername, this.mqttPassword, this.mqttProtocol);
this.z2m = new Zigbee2MQTT(this.mqttHost, this.mqttPort, this.mqttTopic, this.mqttUsername, this.mqttPassword, this.mqttProtocol, this.debugEnabled);
this.z2m.setLogDebug(this.debugEnabled);
this.log.debug('Created ZigbeePlatform as Matterbridge extension');
return;
Expand All @@ -114,7 +114,7 @@ export class ZigbeePlatform extends MatterbridgeDynamicPlatform {
this.log.info(`Loaded zigbee2mqtt parameters from ${path.join(matterbridge.matterbridgeDirectory, 'matterbridge-zigbee2mqtt.config.json')}${rs}:`);
// this.log.debug(`Config:')}${rs}`, config);

this.z2m = new Zigbee2MQTT(this.mqttHost, this.mqttPort, this.mqttTopic, this.mqttUsername, this.mqttPassword);
this.z2m = new Zigbee2MQTT(this.mqttHost, this.mqttPort, this.mqttTopic, this.mqttUsername, this.mqttPassword, this.mqttProtocol, this.debugEnabled);
this.z2m.setLogDebug(this.debugEnabled);
this.z2m.setDataPath(path.join(matterbridge.matterbridgePluginDirectory, 'matterbridge-zigbee2mqtt'));

Expand Down
8 changes: 4 additions & 4 deletions 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.3.1
* @version 2.3.2
*
* Copyright 2023, 2024, 2025 Luca Liguori.
*
Expand Down Expand Up @@ -272,7 +272,7 @@ export class Zigbee2MQTT extends EventEmitter {
};

// Constructor
constructor(mqttHost: string, mqttPort: number, mqttTopic: string, mqttUsername = '', mqttPassword = '', protocolVersion: 4 | 5 | 3 = 5) {
constructor(mqttHost: string, mqttPort: number, mqttTopic: string, mqttUsername = '', mqttPassword = '', protocolVersion: 4 | 5 | 3 = 5, debug = false) {
super();

this.mqttHost = mqttHost;
Expand All @@ -295,8 +295,8 @@ export class Zigbee2MQTT extends EventEmitter {
this.z2mDevices = [];
this.z2mGroups = [];

this.log = new AnsiLogger({ logName: 'Zigbee2MQTT', logTimestampFormat: TimestampFormat.TIME_MILLIS });
this.log.debug(`Created new instance with host: ${mqttHost} port: ${mqttPort} topic: ${mqttTopic} username: ${mqttUsername} password: ${mqttPassword !== '' ? '*****' : ''}`);
this.log = new AnsiLogger({ logName: 'Zigbee2MQTT', logTimestampFormat: TimestampFormat.TIME_MILLIS, logLevel: debug ? LogLevel.DEBUG : LogLevel.INFO });
this.log.debug(`Created new instance with host: ${mqttHost} port: ${mqttPort} protocol ${protocolVersion} topic: ${mqttTopic} username: ${mqttUsername} password: ${mqttPassword !== '' ? '*****' : ''}`);
}

public setLogDebug(logDebug: boolean): void {
Expand Down

0 comments on commit c20ec34

Please sign in to comment.