Skip to content

Commit

Permalink
Merge pull request #62 from Luligu/dev
Browse files Browse the repository at this point in the history
Release 2.1.13
  • Loading branch information
Luligu authored Aug 22, 2024
2 parents 8ae43e4 + ef434f1 commit 8d22ef7
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 24 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ If you like this project and find it useful, please consider giving it a star on

All notable changes to this project will be documented in this file.

## [2.1.13] - 2024-08-22

### Changed

- [package]: Updated dependencies.

### Fixed

- [package]: Fixed MQTT protocol.

<a href="https://www.buymeacoffee.com/luligugithub">
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
</a>

## [2.1.12] - 2024-08-21

### Changed
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions 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 Expand Up @@ -87,14 +87,14 @@
"dependencies": {
"moment": "2.30.1",
"mqtt": "5.10.0",
"node-ansi-logger": "2.0.8",
"node-ansi-logger": "3.0.0",
"node-persist-manager": "1.0.8"
},
"devDependencies": {
"@eslint/js": "9.9.0",
"@types/eslint__js": "8.42.3",
"@types/jest": "29.5.12",
"@types/node": "22.4.2",
"@types/node": "22.5.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jest": "28.8.0",
"eslint-plugin-prettier": "5.2.1",
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 8d22ef7

Please sign in to comment.