matterbridge-example-dynamic-platform 3.0.4-dev-20260901-796d818 → 3.0.4-dev-20260902-044750d
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 +1 -0
- package/README.md +3 -1
- package/dist/module.js +31 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -46,6 +46,7 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
46
46
|
|
|
47
47
|
### Added
|
|
48
48
|
|
|
49
|
+
- [platform]: Add `ScheduleLock` device: a door lock with the User, PinCredential, and optional WeekDayAccessSchedules, YearDayAccessSchedules, and HolidaySchedules features.
|
|
49
50
|
- [platform]: Add `closureSlidingGate` device with pedestrian opening support. Thanks Ludovic BOUÉ.
|
|
50
51
|
- [platform]: Add `closureRoofWindow` device with ventilation opening support. Thanks Ludovic BOUÉ.
|
|
51
52
|
- [devcontainer]: Upgrade the `Dev Container` to v.2.0.0, using the Node.js and Bun stack.
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
Matterbridge dynamic platform example plugin is a template to develop your own plugin using the dynamic platform.
|
|
25
25
|
|
|
26
|
-
It exposes
|
|
26
|
+
It exposes 77 virtual devices:
|
|
27
27
|
|
|
28
28
|
- a door contact sensor
|
|
29
29
|
- a motion sensor
|
|
@@ -49,6 +49,8 @@ It exposes 76 virtual devices:
|
|
|
49
49
|
- a cover with windowCovering cluster and lift feature
|
|
50
50
|
- a cover with windowCovering cluster and both lift and tilt features
|
|
51
51
|
- a lock with doorLock cluster
|
|
52
|
+
- a lock with doorLock cluster and User and PinCredential support (userPinLock)
|
|
53
|
+
- a lock with doorLock cluster, User and PinCredential support, and WeekDay, YearDay and Holiday access schedules (scheduleLock)
|
|
52
54
|
- a thermostat auto mode (i.e. with Auto Heat and Cool features) with thermostat cluster and 3 sub endpoints with flowMeasurement cluster, temperatureMeasurement cluster
|
|
53
55
|
and relativeHumidityMeasurement cluster (to show how to create a composed device with sub endpoints)
|
|
54
56
|
- a thermostat with auto mode (i.e. with Auto Heat and Cool features), occupancy and outdoorTemperature
|
package/dist/module.js
CHANGED
|
@@ -45,6 +45,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
45
45
|
coverLiftTilt;
|
|
46
46
|
lock;
|
|
47
47
|
userPinLock;
|
|
48
|
+
scheduleLock;
|
|
48
49
|
thermoAuto;
|
|
49
50
|
thermoAutoOccupancy;
|
|
50
51
|
thermoAutoPresets;
|
|
@@ -858,6 +859,34 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
858
859
|
this.userPinLock?.subscribeAttribute(DoorLock, 'userCodeTemporaryDisableTime', (value) => {
|
|
859
860
|
this.userPinLock?.log.info(`Subscribe userCodeTemporaryDisableTime called with: ${value}`);
|
|
860
861
|
}, this.userPinLock.log);
|
|
862
|
+
this.scheduleLock = new MatterbridgeEndpoint([doorLock, bridgedNode, powerSource], { id: 'ScheduleLock' }, this.config.debug)
|
|
863
|
+
.createDefaultIdentifyClusterServer()
|
|
864
|
+
.createDefaultBridgedDeviceBasicInformationClusterServer('Lock with Schedules', 'LSC00080', 0xfff1, 'Matterbridge', 'Matterbridge Lock')
|
|
865
|
+
.createUserPinDoorLockClusterServer(DoorLock.LockState.Locked, DoorLock.LockType.DeadBolt, 0, 4, 10, 2, 3, 4)
|
|
866
|
+
.createDefaultPowerSourceRechargeableBatteryClusterServer(95)
|
|
867
|
+
.addRequiredClusterServers();
|
|
868
|
+
this.scheduleLock = await this.addDevice(this.scheduleLock);
|
|
869
|
+
this.scheduleLock?.addCommandHandler('Identify.identify', ({ request: { identifyTime } }) => {
|
|
870
|
+
this.scheduleLock?.log.info(`Command identify called identifyTime:${identifyTime}`);
|
|
871
|
+
});
|
|
872
|
+
this.scheduleLock?.addCommandHandler('DoorLock.lockDoor', () => {
|
|
873
|
+
this.scheduleLock?.log.info('Command lockDoor called');
|
|
874
|
+
});
|
|
875
|
+
this.scheduleLock?.addCommandHandler('DoorLock.unlockDoor', () => {
|
|
876
|
+
this.scheduleLock?.log.info('Command unlockDoor called');
|
|
877
|
+
});
|
|
878
|
+
this.scheduleLock?.addCommandHandler('DoorLock.setWeekDaySchedule', ({ request: { weekDayIndex, userIndex } }) => {
|
|
879
|
+
this.scheduleLock?.log.info(`Command setWeekDaySchedule called for weekDayIndex:${weekDayIndex} userIndex:${userIndex}`);
|
|
880
|
+
});
|
|
881
|
+
this.scheduleLock?.addCommandHandler('DoorLock.setYearDaySchedule', ({ request: { yearDayIndex, userIndex } }) => {
|
|
882
|
+
this.scheduleLock?.log.info(`Command setYearDaySchedule called for yearDayIndex:${yearDayIndex} userIndex:${userIndex}`);
|
|
883
|
+
});
|
|
884
|
+
this.scheduleLock?.addCommandHandler('DoorLock.setHolidaySchedule', ({ request: { holidayIndex } }) => {
|
|
885
|
+
this.scheduleLock?.log.info(`Command setHolidaySchedule called for holidayIndex:${holidayIndex}`);
|
|
886
|
+
});
|
|
887
|
+
this.scheduleLock?.subscribeAttribute(DoorLock, 'operatingMode', (value) => {
|
|
888
|
+
this.scheduleLock?.log.info(`Subscribe operatingMode called with: ${getEnumDescription(DoorLock.OperatingMode, value)}`);
|
|
889
|
+
}, this.scheduleLock.log);
|
|
861
890
|
this.thermoAuto = new MatterbridgeEndpoint([thermostat, bridgedNode, powerSource], { id: 'Thermostat (AutoMode)' }, this.config.debug)
|
|
862
891
|
.createDefaultIdentifyClusterServer()
|
|
863
892
|
.createDefaultBridgedDeviceBasicInformationClusterServer('Thermostat (Auto)', 'TAU00023', 0xfff1, 'Matterbridge', 'Matterbridge Thermostat')
|
|
@@ -2344,6 +2373,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2344
2373
|
}
|
|
2345
2374
|
}, 60 * 1000 + 500);
|
|
2346
2375
|
}
|
|
2376
|
+
await this.scheduleLock?.setAttribute(DoorLock.id, 'lockState', DoorLock.LockState.Locked, this.scheduleLock.log);
|
|
2377
|
+
this.scheduleLock?.log.info('Set schedule lock initial lockState to Locked');
|
|
2347
2378
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'localTemperature', 16 * 100, this.thermoAuto.log);
|
|
2348
2379
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'systemMode', Thermostat.SystemMode.Auto, this.thermoAuto.log);
|
|
2349
2380
|
if (this.thermoAuto?.hasAttributeServer(Thermostat.id, 'thermostatRunningState')) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
|
3
|
-
"version": "3.0.4-dev-
|
|
3
|
+
"version": "3.0.4-dev-20260902-044750d",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
|
9
|
-
"version": "3.0.4-dev-
|
|
9
|
+
"version": "3.0.4-dev-20260902-044750d",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.1",
|
package/package.json
CHANGED