matterbridge-example-dynamic-platform 3.0.3-dev-20260822-8bd7fd5 → 3.0.3-dev-20260829-d83e6fe

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 CHANGED
@@ -33,7 +33,7 @@ If you like this project and find it useful, please consider giving it a star on
33
33
 
34
34
  ### Breaking changes
35
35
 
36
- - [matterbridge]: Require matterbridge v.3.10.6 with matter v.1.6.0.
36
+ - [matterbridge]: Require matterbridge v.3.10.7 with matter v.1.6.0.
37
37
  - [fanControl]: Matterbridge v.3.10.6 now manages the compliant FanControl `fanMode` and `percentSetting` synchronization; plugin examples now only update `percentCurrent` as physical device feedback.
38
38
 
39
39
  ### Added
@@ -42,10 +42,21 @@ If you like this project and find it useful, please consider giving it a star on
42
42
  - [platform]: Add `closureRoofWindow` device with ventilation opening support. Thanks Ludovic BOUÉ.
43
43
  - [devcontainer]: Upgrade the `Dev Container` to v.2.0.0, using the Node.js and Bun stack.
44
44
 
45
+ ### Changed
46
+
47
+ - [package]: Update dependencies.
48
+ - [package]: Bump `@types/node` to v.26.4.0.
49
+ - [package]: Bump `oxfmt` to v.0.65.0.
50
+ - [package]: Bump `oxlint` to v.1.80.0.
51
+
45
52
  ### Fixed
46
53
 
47
54
  - [speaker]: Update to the `Speaker` constructor options object required by matterbridge v.3.10.6.
48
55
  - [fanControl]: `percentSetting` is no longer nullable in matterbridge v.3.10.6; set it to 0 instead of null when turning off the air conditioner.
56
+ - [energy]: Update `WaterHeater`, `Evse`, `SolarPower`, `BatteryStorage`, and `HeatPump` to the options object constructor, present since matterbridge v.3.10.7. The deprecated positional-arguments constructors are still supported but no longer used in this plugin.
57
+ - [devices]: Update `RoboticVacuumCleaner`, `Oven.addCabinet`, `Cooktop.addSurface`, and `Refrigerator.addCabinet` to the options object form, removing the last `typescript/no-deprecated` oxlint suppressions in the platform.
58
+ - [platform]: Make the local `addDevice` helper generic (`addDevice<T extends MatterbridgeEndpoint>`) so it returns the same subclass it was given, removing 9 `typescript/no-unsafe-type-assertion` oxlint suppressions at its call sites.
59
+ - [platform]: Type `initializePlugin`'s `config` parameter directly as `DynamicPlatformConfig`, matching the pattern used in production plugins, removing the last `typescript/no-unsafe-type-assertion` cast on plugin startup.
49
60
 
50
61
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
51
62
 
package/dist/module.js CHANGED
@@ -20,6 +20,9 @@ function matterToLux(value) {
20
20
  const lux = Math.pow(10, v / 10000);
21
21
  return Math.round(lux < 0 ? 0 : lux);
22
22
  }
23
+ function isDeviceTypeList(value) {
24
+ return Array.isArray(value);
25
+ }
23
26
  export default function initializePlugin(matterbridge, log, config) {
24
27
  return new ExampleMatterbridgeDynamicPlatform(matterbridge, log, config);
25
28
  }
@@ -113,8 +116,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
113
116
  constructor(matterbridge, log, config) {
114
117
  super(matterbridge, log, config);
115
118
  this.config = config;
116
- if (typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.10.6')) {
117
- throw new Error(`This plugin requires Matterbridge version >= "3.10.6". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`);
119
+ if (typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.10.7')) {
120
+ throw new Error(`This plugin requires Matterbridge version >= "3.10.7". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`);
118
121
  }
119
122
  this.log.info('Initializing platform:', this.config.name);
120
123
  }
@@ -173,18 +176,18 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
173
176
  this.flow = await this.addDevice(this.flow);
174
177
  this.soil = new SoilSensor('Soil Sensor', 'SOI000067', { soilMoistureMeasuredValue: 45, temperatureMeasuredValue: 3500, batteryPowered: true });
175
178
  this.soil = await this.addDevice(this.soil);
176
- this.irrigation = new IrrigationSystem('Irrigation System', 'IRR000068', { batteryPowered: true, flowMeasuredValue: 15 }).addZone(CommonNumberTag.One);
177
- this.irrigation = (await this.addDevice(this.irrigation));
179
+ this.irrigation = new IrrigationSystem('Irrigation System', 'IRR000068', { batteryPowered: true, flowMeasuredValue: 15 }).addZone(CommonNumberTag.One, undefined, undefined, 2000, true);
180
+ this.irrigation = await this.addDevice(this.irrigation);
178
181
  this.irrigationSystem = new IrrigationSystem('Irrigation System 4 zones', 'IRR000069', { flowMeasuredValue: 60 })
179
- .addZone(CommonNumberTag.One)
180
- .addZone(CommonNumberTag.Two)
181
- .addZone(CommonNumberTag.Three)
182
- .addZone(CommonNumberTag.Four);
183
- this.irrigationSystem = (await this.addDevice(this.irrigationSystem));
182
+ .addZone(CommonNumberTag.One, undefined, undefined, 2000, true)
183
+ .addZone(CommonNumberTag.Two, undefined, undefined, 2000, true)
184
+ .addZone(CommonNumberTag.Three, undefined, undefined, 2000, true)
185
+ .addZone(CommonNumberTag.Four, undefined, undefined, 2000, true);
186
+ this.irrigationSystem = await this.addDevice(this.irrigationSystem);
184
187
  this.closureGarageDoor = new Closure('Garage Door', 'GAR000071', {
185
188
  tagList: [getSemtag(ClosureTag.GarageDoor)],
186
189
  });
187
- this.closureGarageDoor = (await this.addDevice(this.closureGarageDoor));
190
+ this.closureGarageDoor = await this.addDevice(this.closureGarageDoor);
188
191
  let closureGarageDoorMoveTimeout;
189
192
  function closureTargetToCurrentPosition(position) {
190
193
  if (position === ClosureControl.TargetPosition.MoveToFullyClosed)
@@ -224,7 +227,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
224
227
  });
225
228
  const closureVenetianBlindLift = this.closureVenetianBlind.addPanel('Lift', [getSemtag(ClosurePanelTag.Lift)], 'lift');
226
229
  const closureVenetianBlindTilt = this.closureVenetianBlind.addPanel('Tilt', [getSemtag(ClosurePanelTag.Tilt)], 'tilt');
227
- this.closureVenetianBlind = (await this.addDevice(this.closureVenetianBlind));
230
+ this.closureVenetianBlind = await this.addDevice(this.closureVenetianBlind);
228
231
  const closurePanelTargetPercent = (position) => {
229
232
  if (position === ClosureControl.TargetPosition.MoveToFullyOpen)
230
233
  return 0;
@@ -1445,7 +1448,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1445
1448
  this.valve = new MatterbridgeEndpoint([waterValve, bridgedNode, powerSource], { id: 'Water valve' }, this.config.debug)
1446
1449
  .createDefaultBridgedDeviceBasicInformationClusterServer('Water valve', 'WAV00029', 0xfff1, 'Matterbridge', 'Matterbridge Water valve')
1447
1450
  .createDefaultIdentifyClusterServer()
1448
- .createDefaultValveConfigurationAndControlClusterServer()
1451
+ .createDefaultValveConfigurationAndControlClusterServer(undefined, undefined, 2000, true)
1449
1452
  .createDefaultPowerSourceWiredClusterServer()
1450
1453
  .addRequiredClusterServers();
1451
1454
  this.valve = await this.addDevice(this.valve);
@@ -1681,68 +1684,130 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1681
1684
  .createDefaultLatchingSwitchClusterServer()
1682
1685
  .createDefaultPowerSourceReplaceableBatteryClusterServer(10, PowerSource.BatChargeLevel.Critical, 2850, 'CR2032', 1);
1683
1686
  this.latchingSwitch = await this.addDevice(this.latchingSwitch);
1684
- this.roboticVacuum = new RoboticVacuumCleaner(this.config.enableServerRvc ? 'Robot Vacuum Server' : 'Robot Vacuum', 'RVC00043', this.config.enableServerRvc ? 'server' : undefined, 1, [
1685
- { label: 'Idle', mode: 1, modeTags: [{ value: RvcRunMode.ModeTag.Idle }] },
1686
- { label: 'Cleaning', mode: 2, modeTags: [{ value: RvcRunMode.ModeTag.Cleaning }] },
1687
- { label: 'Mapping', mode: 3, modeTags: [{ value: RvcRunMode.ModeTag.Mapping }] },
1688
- { label: 'SpotCleaning', mode: 4, modeTags: [{ value: RvcRunMode.ModeTag.Cleaning }, { value: RvcRunMode.ModeTag.Max }] },
1689
- ], 1, [
1690
- { label: 'Vacuum', mode: 1, modeTags: [{ value: RvcCleanMode.ModeTag.Vacuum }] },
1691
- { label: 'Mop', mode: 2, modeTags: [{ value: RvcCleanMode.ModeTag.Mop }] },
1692
- { label: 'Clean', mode: 3, modeTags: [{ value: RvcCleanMode.ModeTag.DeepClean }] },
1693
- ], null, null, undefined, undefined, [
1694
- {
1695
- areaId: 1,
1696
- mapId: 1,
1697
- areaInfo: { locationInfo: { locationName: 'Living', floorNumber: 0, areaType: CommonAreaNamespaceTag.LivingRoom.tag }, landmarkInfo: null },
1698
- },
1699
- {
1700
- areaId: 2,
1701
- mapId: 1,
1702
- areaInfo: { locationInfo: { locationName: 'Kitchen', floorNumber: 0, areaType: CommonAreaNamespaceTag.Kitchen.tag }, landmarkInfo: null },
1703
- },
1704
- {
1705
- areaId: 3,
1706
- mapId: 2,
1707
- areaInfo: { locationInfo: { locationName: 'Bedroom', floorNumber: 1, areaType: CommonAreaNamespaceTag.Bedroom.tag }, landmarkInfo: null },
1708
- },
1709
- {
1710
- areaId: 4,
1711
- mapId: 2,
1712
- areaInfo: { locationInfo: { locationName: 'Bathroom', floorNumber: 1, areaType: CommonAreaNamespaceTag.Bathroom.tag }, landmarkInfo: null },
1713
- },
1714
- ], [], 1, [
1715
- {
1716
- mapId: 1,
1717
- name: 'Ground floor',
1718
- },
1719
- {
1720
- mapId: 2,
1721
- name: 'First floor',
1722
- },
1723
- ]);
1687
+ this.roboticVacuum = new RoboticVacuumCleaner(this.config.enableServerRvc ? 'Robot Vacuum Server' : 'Robot Vacuum', 'RVC00043', {
1688
+ mode: this.config.enableServerRvc ? 'server' : undefined,
1689
+ currentRunMode: 1,
1690
+ supportedRunModes: [
1691
+ { label: 'Idle', mode: 1, modeTags: [{ value: RvcRunMode.ModeTag.Idle }] },
1692
+ { label: 'Cleaning', mode: 2, modeTags: [{ value: RvcRunMode.ModeTag.Cleaning }] },
1693
+ { label: 'Mapping', mode: 3, modeTags: [{ value: RvcRunMode.ModeTag.Mapping }] },
1694
+ { label: 'SpotCleaning', mode: 4, modeTags: [{ value: RvcRunMode.ModeTag.Cleaning }, { value: RvcRunMode.ModeTag.Max }] },
1695
+ ],
1696
+ currentCleanMode: 1,
1697
+ supportedCleanModes: [
1698
+ { label: 'Vacuum', mode: 1, modeTags: [{ value: RvcCleanMode.ModeTag.Vacuum }] },
1699
+ { label: 'Mop', mode: 2, modeTags: [{ value: RvcCleanMode.ModeTag.Mop }] },
1700
+ { label: 'Clean', mode: 3, modeTags: [{ value: RvcCleanMode.ModeTag.DeepClean }] },
1701
+ ],
1702
+ currentPhase: null,
1703
+ phaseList: null,
1704
+ operationalState: undefined,
1705
+ operationalStateList: undefined,
1706
+ supportedAreas: [
1707
+ {
1708
+ areaId: 1,
1709
+ mapId: 1,
1710
+ areaInfo: { locationInfo: { locationName: 'Living', floorNumber: 0, areaType: CommonAreaNamespaceTag.LivingRoom.tag }, landmarkInfo: null },
1711
+ },
1712
+ {
1713
+ areaId: 2,
1714
+ mapId: 1,
1715
+ areaInfo: { locationInfo: { locationName: 'Kitchen', floorNumber: 0, areaType: CommonAreaNamespaceTag.Kitchen.tag }, landmarkInfo: null },
1716
+ },
1717
+ {
1718
+ areaId: 3,
1719
+ mapId: 2,
1720
+ areaInfo: { locationInfo: { locationName: 'Bedroom', floorNumber: 1, areaType: CommonAreaNamespaceTag.Bedroom.tag }, landmarkInfo: null },
1721
+ },
1722
+ {
1723
+ areaId: 4,
1724
+ mapId: 2,
1725
+ areaInfo: { locationInfo: { locationName: 'Bathroom', floorNumber: 1, areaType: CommonAreaNamespaceTag.Bathroom.tag }, landmarkInfo: null },
1726
+ },
1727
+ ],
1728
+ selectedAreas: [],
1729
+ currentArea: 1,
1730
+ supportedMaps: [
1731
+ {
1732
+ mapId: 1,
1733
+ name: 'Ground floor',
1734
+ },
1735
+ {
1736
+ mapId: 2,
1737
+ name: 'First floor',
1738
+ },
1739
+ ],
1740
+ });
1724
1741
  if (this.config.enableServerRvc) {
1725
1742
  this.log.notice('RVC is in server mode so it has its own QR code (it shows in the "Devices" panel of the Home page)');
1726
1743
  }
1727
1744
  this.roboticVacuum = await this.addDevice(this.roboticVacuum);
1728
- this.waterHeater = new WaterHeater('Water Heater', 'WHT00044', 50, 60, 20, 80, undefined, 85, 220_000, 1_000, 220_000, 12_000_000, 500_000, 3_000_000);
1745
+ this.waterHeater = new WaterHeater('Water Heater', 'WHT00044', {
1746
+ waterTemperature: 50,
1747
+ targetWaterTemperature: 60,
1748
+ minHeatSetpointLimit: 20,
1749
+ maxHeatSetpointLimit: 80,
1750
+ tankPercentage: 85,
1751
+ voltage: 220_000,
1752
+ current: 1_000,
1753
+ power: 220_000,
1754
+ energy: 12_000_000,
1755
+ absMinPower: 500_000,
1756
+ absMaxPower: 3_000_000,
1757
+ });
1729
1758
  this.waterHeater = await this.addDevice(this.waterHeater);
1730
- this.evse = new Evse('Evse', 'EVS00045', 1, [
1731
- { label: 'On demand', mode: 1, modeTags: [{ value: EnergyEvseMode.ModeTag.Manual }] },
1732
- { label: 'Scheduled', mode: 2, modeTags: [{ value: EnergyEvseMode.ModeTag.TimeOfUse }] },
1733
- { label: 'Solar Charging', mode: 3, modeTags: [{ value: EnergyEvseMode.ModeTag.SolarCharging }] },
1734
- { label: 'Solar Charging Scheduled', mode: 4, modeTags: [{ value: EnergyEvseMode.ModeTag.SolarCharging }, { value: EnergyEvseMode.ModeTag.TimeOfUse }] },
1735
- ], EnergyEvse.State.PluggedInCharging, EnergyEvse.SupplyState.ChargingEnabled, EnergyEvse.FaultState.NoError, 220_000, 10_000, 2_200_000, 1_000_000, 500_000, 32_000_000);
1759
+ this.evse = new Evse('Evse', 'EVS00045', {
1760
+ currentMode: 1,
1761
+ supportedModes: [
1762
+ { label: 'On demand', mode: 1, modeTags: [{ value: EnergyEvseMode.ModeTag.Manual }] },
1763
+ { label: 'Scheduled', mode: 2, modeTags: [{ value: EnergyEvseMode.ModeTag.TimeOfUse }] },
1764
+ { label: 'Solar Charging', mode: 3, modeTags: [{ value: EnergyEvseMode.ModeTag.SolarCharging }] },
1765
+ { label: 'Solar Charging Scheduled', mode: 4, modeTags: [{ value: EnergyEvseMode.ModeTag.SolarCharging }, { value: EnergyEvseMode.ModeTag.TimeOfUse }] },
1766
+ ],
1767
+ state: EnergyEvse.State.PluggedInCharging,
1768
+ supplyState: EnergyEvse.SupplyState.ChargingEnabled,
1769
+ faultState: EnergyEvse.FaultState.NoError,
1770
+ voltage: 220_000,
1771
+ current: 10_000,
1772
+ power: 2_200_000,
1773
+ energy: 1_000_000,
1774
+ absMinPower: 500_000,
1775
+ absMaxPower: 32_000_000,
1776
+ });
1736
1777
  this.evse = await this.addDevice(this.evse);
1737
- this.solarPower = new SolarPower('Solar Power', 'SOL00046', 220_000, 10_000, 2200_000, 2_200_000, 0, 500_000);
1778
+ this.solarPower = new SolarPower('Solar Power', 'SOL00046', {
1779
+ voltage: 220_000,
1780
+ current: 10_000,
1781
+ power: 2200_000,
1782
+ energyExported: 2_200_000,
1783
+ absMinPower: 0,
1784
+ absMaxPower: 500_000,
1785
+ });
1738
1786
  this.solarPower.addPanel('Panel 1', CommonNumberTag.One);
1739
1787
  this.solarPower.addPanel('Panel 2', CommonNumberTag.Two);
1740
1788
  this.solarPower.addPanel('Panel 3', CommonNumberTag.Three);
1741
1789
  this.solarPower.addPanel('Panel 4', CommonNumberTag.Four);
1742
- this.solarPower = (await this.addDevice(this.solarPower));
1743
- this.batteryStorage = new BatteryStorage('Battery Storage', 'BST00047', 75, PowerSource.BatChargeLevel.Ok, 220_000, 10_000, 2_200_000, 1_000_000, 2_000_000, -2_000_000, 3_000_000);
1790
+ this.solarPower = await this.addDevice(this.solarPower);
1791
+ this.batteryStorage = new BatteryStorage('Battery Storage', 'BST00047', {
1792
+ batPercentRemaining: 75,
1793
+ batChargeLevel: PowerSource.BatChargeLevel.Ok,
1794
+ voltage: 220_000,
1795
+ current: 10_000,
1796
+ power: 2_200_000,
1797
+ energyImported: 1_000_000,
1798
+ energyExported: 2_000_000,
1799
+ absMinPower: -2_000_000,
1800
+ absMaxPower: 3_000_000,
1801
+ });
1744
1802
  this.batteryStorage = await this.addDevice(this.batteryStorage);
1745
- this.heatPump = new HeatPump('Heat Pump', 'HPU00048', 220_000, 10_000, 2_200_000, 1_000_000, 500_000, 3_000_000);
1803
+ this.heatPump = new HeatPump('Heat Pump', 'HPU00048', {
1804
+ voltage: 220_000,
1805
+ current: 10_000,
1806
+ power: 2_200_000,
1807
+ energyImported: 1_000_000,
1808
+ absMinPower: 500_000,
1809
+ absMaxPower: 3_000_000,
1810
+ });
1746
1811
  this.heatPump = await this.addDevice(this.heatPump);
1747
1812
  this.laundryWasher = new LaundryWasher('Laundry Washer', 'LWA00049');
1748
1813
  this.laundryWasher = await this.addDevice(this.laundryWasher);
@@ -1755,52 +1820,98 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1755
1820
  this.microwaveOven = new MicrowaveOven('Microwave Oven', 'MWO00053');
1756
1821
  this.microwaveOven = await this.addDevice(this.microwaveOven);
1757
1822
  this.oven = new Oven('Oven', 'OVN00054');
1758
- this.oven.addCabinet('Upper Cabinet', [{ mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: CommonPositionTag.Top.label }], 2, [
1759
- { label: 'Bake', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Bake }] },
1760
- { label: 'Convection', mode: 2, modeTags: [{ value: OvenMode.ModeTag.Convection }] },
1761
- { label: 'Grill', mode: 3, modeTags: [{ value: OvenMode.ModeTag.Grill }] },
1762
- { label: 'Roast', mode: 4, modeTags: [{ value: OvenMode.ModeTag.Roast }] },
1763
- { label: 'Clean', mode: 5, modeTags: [{ value: OvenMode.ModeTag.Clean }] },
1764
- { label: 'Convection Bake', mode: 6, modeTags: [{ value: OvenMode.ModeTag.ConvectionBake }] },
1765
- { label: 'Convection Roast', mode: 7, modeTags: [{ value: OvenMode.ModeTag.ConvectionRoast }] },
1766
- { label: 'Warming', mode: 8, modeTags: [{ value: OvenMode.ModeTag.Warming }] },
1767
- { label: 'Proofing', mode: 9, modeTags: [{ value: OvenMode.ModeTag.Proofing }] },
1768
- { label: 'Steam', mode: 10, modeTags: [{ value: OvenMode.ModeTag.Steam }] },
1769
- ], 180 * 100, 100 * 100, 300 * 100, 10 * 100, 20 * 100, OperationalState.OperationalStateEnum.Stopped, 2, ['pre-heating', 'pre-heated', 'cooling down']);
1770
- this.oven.addCabinet('Lower Cabinet', [{ mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: CommonPositionTag.Bottom.label }], 3, [
1771
- { label: 'Convection', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Convection }] },
1772
- { label: 'Clean', mode: 2, modeTags: [{ value: OvenMode.ModeTag.Clean }] },
1773
- { label: 'Steam', mode: 3, modeTags: [{ value: OvenMode.ModeTag.Steam }] },
1774
- ], 200 * 100, 100 * 100, 300 * 100, 10 * 100, 200 * 100, OperationalState.OperationalStateEnum.Running, 1, ['pre-heating', 'pre-heated', 'cooling down']);
1775
- this.oven = (await this.addDevice(this.oven));
1823
+ this.oven.addCabinet('Upper Cabinet', {
1824
+ tagList: [{ mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: CommonPositionTag.Top.label }],
1825
+ currentMode: 2,
1826
+ supportedModes: [
1827
+ { label: 'Bake', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Bake }] },
1828
+ { label: 'Convection', mode: 2, modeTags: [{ value: OvenMode.ModeTag.Convection }] },
1829
+ { label: 'Grill', mode: 3, modeTags: [{ value: OvenMode.ModeTag.Grill }] },
1830
+ { label: 'Roast', mode: 4, modeTags: [{ value: OvenMode.ModeTag.Roast }] },
1831
+ { label: 'Clean', mode: 5, modeTags: [{ value: OvenMode.ModeTag.Clean }] },
1832
+ { label: 'Convection Bake', mode: 6, modeTags: [{ value: OvenMode.ModeTag.ConvectionBake }] },
1833
+ { label: 'Convection Roast', mode: 7, modeTags: [{ value: OvenMode.ModeTag.ConvectionRoast }] },
1834
+ { label: 'Warming', mode: 8, modeTags: [{ value: OvenMode.ModeTag.Warming }] },
1835
+ { label: 'Proofing', mode: 9, modeTags: [{ value: OvenMode.ModeTag.Proofing }] },
1836
+ { label: 'Steam', mode: 10, modeTags: [{ value: OvenMode.ModeTag.Steam }] },
1837
+ ],
1838
+ targetTemperature: 180 * 100,
1839
+ minTemperature: 100 * 100,
1840
+ maxTemperature: 300 * 100,
1841
+ step: 10 * 100,
1842
+ currentTemperature: 20 * 100,
1843
+ operationalState: OperationalState.OperationalStateEnum.Stopped,
1844
+ currentPhase: 2,
1845
+ phaseList: ['pre-heating', 'pre-heated', 'cooling down'],
1846
+ });
1847
+ this.oven.addCabinet('Lower Cabinet', {
1848
+ tagList: [{ mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: CommonPositionTag.Bottom.label }],
1849
+ currentMode: 3,
1850
+ supportedModes: [
1851
+ { label: 'Convection', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Convection }] },
1852
+ { label: 'Clean', mode: 2, modeTags: [{ value: OvenMode.ModeTag.Clean }] },
1853
+ { label: 'Steam', mode: 3, modeTags: [{ value: OvenMode.ModeTag.Steam }] },
1854
+ ],
1855
+ targetTemperature: 200 * 100,
1856
+ minTemperature: 100 * 100,
1857
+ maxTemperature: 300 * 100,
1858
+ step: 10 * 100,
1859
+ currentTemperature: 200 * 100,
1860
+ operationalState: OperationalState.OperationalStateEnum.Running,
1861
+ currentPhase: 1,
1862
+ phaseList: ['pre-heating', 'pre-heated', 'cooling down'],
1863
+ });
1864
+ this.oven = await this.addDevice(this.oven);
1776
1865
  this.cooktop = new Cooktop('Cooktop', 'CKT00055');
1777
- this.cooktop.addSurface('Surface Top Left', [
1778
- { mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: CommonPositionTag.Top.label },
1779
- { mfgCode: null, namespaceId: CommonPositionTag.Left.namespaceId, tag: CommonPositionTag.Left.tag, label: CommonPositionTag.Left.label },
1780
- ]);
1781
- this.cooktop.addSurface('Surface Top Right', [
1782
- { mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: CommonPositionTag.Top.label },
1783
- { mfgCode: null, namespaceId: CommonPositionTag.Right.namespaceId, tag: CommonPositionTag.Right.tag, label: CommonPositionTag.Right.label },
1784
- ]);
1785
- this.cooktop.addSurface('Surface Bottom Left', [
1786
- { mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: CommonPositionTag.Bottom.label },
1787
- { mfgCode: null, namespaceId: CommonPositionTag.Left.namespaceId, tag: CommonPositionTag.Left.tag, label: CommonPositionTag.Left.label },
1788
- ]);
1789
- this.cooktop.addSurface('Surface Bottom Right', [
1790
- { mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: CommonPositionTag.Bottom.label },
1791
- { mfgCode: null, namespaceId: CommonPositionTag.Right.namespaceId, tag: CommonPositionTag.Right.tag, label: CommonPositionTag.Right.label },
1792
- ]);
1793
- this.cooktop = (await this.addDevice(this.cooktop));
1866
+ this.cooktop.addSurface('Surface Top Left', {
1867
+ tagList: [
1868
+ { mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: CommonPositionTag.Top.label },
1869
+ { mfgCode: null, namespaceId: CommonPositionTag.Left.namespaceId, tag: CommonPositionTag.Left.tag, label: CommonPositionTag.Left.label },
1870
+ ],
1871
+ });
1872
+ this.cooktop.addSurface('Surface Top Right', {
1873
+ tagList: [
1874
+ { mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: CommonPositionTag.Top.label },
1875
+ { mfgCode: null, namespaceId: CommonPositionTag.Right.namespaceId, tag: CommonPositionTag.Right.tag, label: CommonPositionTag.Right.label },
1876
+ ],
1877
+ });
1878
+ this.cooktop.addSurface('Surface Bottom Left', {
1879
+ tagList: [
1880
+ { mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: CommonPositionTag.Bottom.label },
1881
+ { mfgCode: null, namespaceId: CommonPositionTag.Left.namespaceId, tag: CommonPositionTag.Left.tag, label: CommonPositionTag.Left.label },
1882
+ ],
1883
+ });
1884
+ this.cooktop.addSurface('Surface Bottom Right', {
1885
+ tagList: [
1886
+ { mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: CommonPositionTag.Bottom.label },
1887
+ { mfgCode: null, namespaceId: CommonPositionTag.Right.namespaceId, tag: CommonPositionTag.Right.tag, label: CommonPositionTag.Right.label },
1888
+ ],
1889
+ });
1890
+ this.cooktop = await this.addDevice(this.cooktop);
1794
1891
  const refrigerator = new Refrigerator('Refrigerator', 'REF00056');
1795
- refrigerator.addCabinet('Refrigerator Top', [
1796
- { mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: 'Refrigerator Top' },
1797
- { mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label },
1798
- ], 12 * 100, 5 * 100, 20 * 100, 1 * 100, 1200);
1799
- refrigerator.addCabinet('Freezer Bottom', [
1800
- { mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: 'Freezer Bottom' },
1801
- { mfgCode: null, namespaceId: RefrigeratorTag.Freezer.namespaceId, tag: RefrigeratorTag.Freezer.tag, label: RefrigeratorTag.Freezer.label },
1802
- ], -18 * 100, -30 * 100, -10 * 100, 1 * 100, -1800);
1803
- this.refrigerator = (await this.addDevice(refrigerator));
1892
+ refrigerator.addCabinet('Refrigerator Top', {
1893
+ tagList: [
1894
+ { mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: 'Refrigerator Top' },
1895
+ { mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label },
1896
+ ],
1897
+ targetTemperature: 12 * 100,
1898
+ minTemperature: 5 * 100,
1899
+ maxTemperature: 20 * 100,
1900
+ step: 1 * 100,
1901
+ currentTemperature: 1200,
1902
+ });
1903
+ refrigerator.addCabinet('Freezer Bottom', {
1904
+ tagList: [
1905
+ { mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: 'Freezer Bottom' },
1906
+ { mfgCode: null, namespaceId: RefrigeratorTag.Freezer.namespaceId, tag: RefrigeratorTag.Freezer.tag, label: RefrigeratorTag.Freezer.label },
1907
+ ],
1908
+ targetTemperature: -18 * 100,
1909
+ minTemperature: -30 * 100,
1910
+ maxTemperature: -10 * 100,
1911
+ step: 1 * 100,
1912
+ currentTemperature: -1800,
1913
+ });
1914
+ this.refrigerator = await this.addDevice(refrigerator);
1804
1915
  this.airConditioner = new AirConditioner('Air Conditioner', 'ACO00027', {
1805
1916
  localTemperature: 20,
1806
1917
  occupiedCoolingSetpoint: 22,
@@ -1868,7 +1979,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1868
1979
  this.basicVideoPlayer?.log.info(`Command sendKey with ${keyCode} called`);
1869
1980
  });
1870
1981
  this.speaker = new Speaker('Speaker', 'SPE00057', { muted: false, volume: 100 });
1871
- this.speaker = (await this.addDevice(this.speaker));
1982
+ this.speaker = await this.addDevice(this.speaker);
1872
1983
  }
1873
1984
  intervals = [];
1874
1985
  addInterval(callback, intervalTime) {
@@ -2606,8 +2717,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
2606
2717
  if (device.mode === undefined && !device.deviceTypes.has(bridgedNode.code)) {
2607
2718
  device.deviceTypes.set(bridgedNode.code, bridgedNode);
2608
2719
  const options = device.getClusterServerOptions(Descriptor);
2609
- if (options?.deviceTypeList) {
2610
- const deviceTypeList = options.deviceTypeList;
2720
+ const deviceTypeList = options?.deviceTypeList;
2721
+ if (isDeviceTypeList(deviceTypeList)) {
2611
2722
  if (!deviceTypeList.find((dt) => dt.deviceType === bridgedNode.code)) {
2612
2723
  deviceTypeList.push({ deviceType: bridgedNode.code, revision: bridgedNode.revision });
2613
2724
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-example-dynamic-platform",
3
- "version": "3.0.3-dev-20260822-8bd7fd5",
3
+ "version": "3.0.3-dev-20260829-d83e6fe",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-example-dynamic-platform",
9
- "version": "3.0.3-dev-20260822-8bd7fd5",
9
+ "version": "3.0.3-dev-20260829-d83e6fe",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "node-ansi-logger": "3.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-example-dynamic-platform",
3
- "version": "3.0.3-dev-20260822-8bd7fd5",
3
+ "version": "3.0.3-dev-20260829-d83e6fe",
4
4
  "description": "Matterbridge dynamic plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",