matterbridge-mqtt 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/README.md +9 -8
- package/dist/module.d.ts +9 -0
- package/dist/module.js +27 -0
- package/npm-shrinkwrap.json +93 -0
- package/package.json +14 -64
- package/CODEOWNERS +0 -1
- package/dist/index.d.ts +0 -37
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -37
- package/dist/index.js.map +0 -1
- package/dist/platform.d.ts +0 -37
- package/dist/platform.d.ts.map +0 -1
- package/dist/platform.js +0 -72
- package/dist/platform.js.map +0 -1
- package/link-matterbridge-script.js +0 -15
- package/matterbridge-mqtt/0d0a2ac6163e36f3f2349c77671004edfe3d5e1abbef93cbb583acec8d01481b +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="https://
|
|
1
|
+
# <img src="https://matterbridge.io/assets/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge mqtt plugin changelog
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
9
9
|
First published release.
|
|
10
10
|
|
|
11
11
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
12
|
-
<img src="
|
|
12
|
+
<img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120">
|
|
13
13
|
</a>
|
|
14
14
|
|
|
15
15
|
<!-- Commented out section
|
package/README.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
# <img src="https://
|
|
1
|
+
# <img src="https://matterbridge.io/assets/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge mqtt plugin
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge-mqtt)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge-mqtt)
|
|
5
|
-
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
6
|
+
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
7
|
+

|
|
8
|
+

|
|
8
9
|
|
|
9
|
-
[](https://www.npmjs.com/package/matterbridge)
|
|
11
|
+
[](https://www.npmjs.com/package/matter-history)
|
|
12
|
+
[](https://www.npmjs.com/package/node-ansi-logger)
|
|
13
|
+
[](https://www.npmjs.com/package/node-persist-manager)
|
|
13
14
|
|
|
14
15
|
---
|
|
15
16
|
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MatterbridgeDynamicPlatform, PlatformConfig, PlatformMatterbridge } from 'matterbridge';
|
|
2
|
+
import { AnsiLogger } from 'matterbridge/logger';
|
|
3
|
+
export default function initializePlugin(matterbridge: PlatformMatterbridge, log: AnsiLogger, config: PlatformConfig): Platform;
|
|
4
|
+
export declare class Platform extends MatterbridgeDynamicPlatform {
|
|
5
|
+
constructor(matterbridge: PlatformMatterbridge, log: AnsiLogger, config: PlatformConfig);
|
|
6
|
+
onStart(reason?: string): Promise<void>;
|
|
7
|
+
onConfigure(): Promise<void>;
|
|
8
|
+
onShutdown(reason?: string): Promise<void>;
|
|
9
|
+
}
|
package/dist/module.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MatterbridgeDynamicPlatform } from 'matterbridge';
|
|
2
|
+
export default function initializePlugin(matterbridge, log, config) {
|
|
3
|
+
return new Platform(matterbridge, log, config);
|
|
4
|
+
}
|
|
5
|
+
export class Platform extends MatterbridgeDynamicPlatform {
|
|
6
|
+
constructor(matterbridge, log, config) {
|
|
7
|
+
super(matterbridge, log, config);
|
|
8
|
+
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.5.0')) {
|
|
9
|
+
throw new Error(`This plugin requires Matterbridge version >= "3.5.0". Please update Matterbridge to the latest version in the frontend.`);
|
|
10
|
+
}
|
|
11
|
+
this.log.info('Initializing platform:', this.config.name);
|
|
12
|
+
this.log.info('Finished initializing platform:', this.config.name);
|
|
13
|
+
}
|
|
14
|
+
async onStart(reason) {
|
|
15
|
+
this.log.info('onStart called with reason:', reason ?? 'none');
|
|
16
|
+
}
|
|
17
|
+
async onConfigure() {
|
|
18
|
+
await super.onConfigure();
|
|
19
|
+
this.log.info('onConfigure called');
|
|
20
|
+
}
|
|
21
|
+
async onShutdown(reason) {
|
|
22
|
+
await super.onShutdown(reason);
|
|
23
|
+
this.log.info('onShutdown called with reason:', reason ?? 'none');
|
|
24
|
+
if (this.config.unregisterOnShutdown === true)
|
|
25
|
+
await this.unregisterAllDevices();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "matterbridge-mqtt",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "matterbridge-mqtt",
|
|
9
|
+
"version": "0.0.2",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"node-ansi-logger": "3.1.1",
|
|
13
|
+
"node-persist-manager": "2.0.0"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
17
|
+
},
|
|
18
|
+
"funding": {
|
|
19
|
+
"type": "buymeacoffee",
|
|
20
|
+
"url": "https://www.buymeacoffee.com/luligugithub"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"node_modules/node-ansi-logger": {
|
|
24
|
+
"version": "3.1.1",
|
|
25
|
+
"resolved": "https://registry.npmjs.org/node-ansi-logger/-/node-ansi-logger-3.1.1.tgz",
|
|
26
|
+
"integrity": "sha512-tFeCSxwiRg5XaNda5nC27alzraZP76nLtUk1JDZqb9byhW4WYaSGL7/lmxFHEI16gypQDMEYljuF+wcG+cPPHw==",
|
|
27
|
+
"hasShrinkwrap": true,
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
31
|
+
},
|
|
32
|
+
"funding": {
|
|
33
|
+
"type": "buymeacoffee",
|
|
34
|
+
"url": "https://www.buymeacoffee.com/luligugithub"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"node_modules/node-persist": {
|
|
38
|
+
"version": "4.0.4",
|
|
39
|
+
"resolved": "https://registry.npmjs.org/node-persist/-/node-persist-4.0.4.tgz",
|
|
40
|
+
"integrity": "sha512-8sPAz/7tw1mCCc8xBG4f0wi+flHkSSgQeX998iQ75Pu27evA6UUWCjSE7xnrYTg2q33oU5leJ061EKPDv6BocQ==",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"p-limit": "^3.1.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=10.12.0"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"node_modules/node-persist-manager": {
|
|
50
|
+
"version": "2.0.0",
|
|
51
|
+
"resolved": "https://registry.npmjs.org/node-persist-manager/-/node-persist-manager-2.0.0.tgz",
|
|
52
|
+
"integrity": "sha512-jpgOqCCn4ZEnIr4WcvqkyyGmmLJarV6aUyBlDQdG1G84X9UUmOmI1W2OZtc9K0z375CYWhjtGEXaY7GXNiEOfA==",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"node-persist": "4.0.4"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
59
|
+
},
|
|
60
|
+
"funding": {
|
|
61
|
+
"type": "buymeacoffee",
|
|
62
|
+
"url": "https://www.buymeacoffee.com/luligugithub"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"node_modules/p-limit": {
|
|
66
|
+
"version": "3.1.0",
|
|
67
|
+
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
|
68
|
+
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
|
|
69
|
+
"license": "MIT",
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"yocto-queue": "^0.1.0"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=10"
|
|
75
|
+
},
|
|
76
|
+
"funding": {
|
|
77
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"node_modules/yocto-queue": {
|
|
81
|
+
"version": "0.1.0",
|
|
82
|
+
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
|
83
|
+
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
|
|
84
|
+
"license": "MIT",
|
|
85
|
+
"engines": {
|
|
86
|
+
"node": ">=10"
|
|
87
|
+
},
|
|
88
|
+
"funding": {
|
|
89
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-mqtt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Matterbridge mqtt plugin",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "dist/
|
|
9
|
-
"types": "dist/
|
|
8
|
+
"main": "dist/module.js",
|
|
9
|
+
"types": "dist/module.d.ts",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/Luligu/matterbridge-mqtt.git"
|
|
@@ -43,68 +43,18 @@
|
|
|
43
43
|
"ewelink"
|
|
44
44
|
],
|
|
45
45
|
"engines": {
|
|
46
|
-
"node": ">=
|
|
47
|
-
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"build": "tsc",
|
|
50
|
-
"watch": "tsc --watch",
|
|
51
|
-
"start": "matterbridge",
|
|
52
|
-
"start:bridge": "matterbridge -bridge",
|
|
53
|
-
"start:childbridge": "matterbridge -childbridge",
|
|
54
|
-
"test": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
55
|
-
"test:verbose": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js --verbose",
|
|
56
|
-
"test:watch": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
|
|
57
|
-
"test:coverage": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
|
|
58
|
-
"test:platform": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js index.test.ts platform.test.ts --coverage",
|
|
59
|
-
"lint": "eslint --max-warnings=0 .",
|
|
60
|
-
"lint:fix": "eslint --fix --max-warnings=0 .",
|
|
61
|
-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
62
|
-
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
63
|
-
"clean": "rimraf tsconfig.tsbuildinfo ./dist",
|
|
64
|
-
"cleanBuild": "npm run clean && tsc",
|
|
65
|
-
"deepClean": "rimraf tsconfig.tsbuildinfo package-lock.json ./dist ./node_modules",
|
|
66
|
-
"deepCleanRebuild": "npm run deepClean && npm install && npm run build",
|
|
67
|
-
"prepublishOnly": "npm run lint && npm run cleanBuild",
|
|
68
|
-
"checkDependencies": "npx npm-check-updates",
|
|
69
|
-
"updateDependencies": "npx npm-check-updates -u && npm install & npm run cleanBuild",
|
|
70
|
-
"preversion": "npm run build && npm run lint",
|
|
71
|
-
"postversion": "git push && git push --tags",
|
|
72
|
-
"version:patch": "npm version patch",
|
|
73
|
-
"version:minor": "npm version minor",
|
|
74
|
-
"version:major": "npm version major",
|
|
75
|
-
"matterbridge:add": "matterbridge -add .\\",
|
|
76
|
-
"matterbridge:remove": "matterbridge -remove .\\",
|
|
77
|
-
"matterbridge:enable": "matterbridge -enable .\\",
|
|
78
|
-
"matterbridge:disable": "matterbridge -disable .\\",
|
|
79
|
-
"matterbridge:list": "matterbridge -list",
|
|
80
|
-
"dev:link": "npm link --save-dev matterbridge",
|
|
81
|
-
"dev:install": "npm install --save-dev matterbridge",
|
|
82
|
-
"dev:uninstall": "npm uninstall matterbridge && npm unlink matterbridge",
|
|
83
|
-
"install": "node link-matterbridge-script.js",
|
|
84
|
-
"install:dependencies": "npm install node-ansi-logger node-persist-manager && npm install --save-dev rimraf",
|
|
85
|
-
"install:typescript": "npm install --save-dev typescript @types/node && npm run install && npm run build",
|
|
86
|
-
"install:eslint": "npm install --save-dev eslint @eslint/js @types/eslint__js typescript typescript-eslint",
|
|
87
|
-
"install:prettier": "npm install --save-dev prettier eslint-config-prettier eslint-plugin-prettier",
|
|
88
|
-
"install:jest": "npm install --save-dev jest ts-jest @types/jest eslint-plugin-jest"
|
|
46
|
+
"node": ">=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0"
|
|
89
47
|
},
|
|
48
|
+
"files": [
|
|
49
|
+
"bin",
|
|
50
|
+
"dist",
|
|
51
|
+
"npm-shrinkwrap.json",
|
|
52
|
+
"CHANGELOG.md",
|
|
53
|
+
"*.config.json",
|
|
54
|
+
"*.schema.json"
|
|
55
|
+
],
|
|
90
56
|
"dependencies": {
|
|
91
|
-
"node-ansi-logger": "
|
|
92
|
-
"node-persist-manager": "
|
|
93
|
-
},
|
|
94
|
-
"devDependencies": {
|
|
95
|
-
"@eslint/js": "^9.9.1",
|
|
96
|
-
"@types/eslint__js": "^8.42.3",
|
|
97
|
-
"@types/jest": "^29.5.12",
|
|
98
|
-
"@types/node": "^22.5.1",
|
|
99
|
-
"eslint": "^9.9.1",
|
|
100
|
-
"eslint-config-prettier": "^9.1.0",
|
|
101
|
-
"eslint-plugin-jest": "^28.8.0",
|
|
102
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
103
|
-
"jest": "^29.7.0",
|
|
104
|
-
"prettier": "^3.3.3",
|
|
105
|
-
"rimraf": "^6.0.1",
|
|
106
|
-
"ts-jest": "^29.2.5",
|
|
107
|
-
"typescript": "^5.5.4",
|
|
108
|
-
"typescript-eslint": "^8.3.0"
|
|
57
|
+
"node-ansi-logger": "3.1.1",
|
|
58
|
+
"node-persist-manager": "2.0.0"
|
|
109
59
|
}
|
|
110
60
|
}
|
package/CODEOWNERS
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@Luligu
|
package/dist/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the main entryPoint for the plugin.
|
|
3
|
-
*
|
|
4
|
-
* @file src\index.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2024-08-28
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
|
-
import { Matterbridge, PlatformConfig } from 'matterbridge';
|
|
24
|
-
import { AnsiLogger } from 'matterbridge/logger';
|
|
25
|
-
import { MqttPlatform } from './platform.js';
|
|
26
|
-
/**
|
|
27
|
-
* This is the standard interface for Matterbridge plugins.
|
|
28
|
-
* Each plugin should export a default function that follows this signature.
|
|
29
|
-
*
|
|
30
|
-
* @param {Matterbridge} matterbridge - An instance of MatterBridge. This is the main interface for interacting with the MatterBridge system.
|
|
31
|
-
* @param {AnsiLogger} log - An instance of AnsiLogger. This is used for logging messages in a format that can be displayed with ANSI color codes.
|
|
32
|
-
* @param {PlatformConfig} config - The platform configuration.
|
|
33
|
-
* @returns {ShellyPlatform} - An instance of the ShellyPlatform. This is the main interface for interacting with the Shellies.
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
export default function initializePlugin(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig): MqttPlatform;
|
|
37
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;;;GASG;AAEH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,YAAY,CAE1H"}
|
package/dist/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the main entryPoint for the plugin.
|
|
3
|
-
*
|
|
4
|
-
* @file src\index.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2024-08-28
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
|
-
import { MqttPlatform } from './platform.js';
|
|
24
|
-
/**
|
|
25
|
-
* This is the standard interface for Matterbridge plugins.
|
|
26
|
-
* Each plugin should export a default function that follows this signature.
|
|
27
|
-
*
|
|
28
|
-
* @param {Matterbridge} matterbridge - An instance of MatterBridge. This is the main interface for interacting with the MatterBridge system.
|
|
29
|
-
* @param {AnsiLogger} log - An instance of AnsiLogger. This is used for logging messages in a format that can be displayed with ANSI color codes.
|
|
30
|
-
* @param {PlatformConfig} config - The platform configuration.
|
|
31
|
-
* @returns {ShellyPlatform} - An instance of the ShellyPlatform. This is the main interface for interacting with the Shellies.
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export default function initializePlugin(matterbridge, log, config) {
|
|
35
|
-
return new MqttPlatform(matterbridge, log, config);
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;;;GASG;AAEH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAA0B,EAAE,GAAe,EAAE,MAAsB;IAC1G,OAAO,IAAI,YAAY,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC"}
|
package/dist/platform.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class ShellyPlatform.
|
|
3
|
-
*
|
|
4
|
-
* @file src\platform.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2024-08-28
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
|
-
import { Matterbridge, MatterbridgeDynamicPlatform, PlatformConfig } from 'matterbridge';
|
|
24
|
-
import { AnsiLogger, LogLevel } from 'matterbridge/logger';
|
|
25
|
-
export declare class MqttPlatform extends MatterbridgeDynamicPlatform {
|
|
26
|
-
private nodeStorageManager?;
|
|
27
|
-
private nodeStorage?;
|
|
28
|
-
private whiteList;
|
|
29
|
-
private blackList;
|
|
30
|
-
constructor(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig);
|
|
31
|
-
onStart(reason?: string): Promise<void>;
|
|
32
|
-
onConfigure(): Promise<void>;
|
|
33
|
-
onChangeLoggerLevel(logLevel: LogLevel): Promise<void>;
|
|
34
|
-
onShutdown(reason?: string): Promise<void>;
|
|
35
|
-
private validateWhiteBlackList;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=platform.d.ts.map
|
package/dist/platform.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAuB,MAAM,qBAAqB,CAAC;AAKhF,qBAAa,YAAa,SAAQ,2BAA2B;IAE3D,OAAO,CAAC,kBAAkB,CAAC,CAAqB;IAChD,OAAO,CAAC,WAAW,CAAC,CAAc;IAGlC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,SAAS,CAAgB;gBAErB,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc;IAIhE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM;IAcvB,WAAW;IAIX,mBAAmB,CAAC,QAAQ,EAAE,QAAQ;IAItC,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM;IAMzC,OAAO,CAAC,sBAAsB;CAW/B"}
|
package/dist/platform.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class ShellyPlatform.
|
|
3
|
-
*
|
|
4
|
-
* @file src\platform.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2024-08-28
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
|
-
import { MatterbridgeDynamicPlatform } from 'matterbridge';
|
|
24
|
-
import { dn, idn, nf, rs, wr } from 'matterbridge/logger';
|
|
25
|
-
import { NodeStorageManager } from 'matterbridge/storage';
|
|
26
|
-
import path from 'path';
|
|
27
|
-
export class MqttPlatform extends MatterbridgeDynamicPlatform {
|
|
28
|
-
// NodeStorageManager
|
|
29
|
-
nodeStorageManager;
|
|
30
|
-
nodeStorage;
|
|
31
|
-
// Config
|
|
32
|
-
whiteList = [];
|
|
33
|
-
blackList = [];
|
|
34
|
-
constructor(matterbridge, log, config) {
|
|
35
|
-
super(matterbridge, log, config);
|
|
36
|
-
}
|
|
37
|
-
async onStart(reason) {
|
|
38
|
-
this.log.info(`Starting platform ${idn}${this.config.name}${rs}${nf}: ${reason ?? ''}`);
|
|
39
|
-
// create NodeStorageManager
|
|
40
|
-
this.nodeStorageManager = new NodeStorageManager({
|
|
41
|
-
dir: path.join(this.matterbridge.matterbridgeDirectory, 'matterbridge-mqtt'),
|
|
42
|
-
writeQueue: false,
|
|
43
|
-
expiredInterval: undefined,
|
|
44
|
-
logging: false,
|
|
45
|
-
forgiveParseErrors: true,
|
|
46
|
-
});
|
|
47
|
-
this.nodeStorage = await this.nodeStorageManager.createStorage('devices');
|
|
48
|
-
}
|
|
49
|
-
async onConfigure() {
|
|
50
|
-
this.log.info(`Configuring platform ${idn}${this.config.name}${rs}${nf}`);
|
|
51
|
-
}
|
|
52
|
-
async onChangeLoggerLevel(logLevel) {
|
|
53
|
-
this.log.info(`Logger level changed to ${logLevel}`);
|
|
54
|
-
}
|
|
55
|
-
async onShutdown(reason) {
|
|
56
|
-
this.log.info(`Shutting down platform ${idn}${this.config.name}${rs}${nf}: ${reason ?? ''}`);
|
|
57
|
-
if (this.config.unregisterOnShutdown === true)
|
|
58
|
-
await this.unregisterAllDevices();
|
|
59
|
-
}
|
|
60
|
-
validateWhiteBlackList(entityName) {
|
|
61
|
-
if (this.whiteList.length > 0 && !this.whiteList.find((name) => name === entityName)) {
|
|
62
|
-
this.log.warn(`Skipping ${dn}${entityName}${wr} because not in whitelist`);
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
if (this.blackList.length > 0 && this.blackList.find((name) => name === entityName)) {
|
|
66
|
-
this.log.warn(`Skipping ${dn}${entityName}${wr} because in blacklist`);
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=platform.js.map
|
package/dist/platform.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import { exec } from 'child_process';
|
|
3
|
-
|
|
4
|
-
const command = process.platform === 'win32' ? 'npm link matterbridge' : 'sudo npm link matterbridge';
|
|
5
|
-
|
|
6
|
-
exec(command, (error, stdout, stderr) => {
|
|
7
|
-
if (error) {
|
|
8
|
-
console.error(`exec error: ${error}`);
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
console.log(`stdout: ${stdout}`);
|
|
12
|
-
if (stderr) {
|
|
13
|
-
console.error(`stderr: ${stderr}`);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"key":"storageNames","value":["devices"]}
|