@matterbridge/core 3.8.1-dev-20260607-08cd4da → 3.8.1-dev-20260609-37884d6
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/dist/behaviors/doorLockServer.d.ts +2 -2
- package/dist/devices/soilSensor.js +1 -12
- package/dist/jestutils/jestMatterTest.js +7 -7
- package/dist/jestutils/jestMatterbridgePlatformSpy.d.ts +4 -4
- package/dist/matterbridgeDeviceTypes.d.ts +33 -4
- package/dist/matterbridgeDeviceTypes.js +214 -58
- package/dist/matterbridgeEndpoint.d.ts +4 -3
- package/dist/matterbridgeEndpoint.js +6 -1
- package/dist/matterbridgeEndpointHelpers.d.ts +5 -3
- package/dist/matterbridgeEndpointHelpers.js +111 -93
- package/package.json +7 -7
|
@@ -27,6 +27,7 @@ import { PumpConfigurationAndControlServer } from '@matter/node/behaviors/pump-c
|
|
|
27
27
|
import { RadonConcentrationMeasurementServer } from '@matter/node/behaviors/radon-concentration-measurement';
|
|
28
28
|
import { RelativeHumidityMeasurementServer } from '@matter/node/behaviors/relative-humidity-measurement';
|
|
29
29
|
import { ScenesManagementServer } from '@matter/node/behaviors/scenes-management';
|
|
30
|
+
import { SoilMeasurementServer } from '@matter/node/behaviors/soil-measurement';
|
|
30
31
|
import { SwitchServer } from '@matter/node/behaviors/switch';
|
|
31
32
|
import { TemperatureMeasurementServer } from '@matter/node/behaviors/temperature-measurement';
|
|
32
33
|
import { ThermostatUserInterfaceConfigurationServer } from '@matter/node/behaviors/thermostat-user-interface-configuration';
|
|
@@ -83,7 +84,7 @@ import { MatterbridgeThermostatServer } from './behaviors/thermostatServer.js';
|
|
|
83
84
|
import { MatterbridgeValveConfigurationAndControlServer } from './behaviors/valveConfigurationAndControlServer.js';
|
|
84
85
|
import { MatterbridgeWindowCoveringServer } from './behaviors/windowCoveringServer.js';
|
|
85
86
|
import { CommandHandler } from './matterbridgeEndpointCommandHandler.js';
|
|
86
|
-
import { addClusterClients, addClusterServers, addFixedLabel, addOptionalClusterClients, addOptionalClusterServers, addRequiredClusterClients, addRequiredClusterServers, addUserLabel, checkNotLatinCharacters, createUniqueId, defaultFor, featuresFor, generateUniqueId, getApparentElectricalPowerMeasurementClusterServer, getAttribute, getAttributeId, getBehavior, getBehaviourTypesFromClusterClientIds, getBehaviourTypesFromClusterServerIds, getCluster, getClusterId, getDefaultDeviceEnergyManagementClusterServer, getDefaultDeviceEnergyManagementModeClusterServer, getDefaultElectricalEnergyMeasurementClusterServer, getDefaultElectricalPowerMeasurementClusterServer, getDefaultFlowMeasurementClusterServer, getDefaultIlluminanceMeasurementClusterServer, getDefaultOccupancySensingClusterServer, getDefaultOperationalStateClusterServer, getDefaultPowerSourceBatteryClusterServer, getDefaultPowerSourceRechargeableBatteryClusterServer, getDefaultPowerSourceReplaceableBatteryClusterServer, getDefaultPowerSourceWiredClusterServer, getDefaultPressureMeasurementClusterServer, getDefaultRelativeHumidityMeasurementClusterServer, getDefaultTemperatureMeasurementClusterServer, invokeBehaviorCommand, lowercaseFirstLetter, setAttribute, setCluster, subscribeAttribute, triggerEvent, updateAttribute, } from './matterbridgeEndpointHelpers.js';
|
|
87
|
+
import { addClusterClients, addClusterServers, addFixedLabel, addOptionalClusterClients, addOptionalClusterServers, addRequiredClusterClients, addRequiredClusterServers, addUserLabel, checkNotLatinCharacters, createUniqueId, defaultFor, featuresFor, generateUniqueId, getApparentElectricalPowerMeasurementClusterServer, getAttribute, getAttributeId, getBehavior, getBehaviourTypesFromClusterClientIds, getBehaviourTypesFromClusterServerIds, getCluster, getClusterId, getDefaultDeviceEnergyManagementClusterServer, getDefaultDeviceEnergyManagementModeClusterServer, getDefaultElectricalEnergyMeasurementClusterServer, getDefaultElectricalPowerMeasurementClusterServer, getDefaultFlowMeasurementClusterServer, getDefaultIlluminanceMeasurementClusterServer, getDefaultOccupancySensingClusterServer, getDefaultOperationalStateClusterServer, getDefaultPowerSourceBatteryClusterServer, getDefaultPowerSourceRechargeableBatteryClusterServer, getDefaultPowerSourceReplaceableBatteryClusterServer, getDefaultPowerSourceWiredClusterServer, getDefaultPressureMeasurementClusterServer, getDefaultRelativeHumidityMeasurementClusterServer, getDefaultSoilMeasurementClusterServer, getDefaultTemperatureMeasurementClusterServer, invokeBehaviorCommand, lowercaseFirstLetter, setAttribute, setCluster, subscribeAttribute, triggerEvent, updateAttribute, } from './matterbridgeEndpointHelpers.js';
|
|
87
88
|
const MATTERBRIDGE_ENDPOINT_BRAND = Symbol('MatterbridgeEndpoint.brand');
|
|
88
89
|
export function isMatterbridgeEndpoint(value) {
|
|
89
90
|
if (!value || typeof value !== 'object')
|
|
@@ -1379,6 +1380,10 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1379
1380
|
this.behaviors.require(OccupancySensingServer.with(OccupancySensing.Feature.PassiveInfrared), getDefaultOccupancySensingClusterServer(occupied, holdTime, holdTimeMin, holdTimeMax));
|
|
1380
1381
|
return this;
|
|
1381
1382
|
}
|
|
1383
|
+
createDefaultSoilMeasurementClusterServer(soilMoistureMeasuredValue = null, soilMoistureMeasurementLimits) {
|
|
1384
|
+
this.behaviors.require(SoilMeasurementServer, getDefaultSoilMeasurementClusterServer(soilMoistureMeasuredValue, soilMoistureMeasurementLimits));
|
|
1385
|
+
return this;
|
|
1386
|
+
}
|
|
1382
1387
|
createDefaultAirQualityClusterServer(airQuality = AirQuality.AirQualityEnum.Unknown) {
|
|
1383
1388
|
this.behaviors.require(AirQualityServer.with(AirQuality.Feature.Fair, AirQuality.Feature.Moderate, AirQuality.Feature.VeryPoor, AirQuality.Feature.ExtremelyPoor), {
|
|
1384
1389
|
airQuality,
|
|
@@ -14,9 +14,10 @@ import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
|
14
14
|
import { PowerSource } from '@matter/types/clusters/power-source';
|
|
15
15
|
import { PressureMeasurement } from '@matter/types/clusters/pressure-measurement';
|
|
16
16
|
import { RelativeHumidityMeasurement } from '@matter/types/clusters/relative-humidity-measurement';
|
|
17
|
+
import { SoilMeasurement } from '@matter/types/clusters/soil-measurement';
|
|
17
18
|
import { TemperatureMeasurement } from '@matter/types/clusters/temperature-measurement';
|
|
18
19
|
import { ClusterId, VendorId } from '@matter/types/datatype';
|
|
19
|
-
import { Semtag } from '@matter/types/globals';
|
|
20
|
+
import { MeasurementAccuracy, Semtag } from '@matter/types/globals';
|
|
20
21
|
import { AnsiLogger } from 'node-ansi-logger';
|
|
21
22
|
import { MatterbridgeDeviceEnergyManagementModeServer } from './behaviors/deviceEnergyManagementModeServer.js';
|
|
22
23
|
import { MatterbridgeDeviceEnergyManagementServer } from './behaviors/deviceEnergyManagementServer.js';
|
|
@@ -72,13 +73,13 @@ export declare function getDefaultPowerSourceBatteryClusterServer(batPercentRema
|
|
|
72
73
|
rechargeable: false;
|
|
73
74
|
replaceable: false;
|
|
74
75
|
}>, typeof MatterbridgePowerSourceServer>>;
|
|
75
|
-
export declare function getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining?: number, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number, batReplacementDescription?: string, batQuantity?: number, batReplaceability?: PowerSource.BatReplaceability): Partial<import("@matter/node").ClusterState.Type<ClusterType.WithSupportedFeatures<PowerSource, {
|
|
76
|
+
export declare function getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining?: number | null, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number | null, batReplacementDescription?: string, batQuantity?: number, batReplaceability?: PowerSource.BatReplaceability): Partial<import("@matter/node").ClusterState.Type<ClusterType.WithSupportedFeatures<PowerSource, {
|
|
76
77
|
wired: false;
|
|
77
78
|
battery: true;
|
|
78
79
|
rechargeable: false;
|
|
79
80
|
replaceable: true;
|
|
80
81
|
}>, typeof MatterbridgePowerSourceServer>>;
|
|
81
|
-
export declare function getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining?: number, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number, batReplaceability?: PowerSource.BatReplaceability): Partial<import("@matter/node").ClusterState.Type<ClusterType.WithSupportedFeatures<PowerSource, {
|
|
82
|
+
export declare function getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining?: number | null, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number | null, batReplaceability?: PowerSource.BatReplaceability): Partial<import("@matter/node").ClusterState.Type<ClusterType.WithSupportedFeatures<PowerSource, {
|
|
82
83
|
wired: false;
|
|
83
84
|
battery: true;
|
|
84
85
|
rechargeable: true;
|
|
@@ -142,3 +143,4 @@ export declare function getDefaultOccupancySensingClusterServer(occupied?: boole
|
|
|
142
143
|
rfSensing: false;
|
|
143
144
|
vision: false;
|
|
144
145
|
}>, typeof OccupancySensingServer>>;
|
|
146
|
+
export declare function getDefaultSoilMeasurementClusterServer(soilMoistureMeasuredValue?: number | null, soilMoistureMeasurementLimits?: MeasurementAccuracy): Partial<import("@matter/node").ClusterState.Type<SoilMeasurement, typeof ClusterBehavior>>;
|
|
@@ -38,6 +38,7 @@ import { PumpConfigurationAndControlClient, PumpConfigurationAndControlServer }
|
|
|
38
38
|
import { RadonConcentrationMeasurementServer } from '@matter/node/behaviors/radon-concentration-measurement';
|
|
39
39
|
import { RelativeHumidityMeasurementClient, RelativeHumidityMeasurementServer } from '@matter/node/behaviors/relative-humidity-measurement';
|
|
40
40
|
import { ScenesManagementClient, ScenesManagementServer } from '@matter/node/behaviors/scenes-management';
|
|
41
|
+
import { SoilMeasurementServer } from '@matter/node/behaviors/soil-measurement';
|
|
41
42
|
import { SwitchServer } from '@matter/node/behaviors/switch';
|
|
42
43
|
import { TemperatureMeasurementClient, TemperatureMeasurementServer } from '@matter/node/behaviors/temperature-measurement';
|
|
43
44
|
import { ThermostatClient } from '@matter/node/behaviors/thermostat';
|
|
@@ -86,6 +87,7 @@ import { RadonConcentrationMeasurement } from '@matter/types/clusters/radon-conc
|
|
|
86
87
|
import { RelativeHumidityMeasurement } from '@matter/types/clusters/relative-humidity-measurement';
|
|
87
88
|
import { ScenesManagement } from '@matter/types/clusters/scenes-management';
|
|
88
89
|
import { SmokeCoAlarm } from '@matter/types/clusters/smoke-co-alarm';
|
|
90
|
+
import { SoilMeasurement } from '@matter/types/clusters/soil-measurement';
|
|
89
91
|
import { Switch } from '@matter/types/clusters/switch';
|
|
90
92
|
import { TemperatureMeasurement } from '@matter/types/clusters/temperature-measurement';
|
|
91
93
|
import { Thermostat } from '@matter/types/clusters/thermostat';
|
|
@@ -240,95 +242,97 @@ export function getBehaviourTypesFromClusterClientIds(clusterClientList) {
|
|
|
240
242
|
return behaviorTypes;
|
|
241
243
|
}
|
|
242
244
|
export function getBehaviourTypeFromClusterServerId(clusterId) {
|
|
243
|
-
if (clusterId === PowerSource.
|
|
245
|
+
if (clusterId === PowerSource.id)
|
|
244
246
|
return PowerSourceServer.with(PowerSource.Feature.Wired);
|
|
245
|
-
if (clusterId === UserLabel.
|
|
247
|
+
if (clusterId === UserLabel.id)
|
|
246
248
|
return UserLabelServer;
|
|
247
|
-
if (clusterId === FixedLabel.
|
|
249
|
+
if (clusterId === FixedLabel.id)
|
|
248
250
|
return FixedLabelServer;
|
|
249
|
-
if (clusterId === BasicInformation.
|
|
251
|
+
if (clusterId === BasicInformation.id)
|
|
250
252
|
return BasicInformationServer;
|
|
251
|
-
if (clusterId === BridgedDeviceBasicInformation.
|
|
253
|
+
if (clusterId === BridgedDeviceBasicInformation.id)
|
|
252
254
|
return BridgedDeviceBasicInformationServer;
|
|
253
|
-
if (clusterId === Identify.
|
|
255
|
+
if (clusterId === Identify.id)
|
|
254
256
|
return MatterbridgeIdentifyServer;
|
|
255
|
-
if (clusterId === Groups.
|
|
257
|
+
if (clusterId === Groups.id)
|
|
256
258
|
return GroupsServer;
|
|
257
|
-
if (clusterId === ScenesManagement.
|
|
259
|
+
if (clusterId === ScenesManagement.id)
|
|
258
260
|
return ScenesManagementServer;
|
|
259
|
-
if (clusterId === OnOff.
|
|
261
|
+
if (clusterId === OnOff.id)
|
|
260
262
|
return MatterbridgeOnOffServer.with('Lighting');
|
|
261
|
-
if (clusterId === LevelControl.
|
|
263
|
+
if (clusterId === LevelControl.id)
|
|
262
264
|
return MatterbridgeLevelControlServer.with('OnOff', 'Lighting');
|
|
263
|
-
if (clusterId === ColorControl.
|
|
265
|
+
if (clusterId === ColorControl.id)
|
|
264
266
|
return MatterbridgeColorControlServer;
|
|
265
|
-
if (clusterId === WindowCovering.
|
|
267
|
+
if (clusterId === WindowCovering.id)
|
|
266
268
|
return MatterbridgeWindowCoveringServer.with('Lift', 'PositionAwareLift');
|
|
267
|
-
if (clusterId === Thermostat.
|
|
269
|
+
if (clusterId === Thermostat.id)
|
|
268
270
|
return MatterbridgeThermostatServer.with('AutoMode', 'Heating', 'Cooling');
|
|
269
|
-
if (clusterId === FanControl.
|
|
271
|
+
if (clusterId === FanControl.id)
|
|
270
272
|
return MatterbridgeFanControlServer;
|
|
271
|
-
if (clusterId === DoorLock.
|
|
273
|
+
if (clusterId === DoorLock.id)
|
|
272
274
|
return MatterbridgeDoorLockServer;
|
|
273
|
-
if (clusterId === ModeSelect.
|
|
275
|
+
if (clusterId === ModeSelect.id)
|
|
274
276
|
return MatterbridgeModeSelectServer;
|
|
275
|
-
if (clusterId === ValveConfigurationAndControl.
|
|
277
|
+
if (clusterId === ValveConfigurationAndControl.id)
|
|
276
278
|
return MatterbridgeValveConfigurationAndControlServer.with('Level');
|
|
277
|
-
if (clusterId === PumpConfigurationAndControl.
|
|
279
|
+
if (clusterId === PumpConfigurationAndControl.id)
|
|
278
280
|
return PumpConfigurationAndControlServer.with('ConstantSpeed');
|
|
279
|
-
if (clusterId === SmokeCoAlarm.
|
|
281
|
+
if (clusterId === SmokeCoAlarm.id)
|
|
280
282
|
return MatterbridgeSmokeCoAlarmServer.with('SmokeAlarm', 'CoAlarm');
|
|
281
|
-
if (clusterId === Switch.
|
|
283
|
+
if (clusterId === Switch.id)
|
|
282
284
|
return SwitchServer.with('MomentarySwitch', 'MomentarySwitchRelease', 'MomentarySwitchLongPress', 'MomentarySwitchMultiPress');
|
|
283
|
-
if (clusterId === OperationalState.
|
|
285
|
+
if (clusterId === OperationalState.id)
|
|
284
286
|
return MatterbridgeOperationalStateServer;
|
|
285
|
-
if (clusterId === BooleanState.
|
|
287
|
+
if (clusterId === BooleanState.id)
|
|
286
288
|
return BooleanStateServer.enable({ events: { stateChange: true } });
|
|
287
|
-
if (clusterId === BooleanStateConfiguration.
|
|
289
|
+
if (clusterId === BooleanStateConfiguration.id)
|
|
288
290
|
return MatterbridgeBooleanStateConfigurationServer;
|
|
289
|
-
if (clusterId === PowerTopology.
|
|
291
|
+
if (clusterId === PowerTopology.id)
|
|
290
292
|
return PowerTopologyServer.with('TreeTopology');
|
|
291
|
-
if (clusterId === ElectricalPowerMeasurement.
|
|
293
|
+
if (clusterId === ElectricalPowerMeasurement.id)
|
|
292
294
|
return ElectricalPowerMeasurementServer.with('AlternatingCurrent');
|
|
293
|
-
if (clusterId === ElectricalEnergyMeasurement.
|
|
295
|
+
if (clusterId === ElectricalEnergyMeasurement.id)
|
|
294
296
|
return ElectricalEnergyMeasurementServer.with('ImportedEnergy', 'ExportedEnergy', 'CumulativeEnergy');
|
|
295
|
-
if (clusterId === TemperatureMeasurement.
|
|
297
|
+
if (clusterId === TemperatureMeasurement.id)
|
|
296
298
|
return TemperatureMeasurementServer;
|
|
297
|
-
if (clusterId === RelativeHumidityMeasurement.
|
|
299
|
+
if (clusterId === RelativeHumidityMeasurement.id)
|
|
298
300
|
return RelativeHumidityMeasurementServer;
|
|
299
|
-
if (clusterId === PressureMeasurement.
|
|
301
|
+
if (clusterId === PressureMeasurement.id)
|
|
300
302
|
return PressureMeasurementServer;
|
|
301
|
-
if (clusterId === FlowMeasurement.
|
|
303
|
+
if (clusterId === FlowMeasurement.id)
|
|
302
304
|
return FlowMeasurementServer;
|
|
303
|
-
if (clusterId === IlluminanceMeasurement.
|
|
305
|
+
if (clusterId === IlluminanceMeasurement.id)
|
|
304
306
|
return IlluminanceMeasurementServer;
|
|
305
|
-
if (clusterId === OccupancySensing.
|
|
307
|
+
if (clusterId === OccupancySensing.id)
|
|
306
308
|
return OccupancySensingServer;
|
|
307
|
-
if (clusterId ===
|
|
309
|
+
if (clusterId === SoilMeasurement.id)
|
|
310
|
+
return SoilMeasurementServer;
|
|
311
|
+
if (clusterId === AirQuality.id)
|
|
308
312
|
return AirQualityServer.with('Fair', 'Moderate', 'VeryPoor', 'ExtremelyPoor');
|
|
309
|
-
if (clusterId === CarbonMonoxideConcentrationMeasurement.
|
|
313
|
+
if (clusterId === CarbonMonoxideConcentrationMeasurement.id)
|
|
310
314
|
return CarbonMonoxideConcentrationMeasurementServer.with('NumericMeasurement');
|
|
311
|
-
if (clusterId === CarbonDioxideConcentrationMeasurement.
|
|
315
|
+
if (clusterId === CarbonDioxideConcentrationMeasurement.id)
|
|
312
316
|
return CarbonDioxideConcentrationMeasurementServer.with('NumericMeasurement');
|
|
313
|
-
if (clusterId === NitrogenDioxideConcentrationMeasurement.
|
|
317
|
+
if (clusterId === NitrogenDioxideConcentrationMeasurement.id)
|
|
314
318
|
return NitrogenDioxideConcentrationMeasurementServer.with('NumericMeasurement');
|
|
315
|
-
if (clusterId === OzoneConcentrationMeasurement.
|
|
319
|
+
if (clusterId === OzoneConcentrationMeasurement.id)
|
|
316
320
|
return OzoneConcentrationMeasurementServer.with('NumericMeasurement');
|
|
317
|
-
if (clusterId === FormaldehydeConcentrationMeasurement.
|
|
321
|
+
if (clusterId === FormaldehydeConcentrationMeasurement.id)
|
|
318
322
|
return FormaldehydeConcentrationMeasurementServer.with('NumericMeasurement');
|
|
319
|
-
if (clusterId === Pm1ConcentrationMeasurement.
|
|
323
|
+
if (clusterId === Pm1ConcentrationMeasurement.id)
|
|
320
324
|
return Pm1ConcentrationMeasurementServer.with('NumericMeasurement');
|
|
321
|
-
if (clusterId === Pm25ConcentrationMeasurement.
|
|
325
|
+
if (clusterId === Pm25ConcentrationMeasurement.id)
|
|
322
326
|
return Pm25ConcentrationMeasurementServer.with('NumericMeasurement');
|
|
323
|
-
if (clusterId === Pm10ConcentrationMeasurement.
|
|
327
|
+
if (clusterId === Pm10ConcentrationMeasurement.id)
|
|
324
328
|
return Pm10ConcentrationMeasurementServer.with('NumericMeasurement');
|
|
325
|
-
if (clusterId === RadonConcentrationMeasurement.
|
|
329
|
+
if (clusterId === RadonConcentrationMeasurement.id)
|
|
326
330
|
return RadonConcentrationMeasurementServer.with('NumericMeasurement');
|
|
327
|
-
if (clusterId === TotalVolatileOrganicCompoundsConcentrationMeasurement.
|
|
331
|
+
if (clusterId === TotalVolatileOrganicCompoundsConcentrationMeasurement.id)
|
|
328
332
|
return TotalVolatileOrganicCompoundsConcentrationMeasurementServer.with('NumericMeasurement');
|
|
329
|
-
if (clusterId === DeviceEnergyManagement.
|
|
333
|
+
if (clusterId === DeviceEnergyManagement.id)
|
|
330
334
|
return MatterbridgeDeviceEnergyManagementServer.with('PowerForecastReporting');
|
|
331
|
-
if (clusterId === DeviceEnergyManagementMode.
|
|
335
|
+
if (clusterId === DeviceEnergyManagementMode.id)
|
|
332
336
|
return MatterbridgeDeviceEnergyManagementModeServer;
|
|
333
337
|
return MatterbridgeIdentifyServer;
|
|
334
338
|
}
|
|
@@ -469,85 +473,87 @@ export function addOptionalClusterServers(endpoint) {
|
|
|
469
473
|
addClusterServers(endpoint, optionalServerList);
|
|
470
474
|
}
|
|
471
475
|
export function addClusterServers(endpoint, serverList) {
|
|
472
|
-
if (serverList.includes(PowerSource.
|
|
476
|
+
if (serverList.includes(PowerSource.id))
|
|
473
477
|
endpoint.createDefaultPowerSourceWiredClusterServer();
|
|
474
|
-
if (serverList.includes(Identify.
|
|
478
|
+
if (serverList.includes(Identify.id))
|
|
475
479
|
endpoint.createDefaultIdentifyClusterServer();
|
|
476
|
-
if (serverList.includes(Groups.
|
|
480
|
+
if (serverList.includes(Groups.id))
|
|
477
481
|
endpoint.createDefaultGroupsClusterServer();
|
|
478
|
-
if (serverList.includes(ScenesManagement.
|
|
482
|
+
if (serverList.includes(ScenesManagement.id))
|
|
479
483
|
endpoint.createDefaultScenesManagementClusterServer();
|
|
480
|
-
if (serverList.includes(OnOff.
|
|
484
|
+
if (serverList.includes(OnOff.id))
|
|
481
485
|
endpoint.createDefaultOnOffClusterServer();
|
|
482
|
-
if (serverList.includes(LevelControl.
|
|
486
|
+
if (serverList.includes(LevelControl.id))
|
|
483
487
|
endpoint.createDefaultLevelControlClusterServer();
|
|
484
|
-
if (serverList.includes(ColorControl.
|
|
488
|
+
if (serverList.includes(ColorControl.id))
|
|
485
489
|
endpoint.createDefaultColorControlClusterServer();
|
|
486
|
-
if (serverList.includes(WindowCovering.
|
|
490
|
+
if (serverList.includes(WindowCovering.id))
|
|
487
491
|
endpoint.createDefaultWindowCoveringClusterServer();
|
|
488
|
-
if (serverList.includes(Thermostat.
|
|
492
|
+
if (serverList.includes(Thermostat.id))
|
|
489
493
|
endpoint.createDefaultThermostatClusterServer();
|
|
490
|
-
if (serverList.includes(FanControl.
|
|
494
|
+
if (serverList.includes(FanControl.id))
|
|
491
495
|
endpoint.createDefaultFanControlClusterServer();
|
|
492
|
-
if (serverList.includes(DoorLock.
|
|
496
|
+
if (serverList.includes(DoorLock.id))
|
|
493
497
|
endpoint.createDefaultDoorLockClusterServer();
|
|
494
|
-
if (serverList.includes(ValveConfigurationAndControl.
|
|
498
|
+
if (serverList.includes(ValveConfigurationAndControl.id))
|
|
495
499
|
endpoint.createDefaultValveConfigurationAndControlClusterServer();
|
|
496
|
-
if (serverList.includes(PumpConfigurationAndControl.
|
|
500
|
+
if (serverList.includes(PumpConfigurationAndControl.id))
|
|
497
501
|
endpoint.createDefaultPumpConfigurationAndControlClusterServer();
|
|
498
|
-
if (serverList.includes(SmokeCoAlarm.
|
|
502
|
+
if (serverList.includes(SmokeCoAlarm.id))
|
|
499
503
|
endpoint.createDefaultSmokeCOAlarmClusterServer();
|
|
500
|
-
if (serverList.includes(Switch.
|
|
504
|
+
if (serverList.includes(Switch.id))
|
|
501
505
|
endpoint.createDefaultSwitchClusterServer();
|
|
502
|
-
if (serverList.includes(OperationalState.
|
|
506
|
+
if (serverList.includes(OperationalState.id))
|
|
503
507
|
endpoint.createDefaultOperationalStateClusterServer();
|
|
504
|
-
if (serverList.includes(BooleanState.
|
|
508
|
+
if (serverList.includes(BooleanState.id))
|
|
505
509
|
endpoint.createDefaultBooleanStateClusterServer();
|
|
506
|
-
if (serverList.includes(BooleanStateConfiguration.
|
|
510
|
+
if (serverList.includes(BooleanStateConfiguration.id))
|
|
507
511
|
endpoint.createDefaultBooleanStateConfigurationClusterServer();
|
|
508
|
-
if (serverList.includes(PowerTopology.
|
|
512
|
+
if (serverList.includes(PowerTopology.id))
|
|
509
513
|
endpoint.createDefaultPowerTopologyClusterServer();
|
|
510
|
-
if (serverList.includes(ElectricalPowerMeasurement.
|
|
514
|
+
if (serverList.includes(ElectricalPowerMeasurement.id))
|
|
511
515
|
endpoint.createDefaultElectricalPowerMeasurementClusterServer();
|
|
512
|
-
if (serverList.includes(ElectricalEnergyMeasurement.
|
|
516
|
+
if (serverList.includes(ElectricalEnergyMeasurement.id))
|
|
513
517
|
endpoint.createDefaultElectricalEnergyMeasurementClusterServer();
|
|
514
|
-
if (serverList.includes(TemperatureMeasurement.
|
|
518
|
+
if (serverList.includes(TemperatureMeasurement.id))
|
|
515
519
|
endpoint.createDefaultTemperatureMeasurementClusterServer();
|
|
516
|
-
if (serverList.includes(RelativeHumidityMeasurement.
|
|
520
|
+
if (serverList.includes(RelativeHumidityMeasurement.id))
|
|
517
521
|
endpoint.createDefaultRelativeHumidityMeasurementClusterServer();
|
|
518
|
-
if (serverList.includes(PressureMeasurement.
|
|
522
|
+
if (serverList.includes(PressureMeasurement.id))
|
|
519
523
|
endpoint.createDefaultPressureMeasurementClusterServer();
|
|
520
|
-
if (serverList.includes(FlowMeasurement.
|
|
524
|
+
if (serverList.includes(FlowMeasurement.id))
|
|
521
525
|
endpoint.createDefaultFlowMeasurementClusterServer();
|
|
522
|
-
if (serverList.includes(IlluminanceMeasurement.
|
|
526
|
+
if (serverList.includes(IlluminanceMeasurement.id))
|
|
523
527
|
endpoint.createDefaultIlluminanceMeasurementClusterServer();
|
|
524
|
-
if (serverList.includes(OccupancySensing.
|
|
528
|
+
if (serverList.includes(OccupancySensing.id))
|
|
525
529
|
endpoint.createDefaultOccupancySensingClusterServer();
|
|
526
|
-
if (serverList.includes(
|
|
530
|
+
if (serverList.includes(SoilMeasurement.id))
|
|
531
|
+
endpoint.createDefaultSoilMeasurementClusterServer();
|
|
532
|
+
if (serverList.includes(AirQuality.id))
|
|
527
533
|
endpoint.createDefaultAirQualityClusterServer();
|
|
528
|
-
if (serverList.includes(CarbonMonoxideConcentrationMeasurement.
|
|
534
|
+
if (serverList.includes(CarbonMonoxideConcentrationMeasurement.id))
|
|
529
535
|
endpoint.createDefaultCarbonMonoxideConcentrationMeasurementClusterServer();
|
|
530
|
-
if (serverList.includes(CarbonDioxideConcentrationMeasurement.
|
|
536
|
+
if (serverList.includes(CarbonDioxideConcentrationMeasurement.id))
|
|
531
537
|
endpoint.createDefaultCarbonDioxideConcentrationMeasurementClusterServer();
|
|
532
|
-
if (serverList.includes(NitrogenDioxideConcentrationMeasurement.
|
|
538
|
+
if (serverList.includes(NitrogenDioxideConcentrationMeasurement.id))
|
|
533
539
|
endpoint.createDefaultNitrogenDioxideConcentrationMeasurementClusterServer();
|
|
534
|
-
if (serverList.includes(OzoneConcentrationMeasurement.
|
|
540
|
+
if (serverList.includes(OzoneConcentrationMeasurement.id))
|
|
535
541
|
endpoint.createDefaultOzoneConcentrationMeasurementClusterServer();
|
|
536
|
-
if (serverList.includes(FormaldehydeConcentrationMeasurement.
|
|
542
|
+
if (serverList.includes(FormaldehydeConcentrationMeasurement.id))
|
|
537
543
|
endpoint.createDefaultFormaldehydeConcentrationMeasurementClusterServer();
|
|
538
|
-
if (serverList.includes(Pm1ConcentrationMeasurement.
|
|
544
|
+
if (serverList.includes(Pm1ConcentrationMeasurement.id))
|
|
539
545
|
endpoint.createDefaultPm1ConcentrationMeasurementClusterServer();
|
|
540
|
-
if (serverList.includes(Pm25ConcentrationMeasurement.
|
|
546
|
+
if (serverList.includes(Pm25ConcentrationMeasurement.id))
|
|
541
547
|
endpoint.createDefaultPm25ConcentrationMeasurementClusterServer();
|
|
542
|
-
if (serverList.includes(Pm10ConcentrationMeasurement.
|
|
548
|
+
if (serverList.includes(Pm10ConcentrationMeasurement.id))
|
|
543
549
|
endpoint.createDefaultPm10ConcentrationMeasurementClusterServer();
|
|
544
|
-
if (serverList.includes(RadonConcentrationMeasurement.
|
|
550
|
+
if (serverList.includes(RadonConcentrationMeasurement.id))
|
|
545
551
|
endpoint.createDefaultRadonConcentrationMeasurementClusterServer();
|
|
546
|
-
if (serverList.includes(TotalVolatileOrganicCompoundsConcentrationMeasurement.
|
|
552
|
+
if (serverList.includes(TotalVolatileOrganicCompoundsConcentrationMeasurement.id))
|
|
547
553
|
endpoint.createDefaultTvocMeasurementClusterServer();
|
|
548
|
-
if (serverList.includes(DeviceEnergyManagement.
|
|
554
|
+
if (serverList.includes(DeviceEnergyManagement.id))
|
|
549
555
|
endpoint.createDefaultDeviceEnergyManagementClusterServer();
|
|
550
|
-
if (serverList.includes(DeviceEnergyManagementMode.
|
|
556
|
+
if (serverList.includes(DeviceEnergyManagementMode.id))
|
|
551
557
|
endpoint.createDefaultDeviceEnergyManagementModeClusterServer();
|
|
552
558
|
}
|
|
553
559
|
export function addClusterClients(endpoint, clientList) {
|
|
@@ -602,7 +608,7 @@ export function addOptionalClusterClients(endpoint) {
|
|
|
602
608
|
addClusterClients(endpoint, optionalClientList);
|
|
603
609
|
}
|
|
604
610
|
export async function addFixedLabel(endpoint, label, value) {
|
|
605
|
-
if (!endpoint.hasClusterServer(FixedLabel.
|
|
611
|
+
if (!endpoint.hasClusterServer(FixedLabel.id)) {
|
|
606
612
|
endpoint.log.debug(`addFixedLabel: add cluster ${hk}FixedLabel${db}:${hk}fixedLabel${db} with label ${CYAN}${label}${db} value ${CYAN}${value}${db}`);
|
|
607
613
|
endpoint.behaviors.require(FixedLabelServer, {
|
|
608
614
|
labelList: [{ label: label.substring(0, 16), value: value.substring(0, 16) }],
|
|
@@ -610,15 +616,15 @@ export async function addFixedLabel(endpoint, label, value) {
|
|
|
610
616
|
return;
|
|
611
617
|
}
|
|
612
618
|
endpoint.log.debug(`addFixedLabel: add label ${CYAN}${label}${db} value ${CYAN}${value}${db}`);
|
|
613
|
-
let labelList = endpoint.getAttribute(FixedLabel.
|
|
619
|
+
let labelList = endpoint.getAttribute(FixedLabel.id, 'labelList', endpoint.log);
|
|
614
620
|
if (isValidArray(labelList)) {
|
|
615
621
|
labelList = labelList.filter((entry) => entry.label !== label.substring(0, 16));
|
|
616
622
|
labelList.push({ label: label.substring(0, 16), value: value.substring(0, 16) });
|
|
617
|
-
await endpoint.setAttribute(FixedLabel.
|
|
623
|
+
await endpoint.setAttribute(FixedLabel.id, 'labelList', labelList, endpoint.log);
|
|
618
624
|
}
|
|
619
625
|
}
|
|
620
626
|
export async function addUserLabel(endpoint, label, value) {
|
|
621
|
-
if (!endpoint.hasClusterServer(UserLabel.
|
|
627
|
+
if (!endpoint.hasClusterServer(UserLabel.id)) {
|
|
622
628
|
endpoint.log.debug(`addUserLabel: add cluster ${hk}UserLabel${db}:${hk}userLabel${db} with label ${CYAN}${label}${db} value ${CYAN}${value}${db}`);
|
|
623
629
|
endpoint.behaviors.require(UserLabelServer, {
|
|
624
630
|
labelList: [{ label: label.substring(0, 16), value: value.substring(0, 16) }],
|
|
@@ -626,11 +632,11 @@ export async function addUserLabel(endpoint, label, value) {
|
|
|
626
632
|
return;
|
|
627
633
|
}
|
|
628
634
|
endpoint.log.debug(`addUserLabel: add label ${CYAN}${label}${db} value ${CYAN}${value}${db}`);
|
|
629
|
-
let labelList = endpoint.getAttribute(UserLabel.
|
|
635
|
+
let labelList = endpoint.getAttribute(UserLabel.id, 'labelList', endpoint.log);
|
|
630
636
|
if (isValidArray(labelList)) {
|
|
631
637
|
labelList = labelList.filter((entry) => entry.label !== label.substring(0, 16));
|
|
632
638
|
labelList.push({ label: label.substring(0, 16), value: value.substring(0, 16) });
|
|
633
|
-
await endpoint.setAttribute(UserLabel.
|
|
639
|
+
await endpoint.setAttribute(UserLabel.id, 'labelList', labelList, endpoint.log);
|
|
634
640
|
}
|
|
635
641
|
}
|
|
636
642
|
export function getClusterId(endpoint, cluster) {
|
|
@@ -812,7 +818,7 @@ export function getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentR
|
|
|
812
818
|
description: 'Primary battery',
|
|
813
819
|
endpointList: [],
|
|
814
820
|
batVoltage,
|
|
815
|
-
batPercentRemaining: Math.min(Math.max(batPercentRemaining * 2, 0), 200),
|
|
821
|
+
batPercentRemaining: batPercentRemaining !== null ? Math.min(Math.max(batPercentRemaining * 2, 0), 200) : null,
|
|
816
822
|
batChargeLevel,
|
|
817
823
|
batReplacementNeeded: false,
|
|
818
824
|
batReplaceability,
|
|
@@ -828,7 +834,7 @@ export function getDefaultPowerSourceRechargeableBatteryClusterServer(batPercent
|
|
|
828
834
|
description: 'Primary battery',
|
|
829
835
|
endpointList: [],
|
|
830
836
|
batVoltage,
|
|
831
|
-
batPercentRemaining: Math.min(Math.max(batPercentRemaining * 2, 0), 200),
|
|
837
|
+
batPercentRemaining: batPercentRemaining !== null ? Math.min(Math.max(batPercentRemaining * 2, 0), 200) : null,
|
|
832
838
|
batTimeRemaining: null,
|
|
833
839
|
batChargeLevel,
|
|
834
840
|
batReplacementNeeded: false,
|
|
@@ -1040,3 +1046,15 @@ export function getDefaultOccupancySensingClusterServer(occupied = false, holdTi
|
|
|
1040
1046
|
holdTimeLimits: { holdTimeMin, holdTimeMax, holdTimeDefault: holdTime },
|
|
1041
1047
|
});
|
|
1042
1048
|
}
|
|
1049
|
+
export function getDefaultSoilMeasurementClusterServer(soilMoistureMeasuredValue = null, soilMoistureMeasurementLimits) {
|
|
1050
|
+
return optionsFor(SoilMeasurementServer, {
|
|
1051
|
+
soilMoistureMeasuredValue,
|
|
1052
|
+
soilMoistureMeasurementLimits: soilMoistureMeasurementLimits ?? {
|
|
1053
|
+
measurementType: MeasurementType.SoilMoisture,
|
|
1054
|
+
measured: true,
|
|
1055
|
+
minMeasuredValue: 0,
|
|
1056
|
+
maxMeasuredValue: 100,
|
|
1057
|
+
accuracyRanges: [{ rangeMin: 0, rangeMax: 100, fixedMax: 1 }],
|
|
1058
|
+
},
|
|
1059
|
+
});
|
|
1060
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.8.1-dev-
|
|
3
|
+
"version": "3.8.1-dev-20260609-37884d6",
|
|
4
4
|
"description": "Matterbridge core library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -129,16 +129,16 @@
|
|
|
129
129
|
"CHANGELOG.md"
|
|
130
130
|
],
|
|
131
131
|
"dependencies": {
|
|
132
|
-
"@matter/main": "0.17.
|
|
133
|
-
"@matterbridge/dgram": "3.8.1-dev-
|
|
134
|
-
"@matterbridge/thread": "3.8.1-dev-
|
|
135
|
-
"@matterbridge/types": "3.8.1-dev-
|
|
136
|
-
"@matterbridge/utils": "3.8.1-dev-
|
|
132
|
+
"@matter/main": "0.17.2-alpha.0-20260606-610f30128",
|
|
133
|
+
"@matterbridge/dgram": "3.8.1-dev-20260609-37884d6",
|
|
134
|
+
"@matterbridge/thread": "3.8.1-dev-20260609-37884d6",
|
|
135
|
+
"@matterbridge/types": "3.8.1-dev-20260609-37884d6",
|
|
136
|
+
"@matterbridge/utils": "3.8.1-dev-20260609-37884d6",
|
|
137
137
|
"escape-html": "1.0.3",
|
|
138
138
|
"express": "5.2.1",
|
|
139
139
|
"express-rate-limit": "8.5.2",
|
|
140
140
|
"multer": "2.1.1",
|
|
141
|
-
"node-ansi-logger": "3.3.0-dev-
|
|
141
|
+
"node-ansi-logger": "3.3.0-dev-20260607-585945a",
|
|
142
142
|
"node-persist-manager": "2.1.0-dev-20260524-6a6019a",
|
|
143
143
|
"ws": "8.21.0"
|
|
144
144
|
}
|