matterbridge-test 1.0.6 → 1.0.7-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 +13 -12
- package/npm-shrinkwrap.json +2 -2
- 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.0.7] - 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.0.6] - 2025-01-21
|
|
8
20
|
|
|
9
21
|
### Changed
|
package/dist/platform.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MatterbridgeDynamicPlatform, bridgedNode, electricalSensor, onOffSwitch, onOffOutlet, colorTemperatureLight,
|
|
1
|
+
import { MatterbridgeDynamicPlatform, bridgedNode, electricalSensor, onOffSwitch, onOffOutlet, colorTemperatureLight, powerSource, modeSelect, MatterbridgeEndpoint, } from 'matterbridge';
|
|
2
2
|
import { waiter } from 'matterbridge/utils';
|
|
3
|
+
import { OnOffCluster, ElectricalPowerMeasurementCluster, ElectricalEnergyMeasurementCluster, ModeSelectCluster, PowerSourceCluster } from 'matterbridge/matter/clusters';
|
|
3
4
|
export class TestPlatform extends MatterbridgeDynamicPlatform {
|
|
4
5
|
noDevices = false;
|
|
5
6
|
delayStart = false;
|
|
@@ -18,8 +19,8 @@ export class TestPlatform extends MatterbridgeDynamicPlatform {
|
|
|
18
19
|
bridgedDevices = new Map();
|
|
19
20
|
constructor(matterbridge, log, config) {
|
|
20
21
|
super(matterbridge, log, config);
|
|
21
|
-
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('2.
|
|
22
|
-
throw new Error(`The test plugin requires Matterbridge version >= "2.
|
|
22
|
+
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('2.1.0')) {
|
|
23
|
+
throw new Error(`The test plugin requires Matterbridge version >= "2.1.0". Please update Matterbridge to the latest version in the frontend.`);
|
|
23
24
|
}
|
|
24
25
|
this.log.info('Initializing platform:', this.config.name);
|
|
25
26
|
this.log.debug('- with matterbridge version ', matterbridge.matterbridgeVersion);
|
|
@@ -104,7 +105,7 @@ export class TestPlatform extends MatterbridgeDynamicPlatform {
|
|
|
104
105
|
this.log.info(`Received changeToMode command with request ${data.request.newMode} for endpoint ${data.endpoint?.number}`);
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
switchDevice.addRequiredClusterServers(
|
|
108
|
+
switchDevice.addRequiredClusterServers();
|
|
108
109
|
if (this.noDevices === false)
|
|
109
110
|
await this.registerDevice(switchDevice);
|
|
110
111
|
this.bridgedDevices.set('Switch' + i, switchDevice);
|
|
@@ -138,7 +139,7 @@ export class TestPlatform extends MatterbridgeDynamicPlatform {
|
|
|
138
139
|
this.log.info(`Received command changeToMode with request ${data.request.newMode} for endpoint ${data.endpoint?.number}`);
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
|
-
outletDevice.addRequiredClusterServers(
|
|
142
|
+
outletDevice.addRequiredClusterServers();
|
|
142
143
|
if (this.noDevices === false)
|
|
143
144
|
await this.registerDevice(outletDevice);
|
|
144
145
|
this.bridgedDevices.set('Outlet' + i, outletDevice);
|
|
@@ -193,25 +194,25 @@ export class TestPlatform extends MatterbridgeDynamicPlatform {
|
|
|
193
194
|
this.log.info(`Received command changeToMode with request ${data.request.newMode} for endpoint ${data.endpoint?.number}`);
|
|
194
195
|
});
|
|
195
196
|
}
|
|
196
|
-
lightDevice.addRequiredClusterServers(
|
|
197
|
+
lightDevice.addRequiredClusterServers();
|
|
197
198
|
if (this.noDevices === false)
|
|
198
199
|
await this.registerDevice(lightDevice);
|
|
199
200
|
this.bridgedDevices.set('Light' + i, lightDevice);
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
addElectricalMeasurements(device) {
|
|
203
|
-
device.
|
|
204
|
-
device.
|
|
205
|
-
device.
|
|
204
|
+
device.createDefaultPowerTopologyClusterServer();
|
|
205
|
+
device.createDefaultElectricalPowerMeasurementClusterServer(220 * 1000, 2.5 * 1000, 220 * 2.5 * 1000, 50 * 1000);
|
|
206
|
+
device.createDefaultElectricalEnergyMeasurementClusterServer(1500 * 1000);
|
|
206
207
|
}
|
|
207
208
|
addModeSelect(device, description) {
|
|
208
|
-
device.
|
|
209
|
+
device.createDefaultModeSelectClusterServer(description + ' Led Mode Select', [
|
|
209
210
|
{ label: 'Led ON', mode: 1, semanticTags: [] },
|
|
210
211
|
{ label: 'Led OFF', mode: 2, semanticTags: [] },
|
|
211
|
-
], 1, 1)
|
|
212
|
+
], 1, 1);
|
|
212
213
|
}
|
|
213
214
|
addPowerSource(device) {
|
|
214
|
-
device.
|
|
215
|
+
device.createDefaultPowerSourceReplaceableBatteryClusterServer(100);
|
|
215
216
|
}
|
|
216
217
|
async onConfigure() {
|
|
217
218
|
await super.onConfigure();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-test",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7-dev.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-test",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.7-dev.3",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.0.0",
|