matterbridge-example-accessory-platform 1.1.4 → 1.1.5-dev.3
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 +12 -0
- package/dist/platform.js +5 -7
- package/npm-shrinkwrap.json +35 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
If you like this project and find it useful, please consider giving it a star on GitHub at https://github.com/Luligu/matterbridge-example-dynamic-platform and sponsoring it.
|
|
6
6
|
|
|
7
|
+
## [1.1.5] - 2025-02-01
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- [package]: Updated package.
|
|
12
|
+
- [package]: Updated dependencies.
|
|
13
|
+
- [package]: Require matterbridge 2.1.0.
|
|
14
|
+
|
|
15
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
16
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
17
|
+
</a>
|
|
18
|
+
|
|
7
19
|
## [1.1.4] - 2025-01-21
|
|
8
20
|
|
|
9
21
|
### Changed
|
package/dist/platform.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { MatterbridgeAccessoryPlatform,
|
|
1
|
+
import { MatterbridgeAccessoryPlatform, powerSource, MatterbridgeEndpoint, coverDevice } from 'matterbridge';
|
|
2
2
|
import { isValidNumber } from 'matterbridge/utils';
|
|
3
|
+
import { WindowCovering } from 'matterbridge/matter/clusters';
|
|
3
4
|
export class ExampleMatterbridgeAccessoryPlatform extends MatterbridgeAccessoryPlatform {
|
|
4
5
|
cover;
|
|
5
6
|
coverInterval;
|
|
6
7
|
constructor(matterbridge, log, config) {
|
|
7
8
|
super(matterbridge, log, config);
|
|
8
|
-
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('2.
|
|
9
|
-
throw new Error(`This plugin requires Matterbridge version >= "2.
|
|
9
|
+
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('2.1.0')) {
|
|
10
|
+
throw new Error(`This plugin requires Matterbridge version >= "2.1.0". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`);
|
|
10
11
|
}
|
|
11
12
|
this.log.info('Initializing platform:', this.config.name);
|
|
12
13
|
}
|
|
@@ -19,9 +20,6 @@ export class ExampleMatterbridgeAccessoryPlatform extends MatterbridgeAccessoryP
|
|
|
19
20
|
this.cover.createDefaultWindowCoveringClusterServer(10000);
|
|
20
21
|
this.cover.createDefaultPowerSourceWiredClusterServer();
|
|
21
22
|
await this.registerDevice(this.cover);
|
|
22
|
-
this.cover.subscribeAttribute(WindowCoveringCluster.id, 'mode', (newValue, oldValue) => {
|
|
23
|
-
this.cover?.log.info(`Attribute mode changed from ${oldValue} to ${newValue}. Reverse: ${newValue.motorDirectionReversed}. Calibration: ${newValue.calibrationMode}. Maintenance: ${newValue.maintenanceMode}. LED: ${newValue.ledFeedback}`);
|
|
24
|
-
}, this.log);
|
|
25
23
|
this.cover.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
|
|
26
24
|
this.cover?.log.info(`Command identify called identifyTime: ${identifyTime}`);
|
|
27
25
|
});
|
|
@@ -50,7 +48,7 @@ export class ExampleMatterbridgeAccessoryPlatform extends MatterbridgeAccessoryP
|
|
|
50
48
|
this.coverInterval = setInterval(async () => {
|
|
51
49
|
if (!this.cover)
|
|
52
50
|
return;
|
|
53
|
-
let position = this.cover.getAttribute(
|
|
51
|
+
let position = this.cover.getAttribute(WindowCovering.Cluster.id, 'currentPositionLiftPercent100ths', this.log);
|
|
54
52
|
if (!isValidNumber(position, 0, 10000))
|
|
55
53
|
return;
|
|
56
54
|
position = position + 1000;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-accessory-platform",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-dev.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-accessory-platform",
|
|
9
|
-
"version": "1.1.
|
|
9
|
+
"version": "1.1.5-dev.3",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.0.0",
|
|
@@ -34,10 +34,13 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"node_modules/node-persist": {
|
|
37
|
-
"version": "4.0.
|
|
38
|
-
"resolved": "https://registry.npmjs.org/node-persist/-/node-persist-4.0.
|
|
39
|
-
"integrity": "sha512-
|
|
37
|
+
"version": "4.0.4",
|
|
38
|
+
"resolved": "https://registry.npmjs.org/node-persist/-/node-persist-4.0.4.tgz",
|
|
39
|
+
"integrity": "sha512-8sPAz/7tw1mCCc8xBG4f0wi+flHkSSgQeX998iQ75Pu27evA6UUWCjSE7xnrYTg2q33oU5leJ061EKPDv6BocQ==",
|
|
40
40
|
"license": "MIT",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"p-limit": "^3.1.0"
|
|
43
|
+
},
|
|
41
44
|
"engines": {
|
|
42
45
|
"node": ">=10.12.0"
|
|
43
46
|
}
|
|
@@ -57,6 +60,33 @@
|
|
|
57
60
|
"type": "buymeacoffee",
|
|
58
61
|
"url": "https://www.buymeacoffee.com/luligugithub"
|
|
59
62
|
}
|
|
63
|
+
},
|
|
64
|
+
"node_modules/p-limit": {
|
|
65
|
+
"version": "3.1.0",
|
|
66
|
+
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
|
67
|
+
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"yocto-queue": "^0.1.0"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=10"
|
|
74
|
+
},
|
|
75
|
+
"funding": {
|
|
76
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"node_modules/yocto-queue": {
|
|
80
|
+
"version": "0.1.0",
|
|
81
|
+
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
|
82
|
+
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
|
|
83
|
+
"license": "MIT",
|
|
84
|
+
"engines": {
|
|
85
|
+
"node": ">=10"
|
|
86
|
+
},
|
|
87
|
+
"funding": {
|
|
88
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
89
|
+
}
|
|
60
90
|
}
|
|
61
91
|
}
|
|
62
92
|
}
|