diff --git a/CHANGELOG.md b/CHANGELOG.md index c78ede6..2ddc939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. + + + Buy me a coffee + + ## [2.1.12] - 2024-08-21 ### Changed diff --git a/package-lock.json b/package-lock.json index 88bb17b..87550fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,25 @@ { "name": "matterbridge-zigbee2mqtt", - "version": "2.1.12", + "version": "2.1.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "matterbridge-zigbee2mqtt", - "version": "2.1.12", + "version": "2.1.13", "hasInstallScript": true, "license": "Apache-2.0", "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", @@ -1602,9 +1602,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.4.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.4.2.tgz", - "integrity": "sha512-nAvM3Ey230/XzxtyDcJ+VjvlzpzoHwLsF7JaDRfoI0ytO0mVheerNmM45CtA0yOILXwXXxOrcUWH3wltX+7PSw==", + "version": "22.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.0.tgz", + "integrity": "sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==", "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -3538,9 +3538,9 @@ "license": "MIT" }, "node_modules/is-core-module": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", - "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4690,12 +4690,12 @@ "license": "MIT" }, "node_modules/node-ansi-logger": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/node-ansi-logger/-/node-ansi-logger-2.0.8.tgz", - "integrity": "sha512-WyidsHEimexsok9cN4UWqgHyhTxQUf6Agzepd1cNonN1TWImeoU5RfoNFMyrnMhHMVIPtRl8PGyvjpbPTpFfFw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/node-ansi-logger/-/node-ansi-logger-3.0.0.tgz", + "integrity": "sha512-OkXtONak4f+mH1ECBP7xoM2sD4ZiFKyKVb/QrMCMwX8k/W8ZuDA0WgskD9PJMZqgaUF1wUQA39yVdpGH/xUsuw==", "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": "18.x || 20.x || 22.x" }, "funding": { "type": "buymeacoffee", diff --git a/package.json b/package.json index c278184..97b32e3 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/src/entity.ts b/src/entity.ts index 6e619e1..20edb6d 100644 --- a/src/entity.ts +++ b/src/entity.ts @@ -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) => { diff --git a/src/platform.ts b/src/platform.ts index 0f062c7..65086a3 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -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; @@ -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')); diff --git a/src/zigbee2mqtt.ts b/src/zigbee2mqtt.ts index 95ba2b8..a4b06c9 100644 --- a/src/zigbee2mqtt.ts +++ b/src/zigbee2mqtt.ts @@ -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. * @@ -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; @@ -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 {