@matterbridge/core 3.7.10 → 3.8.0-dev-20260524-92c5fdd
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/activatedCarbonFilterMonitoringServer.d.ts +5 -2
- package/dist/behaviors/bindingServer.js +0 -2
- package/dist/behaviors/booleanStateConfigurationServer.d.ts +6 -1
- package/dist/behaviors/colorControlServer.d.ts +20 -774
- package/dist/behaviors/deviceEnergyManagementServer.d.ts +9 -299
- package/dist/behaviors/doorLockServer.d.ts +29 -47
- package/dist/behaviors/doorLockServer.js +11 -299
- package/dist/behaviors/fanControlServer.d.ts +8 -1
- package/dist/behaviors/hepaFilterMonitoringServer.d.ts +5 -2
- package/dist/behaviors/smokeCoAlarmServer.d.ts +4 -77
- package/dist/behaviors/thermostatServer.d.ts +20 -722
- package/dist/behaviors/valveConfigurationAndControlServer.d.ts +4 -1
- package/dist/behaviors/windowCoveringServer.d.ts +28 -564
- package/dist/clusters/closure-control.d.ts +130 -620
- package/dist/clusters/closure-control.js +15 -170
- package/dist/clusters/closure-dimension.d.ts +148 -814
- package/dist/clusters/closure-dimension.js +15 -202
- package/dist/clusters/export.d.ts +1 -3
- package/dist/clusters/export.js +1 -3
- package/dist/clusters/soil-measurement.d.ts +31 -31
- package/dist/clusters/soil-measurement.js +29 -19
- package/dist/devices/closure.d.ts +14 -291
- package/dist/devices/closure.js +6 -13
- package/dist/devices/closurePanel.d.ts +13 -370
- package/dist/devices/closurePanel.js +9 -15
- package/dist/devices/evse.d.ts +7 -1
- package/dist/devices/heatPump.js +5 -5
- package/dist/devices/irrigationSystem.js +2 -2
- package/dist/devices/microwaveOven.d.ts +5 -76
- package/dist/devices/roboticVacuumCleaner.js +5 -5
- package/dist/devices/soilSensor.d.ts +0 -15
- package/dist/devices/soilSensor.js +4 -20
- package/dist/devices/temperatureControl.d.ts +10 -130
- package/dist/helpers.js +0 -8
- package/dist/jestutils/jestBroadcastServerSpy.d.ts +2 -2
- package/dist/jestutils/jestMatterTest.js +4 -4
- package/dist/jestutils/jestMatterbridgeEndpointSpy.d.ts +34 -37
- package/dist/jestutils/jestMatterbridgePlatformSpy.d.ts +4 -4
- package/dist/jestutils/jestMatterbridgeTest.js +1 -1
- package/dist/matter/export.d.ts +11 -0
- package/dist/matter/export.js +11 -0
- package/dist/matterbridge.js +3 -1
- package/dist/matterbridgeDeviceTypes.d.ts +15 -0
- package/dist/matterbridgeDeviceTypes.js +305 -162
- package/dist/matterbridgeEndpoint.d.ts +35 -25
- package/dist/matterbridgeEndpoint.js +6 -7
- package/dist/matterbridgeEndpointCommandHandler.d.ts +3 -59
- package/dist/matterbridgeEndpointHelpers.d.ts +83 -1382
- package/dist/matterbridgeEndpointHelpers.js +20 -5
- package/package.json +6 -6
|
@@ -2,6 +2,7 @@ if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
|
2
2
|
console.log('\u001B[32mMatterbridgeEndpointHelpers loaded.\u001B[40;0m');
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
import { Lifecycle } from '@matter/general';
|
|
5
|
+
import { ClusterBehavior } from '@matter/node';
|
|
5
6
|
import { AirQualityServer } from '@matter/node/behaviors/air-quality';
|
|
6
7
|
import { BasicInformationServer } from '@matter/node/behaviors/basic-information';
|
|
7
8
|
import { BooleanStateServer } from '@matter/node/behaviors/boolean-state';
|
|
@@ -78,6 +79,7 @@ import { TotalVolatileOrganicCompoundsConcentrationMeasurement } from '@matter/t
|
|
|
78
79
|
import { UserLabel } from '@matter/types/clusters/user-label';
|
|
79
80
|
import { ValveConfigurationAndControl } from '@matter/types/clusters/valve-configuration-and-control';
|
|
80
81
|
import { WindowCovering } from '@matter/types/clusters/window-covering';
|
|
82
|
+
import { NodeId } from '@matter/types/datatype';
|
|
81
83
|
import { MeasurementType } from '@matter/types/globals';
|
|
82
84
|
import { deepEqual } from '@matterbridge/utils/deep-equal';
|
|
83
85
|
import { isValidArray } from '@matterbridge/utils/validate';
|
|
@@ -173,7 +175,9 @@ export function featuresFor(endpoint, cluster) {
|
|
|
173
175
|
return {};
|
|
174
176
|
}
|
|
175
177
|
const supportedBehavior = endpoint.behaviors.supported[lowercaseFirstLetter(behaviorId)];
|
|
176
|
-
|
|
178
|
+
if (!supportedBehavior || !ClusterBehavior.isType(supportedBehavior))
|
|
179
|
+
return {};
|
|
180
|
+
return supportedBehavior.features ?? {};
|
|
177
181
|
}
|
|
178
182
|
export async function internalFor(endpoint, cluster) {
|
|
179
183
|
const behaviorId = getBehavior(endpoint, cluster)?.id;
|
|
@@ -344,8 +348,17 @@ export async function invokeBehaviorCommand(endpoint, cluster, command, params)
|
|
|
344
348
|
invoked = false;
|
|
345
349
|
return;
|
|
346
350
|
}
|
|
347
|
-
|
|
348
|
-
|
|
351
|
+
void behavior?.['state'];
|
|
352
|
+
const injectedSubject = { kind: 'node', id: NodeId(100) };
|
|
353
|
+
const patchedContext = new Proxy(agent.context, { get: (t, k) => (k === 'fabric' ? 1 : k === 'subject' ? injectedSubject : Reflect.get(t, k, t)) });
|
|
354
|
+
Object.defineProperty(behavior, 'context', { configurable: true, value: patchedContext });
|
|
355
|
+
try {
|
|
356
|
+
const result = params === undefined ? handler.call(behavior) : handler.call(behavior, params);
|
|
357
|
+
await Promise.resolve(result);
|
|
358
|
+
}
|
|
359
|
+
finally {
|
|
360
|
+
delete behavior.context;
|
|
361
|
+
}
|
|
349
362
|
});
|
|
350
363
|
return invoked;
|
|
351
364
|
}
|
|
@@ -514,8 +527,10 @@ export function getClusterId(endpoint, cluster) {
|
|
|
514
527
|
return endpoint.behaviors.supported[lowercaseFirstLetter(cluster)]?.schema?.id;
|
|
515
528
|
}
|
|
516
529
|
export function getAttributeId(endpoint, cluster, attribute) {
|
|
517
|
-
const
|
|
518
|
-
|
|
530
|
+
const supportedBehavior = endpoint.behaviors.supported[lowercaseFirstLetter(cluster)];
|
|
531
|
+
if (!supportedBehavior || !ClusterBehavior.isType(supportedBehavior))
|
|
532
|
+
return undefined;
|
|
533
|
+
return supportedBehavior.schema.attributes(lowercaseFirstLetter(attribute))?.id;
|
|
519
534
|
}
|
|
520
535
|
export function getAttribute(endpoint, cluster, attribute, log) {
|
|
521
536
|
const clusterName = getBehavior(endpoint, cluster)?.id;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0-dev-20260524-92c5fdd",
|
|
4
4
|
"description": "Matterbridge core library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -129,11 +129,11 @@
|
|
|
129
129
|
"CHANGELOG.md"
|
|
130
130
|
],
|
|
131
131
|
"dependencies": {
|
|
132
|
-
"@matter/main": "0.
|
|
133
|
-
"@matterbridge/dgram": "3.
|
|
134
|
-
"@matterbridge/thread": "3.
|
|
135
|
-
"@matterbridge/types": "3.
|
|
136
|
-
"@matterbridge/utils": "3.
|
|
132
|
+
"@matter/main": "0.17.0",
|
|
133
|
+
"@matterbridge/dgram": "3.8.0-dev-20260524-92c5fdd",
|
|
134
|
+
"@matterbridge/thread": "3.8.0-dev-20260524-92c5fdd",
|
|
135
|
+
"@matterbridge/types": "3.8.0-dev-20260524-92c5fdd",
|
|
136
|
+
"@matterbridge/utils": "3.8.0-dev-20260524-92c5fdd",
|
|
137
137
|
"escape-html": "1.0.3",
|
|
138
138
|
"express": "5.2.1",
|
|
139
139
|
"express-rate-limit": "8.5.2",
|