matterbridge-example-dynamic-platform 3.0.2-dev-20260812-5fa3c30 → 3.0.2-dev-20260813-2866bb0
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 +3 -2
- package/dist/module.js +34 -12
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -29,7 +29,7 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
29
29
|
|
|
30
30
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
31
31
|
|
|
32
|
-
## [3.0.2] -
|
|
32
|
+
## [3.0.2] - 2026-08-14
|
|
33
33
|
|
|
34
34
|
### Breaking changes
|
|
35
35
|
|
|
@@ -38,7 +38,8 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
38
38
|
### Added
|
|
39
39
|
|
|
40
40
|
- [chip]: Add chip-test toolchain agents instruction and chip-test runner.
|
|
41
|
-
- [chip]: Add `chipTests.json`/`chipTests.md` with the generic device basic composition, conformance and default warnings tests
|
|
41
|
+
- [chip]: Add `chipTests.json`/`chipTests.md` with the generic device basic composition, conformance and default warnings tests (all pass). Document known CHIP test suite bugs.
|
|
42
|
+
- [chip]: Add `chipTests.json`/`chipTests.md` with the ClosureControl and ClosureDimension cluster tests (all pass).
|
|
42
43
|
- [frontend]: Add plugin-frontend agents instructions.
|
|
43
44
|
- [platform]: Add `closureGarageDoor` device. Thanks Ludovic BOUÉ.
|
|
44
45
|
- [platform]: Add `closureVenetianBlind` device with Lift and Tilt panels. Thanks Ludovic BOUÉ.
|
package/dist/module.js
CHANGED
|
@@ -201,18 +201,18 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
201
201
|
const targetState = this.closureGarageDoor?.getAttribute(ClosureControl, 'overallTargetState');
|
|
202
202
|
if (targetState === undefined || targetState === null || targetState.position === undefined || targetState.position === null)
|
|
203
203
|
return;
|
|
204
|
-
void this.closureGarageDoor?.
|
|
205
|
-
void this.closureGarageDoor?.setAttribute(ClosureControl, 'countdownTime', 0, this.closureGarageDoor.log);
|
|
206
|
-
void this.closureGarageDoor?.setAttribute(ClosureControl, 'overallCurrentState', {
|
|
204
|
+
void this.closureGarageDoor?.setState({
|
|
207
205
|
position: closureTargetToCurrentPosition(targetState.position),
|
|
208
206
|
latch: targetState.latch,
|
|
209
207
|
speed: targetState.speed,
|
|
210
208
|
secureState: targetState.position === ClosureControl.TargetPosition.MoveToFullyClosed && targetState.latch === true,
|
|
211
|
-
},
|
|
209
|
+
}, targetState, ClosureControl.MainState.Stopped, 0, []);
|
|
210
|
+
void this.closureGarageDoor?.triggerMovementCompleted();
|
|
212
211
|
}, 1000).unref();
|
|
213
212
|
});
|
|
214
|
-
this.closureGarageDoor?.addCommandHandler('ClosureControl.stop', () => {
|
|
213
|
+
this.closureGarageDoor?.addCommandHandler('ClosureControl.stop', ({ attributes }) => {
|
|
215
214
|
this.closureGarageDoor?.log.info('Command stop called');
|
|
215
|
+
attributes.countdownTime = 0;
|
|
216
216
|
clearTimeout(closureGarageDoorMoveTimeout);
|
|
217
217
|
closureGarageDoorMoveTimeout = undefined;
|
|
218
218
|
});
|
|
@@ -256,20 +256,16 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
256
256
|
void this.closureVenetianBlind?.setAttribute(ClosureControl, 'overallCurrentState', { position: overallPosition, latch: liftCurrent.latch ?? true, speed: liftCurrent.speed, secureState: liftCurrent.position === 10000 && liftCurrent.latch === true }, this.closureVenetianBlind?.log);
|
|
257
257
|
};
|
|
258
258
|
const simulateClosurePanelReachingTarget = (panel) => {
|
|
259
|
-
|
|
260
|
-
if (pending)
|
|
261
|
-
clearTimeout(pending);
|
|
259
|
+
clearTimeout(closurePanelReachTimeouts.get(panel));
|
|
262
260
|
const currentStateTimeout = setTimeout(() => {
|
|
263
261
|
void (async () => {
|
|
264
|
-
closurePanelReachTimeouts.delete(panel);
|
|
265
262
|
const targetState = panel.getAttribute(ClosureDimension, 'targetState');
|
|
266
263
|
if (targetState === undefined || targetState === null)
|
|
267
264
|
return;
|
|
268
265
|
await panel.setAttribute(ClosureDimension, 'currentState', targetState, panel.log);
|
|
269
266
|
syncClosureVenetianBlindFromPanels();
|
|
270
267
|
})();
|
|
271
|
-
}, 1000);
|
|
272
|
-
currentStateTimeout.unref();
|
|
268
|
+
}, 1000).unref();
|
|
273
269
|
closurePanelReachTimeouts.set(panel, currentStateTimeout);
|
|
274
270
|
};
|
|
275
271
|
const moveClosurePanelTo = (panel, position, latch, speed) => {
|
|
@@ -303,6 +299,14 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
303
299
|
};
|
|
304
300
|
addClosurePanelSetTargetSimulation(closureVenetianBlindLift);
|
|
305
301
|
addClosurePanelSetTargetSimulation(closureVenetianBlindTilt);
|
|
302
|
+
const addClosurePanelStepSimulation = (panel) => {
|
|
303
|
+
panel.addCommandHandler('ClosureDimension.step', ({ request: { direction, numberOfSteps, speed } }) => {
|
|
304
|
+
panel.log.info(`Command step called direction:${direction} numberOfSteps:${numberOfSteps} speed:${speed}`);
|
|
305
|
+
simulateClosurePanelReachingTarget(panel);
|
|
306
|
+
});
|
|
307
|
+
};
|
|
308
|
+
addClosurePanelStepSimulation(closureVenetianBlindLift);
|
|
309
|
+
addClosurePanelStepSimulation(closureVenetianBlindTilt);
|
|
306
310
|
this.climate = new MatterbridgeEndpoint([bridgedNode, powerSource], { id: 'Climate' }, this.config.debug)
|
|
307
311
|
.createDefaultBridgedDeviceBasicInformationClusterServer('Climate', 'CLI00008', 0xfff1, 'Matterbridge', 'Matterbridge Climate')
|
|
308
312
|
.createDefaultPowerSourceReplaceableBatteryClusterServer(90, PowerSource.BatChargeLevel.Ok, 2990, '2 x AA', 2, PowerSource.BatReplaceability.UserReplaceable)
|
|
@@ -2423,7 +2427,15 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2423
2427
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'systemMode', Thermostat.SystemMode.Auto, this.thermoAuto.log);
|
|
2424
2428
|
if (this.thermoAuto?.hasAttributeServer(Thermostat.id, 'thermostatRunningState')) {
|
|
2425
2429
|
const runningState = this.thermoAuto?.getAttribute(Thermostat.id, 'thermostatRunningState', this.thermoAuto.log);
|
|
2426
|
-
await this.thermoAuto?.setAttribute(Thermostat.id, 'thermostatRunningState', { ...runningState, heat: true }, this.thermoAuto.log);
|
|
2430
|
+
await this.thermoAuto?.setAttribute(Thermostat.id, 'thermostatRunningState', { ...runningState, heat: true, cool: false }, this.thermoAuto.log);
|
|
2431
|
+
}
|
|
2432
|
+
if (this.thermoHeat?.hasAttributeServer(Thermostat.id, 'thermostatRunningState')) {
|
|
2433
|
+
const runningState = this.thermoHeat?.getAttribute(Thermostat.id, 'thermostatRunningState', this.thermoHeat.log);
|
|
2434
|
+
await this.thermoHeat?.setAttribute(Thermostat.id, 'thermostatRunningState', { ...runningState, heat: true, cool: false }, this.thermoHeat.log);
|
|
2435
|
+
}
|
|
2436
|
+
if (this.thermoCool?.hasAttributeServer(Thermostat.id, 'thermostatRunningState')) {
|
|
2437
|
+
const runningState = this.thermoCool?.getAttribute(Thermostat.id, 'thermostatRunningState', this.thermoCool.log);
|
|
2438
|
+
await this.thermoCool?.setAttribute(Thermostat.id, 'thermostatRunningState', { ...runningState, heat: false, cool: true }, this.thermoCool.log);
|
|
2427
2439
|
}
|
|
2428
2440
|
this.thermoAuto?.log.info('Set thermostat initial localTemperature to 16°C, mode Auto and heat runningState to true');
|
|
2429
2441
|
const temperature = this.thermoAuto?.getChildEndpointById('Temperature');
|
|
@@ -2476,6 +2488,16 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2476
2488
|
runningState.cool = !runningState?.cool;
|
|
2477
2489
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'thermostatRunningState', runningState, this.thermoAuto.log);
|
|
2478
2490
|
}
|
|
2491
|
+
if (this.thermoHeat?.hasAttributeServer(Thermostat.id, 'thermostatRunningState')) {
|
|
2492
|
+
const runningState = this.thermoHeat?.getAttribute(Thermostat.id, 'thermostatRunningState', this.thermoHeat.log);
|
|
2493
|
+
runningState.heat = !runningState?.heat;
|
|
2494
|
+
await this.thermoHeat?.setAttribute(Thermostat.id, 'thermostatRunningState', runningState, this.thermoHeat.log);
|
|
2495
|
+
}
|
|
2496
|
+
if (this.thermoCool?.hasAttributeServer(Thermostat.id, 'thermostatRunningState')) {
|
|
2497
|
+
const runningState = this.thermoCool?.getAttribute(Thermostat.id, 'thermostatRunningState', this.thermoCool.log);
|
|
2498
|
+
runningState.cool = !runningState?.cool;
|
|
2499
|
+
await this.thermoCool?.setAttribute(Thermostat.id, 'thermostatRunningState', runningState, this.thermoCool.log);
|
|
2500
|
+
}
|
|
2479
2501
|
}, 60 * 1000 + 600);
|
|
2480
2502
|
}
|
|
2481
2503
|
await this.airConditioner?.setAttribute(OnOff.id, 'onOff', true, this.airConditioner.log);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
|
3
|
-
"version": "3.0.2-dev-
|
|
3
|
+
"version": "3.0.2-dev-20260813-2866bb0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
|
9
|
-
"version": "3.0.2-dev-
|
|
9
|
+
"version": "3.0.2-dev-20260813-2866bb0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.0",
|
package/package.json
CHANGED