matterbridge-example-dynamic-platform 2.0.5 → 2.0.6-dev-20260126-6551672
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 +14 -1
- package/README.md +2 -1
- package/dist/module.d.ts +3 -2
- package/dist/module.js +30 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,19 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
23
23
|
|
|
24
24
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
25
25
|
|
|
26
|
+
## [2.0.6] - Dev branch
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- [BasicVideoPlayer]: Added a BasicVideoPlayer device (supported by SmartThings).
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- [package]: Updated dependencies.
|
|
35
|
+
- [package]: Required matterbridge 3.5.2.
|
|
36
|
+
|
|
37
|
+
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
|
|
38
|
+
|
|
26
39
|
## [2.0.5] - 2026-01-26
|
|
27
40
|
|
|
28
41
|
### Added
|
|
@@ -30,7 +43,7 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
30
43
|
- [thermostat]: Added a thermostat auto mode with presets (Home, Away, Sleep, Wake, Vacation and GoingToSleep modes) including 3 sub endpoints with flowMeasurement, temperature and humidity sensors. Thanks Ludovic BOUÉ (<https://github.com/Luligu/matterbridge-example-dynamic-platform/pull/42> and https://github.com/Luligu/matterbridge-example-dynamic-platform/pull/43).
|
|
31
44
|
- [Energy]: Added an outlet (plug) with onOff cluster, energy measurements and power measurements.
|
|
32
45
|
- [EnergyApparent]: Added an outlet (plug) with onOff cluster, apparent energy measurements and power measurements.
|
|
33
|
-
- [mountedSwitches]: Added onOffOutlet and dimmableOutlet device types to the mounted device types for
|
|
46
|
+
- [mountedSwitches]: Added onOffOutlet and dimmableOutlet device types to the mounted device types for conformance to Matter 1.4.2.
|
|
34
47
|
|
|
35
48
|
### Changed
|
|
36
49
|
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
Matterbridge dynamic platform example plugin is a template to develop your own plugin using the dynamic platform.
|
|
21
21
|
|
|
22
|
-
It exposes
|
|
22
|
+
It exposes 62 virtual devices:
|
|
23
23
|
|
|
24
24
|
- a door contact sensor
|
|
25
25
|
- a motion sensor
|
|
@@ -82,6 +82,7 @@ It exposes 61 virtual devices:
|
|
|
82
82
|
- a solar power device
|
|
83
83
|
- a battery storage device
|
|
84
84
|
- a heat pump device
|
|
85
|
+
- a basic video player (supported by SmartThings)
|
|
85
86
|
- a speaker device (supported by SmartThings)
|
|
86
87
|
|
|
87
88
|
All these devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices), how to subscribe to attributes and how to trigger events.
|
package/dist/module.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MatterbridgeEndpoint, MatterbridgeDynamicPlatform, PlatformConfig, PlatformMatterbridge } from 'matterbridge';
|
|
2
|
-
import { Oven, Cooktop, Refrigerator, AirConditioner, Speaker } from 'matterbridge/devices';
|
|
2
|
+
import { Oven, Cooktop, Refrigerator, AirConditioner, Speaker, BasicVideoPlayer, CastingVideoPlayer } from 'matterbridge/devices';
|
|
3
3
|
import { AnsiLogger } from 'matterbridge/logger';
|
|
4
4
|
export type DynamicPlatformConfig = PlatformConfig & {
|
|
5
5
|
whiteList: string[];
|
|
@@ -71,6 +71,8 @@ export declare class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDyna
|
|
|
71
71
|
cooktop: Cooktop | undefined;
|
|
72
72
|
refrigerator: Refrigerator | undefined;
|
|
73
73
|
airConditioner: AirConditioner | undefined;
|
|
74
|
+
basicVideoPlayer: BasicVideoPlayer | undefined;
|
|
75
|
+
castingVideoPlayer: CastingVideoPlayer | undefined;
|
|
74
76
|
speaker: Speaker | undefined;
|
|
75
77
|
phaseInterval: NodeJS.Timeout | undefined;
|
|
76
78
|
phase: number;
|
|
@@ -93,7 +95,6 @@ export declare class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDyna
|
|
|
93
95
|
intervalOnOff: boolean;
|
|
94
96
|
intervalLevel: number;
|
|
95
97
|
intervalColorTemperature: number;
|
|
96
|
-
bridgedDevices: Map<string, MatterbridgeEndpoint>;
|
|
97
98
|
fanModeLookup: string[];
|
|
98
99
|
fanDirectionLookup: string[];
|
|
99
100
|
constructor(matterbridge: PlatformMatterbridge, log: AnsiLogger, config: DynamicPlatformConfig);
|
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MatterbridgeEndpoint, MatterbridgeDynamicPlatform, airQualitySensor, bridgedNode, colorTemperatureLight, coverDevice, dimmableLight, doorLockDevice, fanDevice, flowSensor, humiditySensor, onOffLight, onOffOutlet, onOffSwitch, powerSource, rainSensor, smokeCoAlarm, temperatureSensor, thermostatDevice, waterFreezeDetector, waterLeakDetector, airPurifier, pumpDevice, waterValve, genericSwitch, onOffMountedSwitch, dimmableMountedSwitch, extendedColorLight, pressureSensor, contactSensor, occupancySensor, lightSensor, modeSelect, electricalSensor, dimmableOutlet, } from 'matterbridge';
|
|
2
|
-
import { RoboticVacuumCleaner, LaundryWasher, WaterHeater, Evse, SolarPower, BatteryStorage, LaundryDryer, HeatPump, Dishwasher, ExtractorHood, MicrowaveOven, Oven, Cooktop, Refrigerator, AirConditioner, Speaker, } from 'matterbridge/devices';
|
|
2
|
+
import { RoboticVacuumCleaner, LaundryWasher, WaterHeater, Evse, SolarPower, BatteryStorage, LaundryDryer, HeatPump, Dishwasher, ExtractorHood, MicrowaveOven, Oven, Cooktop, Refrigerator, AirConditioner, Speaker, BasicVideoPlayer, } from 'matterbridge/devices';
|
|
3
3
|
import { isValidBoolean, isValidNumber, isValidObject, isValidString } from 'matterbridge/utils';
|
|
4
4
|
import { debugStringify } from 'matterbridge/logger';
|
|
5
5
|
import { AreaNamespaceTag, LocationTag, NumberTag, PositionTag, RefrigeratorTag, SwitchesTag, UINT16_MAX, UINT32_MAX } from 'matterbridge/matter';
|
|
@@ -85,6 +85,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
85
85
|
cooktop;
|
|
86
86
|
refrigerator;
|
|
87
87
|
airConditioner;
|
|
88
|
+
basicVideoPlayer;
|
|
89
|
+
castingVideoPlayer;
|
|
88
90
|
speaker;
|
|
89
91
|
phaseInterval;
|
|
90
92
|
phase = -1;
|
|
@@ -107,7 +109,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
107
109
|
intervalOnOff = false;
|
|
108
110
|
intervalLevel = 1;
|
|
109
111
|
intervalColorTemperature = 147;
|
|
110
|
-
bridgedDevices = new Map();
|
|
111
112
|
fanModeLookup = ['Off', 'Low', 'Medium', 'High', 'On', 'Auto', 'Smart'];
|
|
112
113
|
fanDirectionLookup = ['Forward', 'Reverse'];
|
|
113
114
|
constructor(matterbridge, log, config) {
|
|
@@ -1384,6 +1385,33 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
1384
1385
|
if (isValidNumber(newValue, 0, 100))
|
|
1385
1386
|
this.airConditioner?.setAttribute(FanControl.Cluster.id, 'percentCurrent', newValue, this.airConditioner?.log);
|
|
1386
1387
|
}, this.airConditioner?.log);
|
|
1388
|
+
this.basicVideoPlayer = new BasicVideoPlayer('BasicVideoPlayer', 'BVP00062');
|
|
1389
|
+
this.basicVideoPlayer = (await this.addDevice(this.basicVideoPlayer));
|
|
1390
|
+
this.basicVideoPlayer
|
|
1391
|
+
?.addCommandHandler('play', async () => {
|
|
1392
|
+
this.basicVideoPlayer?.log.info(`Command play called`);
|
|
1393
|
+
})
|
|
1394
|
+
.addCommandHandler('pause', async () => {
|
|
1395
|
+
this.basicVideoPlayer?.log.info(`Command pause called`);
|
|
1396
|
+
})
|
|
1397
|
+
.addCommandHandler('stop', async () => {
|
|
1398
|
+
this.basicVideoPlayer?.log.info(`Command stop called`);
|
|
1399
|
+
})
|
|
1400
|
+
.addCommandHandler('previous', async () => {
|
|
1401
|
+
this.basicVideoPlayer?.log.info(`Command previous called`);
|
|
1402
|
+
})
|
|
1403
|
+
.addCommandHandler('next', async () => {
|
|
1404
|
+
this.basicVideoPlayer?.log.info(`Command next called`);
|
|
1405
|
+
})
|
|
1406
|
+
.addCommandHandler('skipForward', async () => {
|
|
1407
|
+
this.basicVideoPlayer?.log.info(`Command skipForward called`);
|
|
1408
|
+
})
|
|
1409
|
+
.addCommandHandler('skipBackward', async () => {
|
|
1410
|
+
this.basicVideoPlayer?.log.info(`Command skipBackward called`);
|
|
1411
|
+
})
|
|
1412
|
+
.addCommandHandler('sendKey', async ({ request: { keyCode } }) => {
|
|
1413
|
+
this.basicVideoPlayer?.log.info(`Command sendKey with ${keyCode} called`);
|
|
1414
|
+
});
|
|
1387
1415
|
this.speaker = new Speaker('Speaker', 'SPE00057', false, 100);
|
|
1388
1416
|
this.speaker = (await this.addDevice(this.speaker));
|
|
1389
1417
|
}
|
|
@@ -2101,7 +2129,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2101
2129
|
device.createDefaultBridgedDeviceBasicInformationClusterServer(device.deviceName, device.serialNumber, device.vendorId, device.vendorName, device.productName, device.softwareVersion, device.softwareVersionString, device.hardwareVersion, device.hardwareVersionString);
|
|
2102
2130
|
}
|
|
2103
2131
|
await this.registerDevice(device);
|
|
2104
|
-
this.bridgedDevices.set(device.deviceName, device);
|
|
2105
2132
|
return device;
|
|
2106
2133
|
}
|
|
2107
2134
|
else {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6-dev-20260126-6551672",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
|
9
|
-
"version": "2.0.
|
|
9
|
+
"version": "2.0.6-dev-20260126-6551672",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.1.1",
|