matterbridge-example-dynamic-platform 3.0.4-dev-20260901-796d818 → 3.0.4-dev-20260904-8b6d65d
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 -8
- 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')
|
|
@@ -2072,12 +2101,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2072
2101
|
}
|
|
2073
2102
|
if (this.phase === 1)
|
|
2074
2103
|
await this.refrigerator.setDoorOpenState(true);
|
|
2075
|
-
if (this.phase === 2)
|
|
2076
|
-
await this.refrigerator.triggerDoorOpenState(true);
|
|
2077
2104
|
if (this.phase === 4)
|
|
2078
2105
|
await this.refrigerator.setDoorOpenState(false);
|
|
2079
|
-
if (this.phase === 4)
|
|
2080
|
-
await this.refrigerator.triggerDoorOpenState(false);
|
|
2081
2106
|
if (this.phase === 5) {
|
|
2082
2107
|
const refrigerator = this.refrigerator.getChildEndpointById('RefrigeratorTop');
|
|
2083
2108
|
await this.refrigerator.setAttribute('RefrigeratorAndTemperatureControlledCabinetMode', 'currentMode', 2, this.refrigerator.log);
|
|
@@ -2090,12 +2115,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2090
2115
|
}
|
|
2091
2116
|
if (this.phase === 6)
|
|
2092
2117
|
await this.refrigerator.setDoorOpenState(true);
|
|
2093
|
-
if (this.phase === 7)
|
|
2094
|
-
await this.refrigerator.triggerDoorOpenState(true);
|
|
2095
2118
|
if (this.phase === 9)
|
|
2096
2119
|
await this.refrigerator.setDoorOpenState(false);
|
|
2097
|
-
if (this.phase === 9)
|
|
2098
|
-
await this.refrigerator.triggerDoorOpenState(false);
|
|
2099
2120
|
}
|
|
2100
2121
|
this.phase += 1;
|
|
2101
2122
|
this.phase = this.phase >= 10 ? 0 : this.phase;
|
|
@@ -2344,6 +2365,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2344
2365
|
}
|
|
2345
2366
|
}, 60 * 1000 + 500);
|
|
2346
2367
|
}
|
|
2368
|
+
await this.scheduleLock?.setAttribute(DoorLock.id, 'lockState', DoorLock.LockState.Locked, this.scheduleLock.log);
|
|
2369
|
+
this.scheduleLock?.log.info('Set schedule lock initial lockState to Locked');
|
|
2347
2370
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'localTemperature', 16 * 100, this.thermoAuto.log);
|
|
2348
2371
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'systemMode', Thermostat.SystemMode.Auto, this.thermoAuto.log);
|
|
2349
2372
|
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-20260904-8b6d65d",
|
|
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-20260904-8b6d65d",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.1",
|
package/package.json
CHANGED