@matterbridge/core 3.9.0 → 3.9.1-dev-20260614-18d1a2e
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/backend.js +2 -2
- package/dist/backendExpress.d.ts +1 -1
- package/dist/backendWsServer.d.ts +1 -1
- package/dist/behaviors/activatedCarbonFilterMonitoringServer.d.ts +1 -1
- package/dist/behaviors/bindingServer.d.ts +3 -3
- package/dist/behaviors/hepaFilterMonitoringServer.d.ts +1 -1
- package/dist/behaviors/identifyServer.d.ts +1 -1
- package/dist/behaviors/levelControlServer.d.ts +1 -1
- package/dist/behaviors/matterbridgeServer.d.ts +2 -2
- package/dist/behaviors/modeSelectServer.d.ts +1 -1
- package/dist/behaviors/operationalStateServer.d.ts +1 -1
- package/dist/behaviors/serviceAreaServer.d.ts +1 -1
- package/dist/behaviors/windowCoveringServer.d.ts +1 -1
- package/dist/cli.js +6 -6
- package/dist/clusters/closure-control.d.ts +3 -3
- package/dist/clusters/closure-dimension.d.ts +3 -3
- package/dist/clusters/soil-measurement.d.ts +2 -2
- package/dist/devices/basicVideoPlayer.js +3 -3
- package/dist/devices/cooktop.d.ts +1 -1
- package/dist/devices/dishwasher.d.ts +1 -1
- package/dist/devices/dishwasher.js +1 -1
- package/dist/devices/evse.d.ts +1 -1
- package/dist/devices/irrigationSystem.d.ts +1 -1
- package/dist/devices/laundryDryer.d.ts +1 -1
- package/dist/devices/laundryWasher.d.ts +1 -1
- package/dist/devices/laundryWasher.js +1 -1
- package/dist/devices/oven.d.ts +2 -2
- package/dist/devices/refrigerator.d.ts +2 -2
- package/dist/devices/roboticVacuumCleaner.d.ts +1 -1
- package/dist/devices/roboticVacuumCleaner.js +1 -1
- package/dist/devices/soilSensor.d.ts +1 -1
- package/dist/devices/solarPower.d.ts +1 -1
- package/dist/devices/temperatureControl.d.ts +1 -1
- package/dist/frontend.d.ts +1 -1
- package/dist/frontend.js +16 -17
- package/dist/helpers.d.ts +1 -1
- package/dist/helpers.js +0 -10
- package/dist/jestutils/jestBroadcastServerSpy.d.ts +13 -12
- package/dist/jestutils/jestBroadcastServerSpy.js +1 -1
- package/dist/jestutils/jestDeviceManagerSpy.d.ts +14 -13
- package/dist/jestutils/jestDeviceManagerSpy.js +1 -1
- package/dist/jestutils/jestFrontendSpy.d.ts +7 -9
- package/dist/jestutils/jestFrontendSpy.js +1 -1
- package/dist/jestutils/jestMatterTest.d.ts +5 -5
- package/dist/jestutils/jestMatterTest.js +4 -4
- package/dist/jestutils/jestMatterbridgeEndpointSpy.d.ts +6 -54
- package/dist/jestutils/jestMatterbridgeEndpointSpy.js +1 -1
- package/dist/jestutils/jestMatterbridgePlatformSpy.d.ts +43 -60
- package/dist/jestutils/jestMatterbridgePlatformSpy.js +1 -1
- package/dist/jestutils/jestMatterbridgeSpy.d.ts +5 -4
- package/dist/jestutils/jestMatterbridgeSpy.js +1 -1
- package/dist/jestutils/jestMatterbridgeTest.d.ts +3 -3
- package/dist/jestutils/jestMatterbridgeTest.js +1 -1
- package/dist/jestutils/jestPluginManagerSpy.d.ts +40 -47
- package/dist/jestutils/jestPluginManagerSpy.js +1 -1
- package/dist/jestutils/jestSetupTest.d.ts +0 -1
- package/dist/jestutils/logKeepAlives.d.ts +1 -1
- package/dist/jestutils/matterRequest.d.ts +1 -1
- package/dist/matterbridge.d.ts +6 -6
- package/dist/matterbridge.js +20 -21
- package/dist/matterbridgeAccessoryPlatform.d.ts +1 -1
- package/dist/matterbridgeDeviceTypes.d.ts +1 -1
- package/dist/matterbridgeDynamicPlatform.d.ts +1 -1
- package/dist/matterbridgeEndpoint.d.ts +10 -10
- package/dist/matterbridgeEndpoint.js +4 -4
- package/dist/matterbridgeEndpointCommandHandler.d.ts +39 -39
- package/dist/matterbridgeEndpointHelpers.d.ts +7 -7
- package/dist/matterbridgeEndpointHelpers.js +2 -3
- package/dist/matterbridgeEndpointTypes.d.ts +2 -2
- package/dist/matterbridgeFactory.d.ts +2 -2
- package/dist/matterbridgePlatform.d.ts +4 -4
- package/dist/pluginManager.d.ts +1 -1
- package/dist/pluginManager.js +3 -3
- package/package.json +5 -5
package/dist/matterbridge.js
CHANGED
|
@@ -252,7 +252,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
252
252
|
case 'matterbridge_start_plugin_server':
|
|
253
253
|
{
|
|
254
254
|
const plugin = this.plugins.get(msg.params.pluginName);
|
|
255
|
-
if (plugin
|
|
255
|
+
if (plugin?.serverNode)
|
|
256
256
|
await this.startServerNode(plugin.serverNode);
|
|
257
257
|
this.server.respond({ ...msg, result: { success: true } });
|
|
258
258
|
}
|
|
@@ -260,9 +260,9 @@ export class Matterbridge extends EventEmitter {
|
|
|
260
260
|
case 'matterbridge_stop_plugin_server':
|
|
261
261
|
{
|
|
262
262
|
const plugin = this.plugins.get(msg.params.pluginName);
|
|
263
|
-
if (plugin
|
|
263
|
+
if (plugin?.serverNode)
|
|
264
264
|
await this.stopServerNode(plugin.serverNode);
|
|
265
|
-
if (plugin
|
|
265
|
+
if (plugin?.serverNode)
|
|
266
266
|
plugin.serverNode = undefined;
|
|
267
267
|
this.server.respond({ ...msg, result: { success: true } });
|
|
268
268
|
}
|
|
@@ -270,7 +270,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
270
270
|
case 'matterbridge_start_device_server':
|
|
271
271
|
{
|
|
272
272
|
const device = this.devices.get(msg.params.deviceUniqueId);
|
|
273
|
-
if (device
|
|
273
|
+
if (device?.serverNode)
|
|
274
274
|
await this.startServerNode(device.serverNode);
|
|
275
275
|
this.server.respond({ ...msg, result: { success: true } });
|
|
276
276
|
}
|
|
@@ -278,9 +278,9 @@ export class Matterbridge extends EventEmitter {
|
|
|
278
278
|
case 'matterbridge_stop_device_server':
|
|
279
279
|
{
|
|
280
280
|
const device = this.devices.get(msg.params.deviceUniqueId);
|
|
281
|
-
if (device
|
|
281
|
+
if (device?.serverNode)
|
|
282
282
|
await this.stopServerNode(device.serverNode);
|
|
283
|
-
if (device
|
|
283
|
+
if (device?.serverNode)
|
|
284
284
|
device.serverNode = undefined;
|
|
285
285
|
this.server.respond({ ...msg, result: { success: true } });
|
|
286
286
|
}
|
|
@@ -295,7 +295,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
295
295
|
this.log.debug(`Received broadcast response ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}: ${debugStringify(msg)}${db}`);
|
|
296
296
|
switch (msg.type) {
|
|
297
297
|
case 'manager_spawn_response':
|
|
298
|
-
if (msg.result
|
|
298
|
+
if (msg.result?.success && msg.result.packageCommand === 'install') {
|
|
299
299
|
const packageName = msg.result.packageName.replace(/@.*$/, '');
|
|
300
300
|
if (packageName === 'matterbridge') {
|
|
301
301
|
this.log.info('Matterbridge has been updated. Full restart required.');
|
|
@@ -350,7 +350,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
350
350
|
this.log.error('Node storage manager health check failed');
|
|
351
351
|
this.log.debug('Creating node storage context for matterbridge');
|
|
352
352
|
this.nodeContext = await this.nodeStorage.createStorage('matterbridge');
|
|
353
|
-
const keys =
|
|
353
|
+
const keys = await this.nodeStorage.keys();
|
|
354
354
|
for (const key of keys) {
|
|
355
355
|
this.log.debug(`Checking node storage manager key: ${CYAN}${key}${db}`);
|
|
356
356
|
await this.nodeStorage.get(key);
|
|
@@ -544,7 +544,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
544
544
|
this.mdnsInterface = getParameter('mdnsinterface');
|
|
545
545
|
}
|
|
546
546
|
else {
|
|
547
|
-
this.mdnsInterface = await this.nodeContext.get('mattermdnsinterface'
|
|
547
|
+
this.mdnsInterface = await this.nodeContext.get('mattermdnsinterface');
|
|
548
548
|
if (this.mdnsInterface === '')
|
|
549
549
|
this.mdnsInterface = undefined;
|
|
550
550
|
}
|
|
@@ -564,14 +564,14 @@ export class Matterbridge extends EventEmitter {
|
|
|
564
564
|
this.ipv4Address = getParameter('ipv4address');
|
|
565
565
|
}
|
|
566
566
|
else {
|
|
567
|
-
this.ipv4Address = await this.nodeContext.get('matteripv4address'
|
|
567
|
+
this.ipv4Address = await this.nodeContext.get('matteripv4address');
|
|
568
568
|
if (this.ipv4Address === '')
|
|
569
569
|
this.ipv4Address = undefined;
|
|
570
570
|
}
|
|
571
571
|
if (this.ipv4Address) {
|
|
572
572
|
let isValid = false;
|
|
573
573
|
for (const [ifaceName, ifaces] of availableAddresses) {
|
|
574
|
-
if (ifaces
|
|
574
|
+
if (ifaces?.find((iface) => iface.address === this.ipv4Address)) {
|
|
575
575
|
this.log.info(`Using ipv4address ${CYAN}${this.ipv4Address}${nf} on interface ${CYAN}${ifaceName}${nf} for the Matter server node.`);
|
|
576
576
|
isValid = true;
|
|
577
577
|
break;
|
|
@@ -587,20 +587,19 @@ export class Matterbridge extends EventEmitter {
|
|
|
587
587
|
this.ipv6Address = getParameter('ipv6address');
|
|
588
588
|
}
|
|
589
589
|
else {
|
|
590
|
-
this.ipv6Address = await this.nodeContext?.get('matteripv6address'
|
|
590
|
+
this.ipv6Address = await this.nodeContext?.get('matteripv6address');
|
|
591
591
|
if (this.ipv6Address === '')
|
|
592
592
|
this.ipv6Address = undefined;
|
|
593
593
|
}
|
|
594
594
|
if (this.ipv6Address) {
|
|
595
595
|
let isValid = false;
|
|
596
596
|
for (const [ifaceName, ifaces] of availableAddresses) {
|
|
597
|
-
if (ifaces
|
|
597
|
+
if (ifaces?.find((iface) => (iface.scopeid === undefined || iface.scopeid === 0) && iface.address === this.ipv6Address)) {
|
|
598
598
|
this.log.info(`Using ipv6address ${CYAN}${this.ipv6Address}${nf} on interface ${CYAN}${ifaceName}${nf} for the Matter server node.`);
|
|
599
599
|
isValid = true;
|
|
600
600
|
break;
|
|
601
601
|
}
|
|
602
|
-
if (ifaces &&
|
|
603
|
-
ifaces.find((iface) => iface.scopeid && iface.scopeid > 0 && iface.address + '%' + (process.platform === 'win32' ? iface.scopeid : ifaceName) === this.ipv6Address)) {
|
|
602
|
+
if (ifaces?.find((iface) => iface.scopeid && iface.scopeid > 0 && iface.address + '%' + (process.platform === 'win32' ? iface.scopeid : ifaceName) === this.ipv6Address)) {
|
|
604
603
|
this.log.info(`Using ipv6address ${CYAN}${this.ipv6Address}${nf} on interface ${CYAN}${ifaceName}${nf} for the Matter server node.`);
|
|
605
604
|
isValid = true;
|
|
606
605
|
break;
|
|
@@ -1058,12 +1057,12 @@ export class Matterbridge extends EventEmitter {
|
|
|
1058
1057
|
this.plugins.logLevel = logLevel;
|
|
1059
1058
|
let pluginDebug = false;
|
|
1060
1059
|
for (const plugin of this.plugins) {
|
|
1061
|
-
if (!plugin.platform
|
|
1060
|
+
if (!plugin.platform?.log || !plugin.platform.config)
|
|
1062
1061
|
continue;
|
|
1063
|
-
if (plugin.platform.config.debug
|
|
1062
|
+
if (plugin.platform.config.debug)
|
|
1064
1063
|
pluginDebug = true;
|
|
1065
|
-
plugin.platform.log.logLevel = plugin.platform.config.debug
|
|
1066
|
-
await plugin.platform.onChangeLoggerLevel(plugin.platform.config.debug
|
|
1064
|
+
plugin.platform.log.logLevel = plugin.platform.config.debug ? "debug" : logLevel;
|
|
1065
|
+
await plugin.platform.onChangeLoggerLevel(plugin.platform.config.debug ? "debug" : logLevel);
|
|
1067
1066
|
}
|
|
1068
1067
|
let callbackLogLevel = "notice";
|
|
1069
1068
|
if (logLevel === "info" || Logger.level === MatterLogLevel.INFO)
|
|
@@ -1827,7 +1826,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1827
1826
|
}
|
|
1828
1827
|
async createAggregatorNode(storageContext) {
|
|
1829
1828
|
this.log.notice(`Creating ${await storageContext.get('storeId')} aggregator...`);
|
|
1830
|
-
const aggregatorNode = new Endpoint(AggregatorEndpoint, { id:
|
|
1829
|
+
const aggregatorNode = new Endpoint(AggregatorEndpoint, { id: await storageContext.get('storeId') });
|
|
1831
1830
|
this.log.info(`Created ${await storageContext.get('storeId')} aggregator`);
|
|
1832
1831
|
return aggregatorNode;
|
|
1833
1832
|
}
|
|
@@ -2052,7 +2051,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2052
2051
|
return false;
|
|
2053
2052
|
}
|
|
2054
2053
|
async subscribeAttributeChanged(plugin, device) {
|
|
2055
|
-
if (!plugin || !device
|
|
2054
|
+
if (!plugin || !device?.plugin || !device.serialNumber || !device.uniqueId || !device.maybeNumber)
|
|
2056
2055
|
return;
|
|
2057
2056
|
this.log.info(`Subscribing attributes for endpoint ${dev}${device.deviceName}${nf} (${dev}${device.id}${nf}) plugin ${plg}${plugin.name}${nf}`);
|
|
2058
2057
|
if (this.bridgeMode === 'childbridge' && plugin.type === 'AccessoryPlatform' && plugin.serverNode) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PlatformConfig, PlatformMatterbridge } from '@matterbridge/types';
|
|
2
|
-
import { AnsiLogger } from 'node-ansi-logger';
|
|
2
|
+
import { type AnsiLogger } from 'node-ansi-logger';
|
|
3
3
|
import { MatterbridgePlatform } from './matterbridgePlatform.js';
|
|
4
4
|
export declare function isMatterbridgeAccessoryPlatform(value: unknown): value is MatterbridgeAccessoryPlatform;
|
|
5
5
|
export declare class MatterbridgeAccessoryPlatform extends MatterbridgePlatform {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PlatformConfig, PlatformMatterbridge } from '@matterbridge/types';
|
|
2
|
-
import { AnsiLogger } from 'node-ansi-logger';
|
|
2
|
+
import { type AnsiLogger } from 'node-ansi-logger';
|
|
3
3
|
import { MatterbridgePlatform } from './matterbridgePlatform.js';
|
|
4
4
|
export declare function isMatterbridgeDynamicPlatform(value: unknown): value is MatterbridgeDynamicPlatform;
|
|
5
5
|
export declare class MatterbridgeDynamicPlatform extends MatterbridgePlatform {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { AtLeastOne } from '@matter/general';
|
|
2
|
-
import { ActionContext, Behavior, Endpoint, ServerNode } from '@matter/node';
|
|
1
|
+
import { type AtLeastOne } from '@matter/general';
|
|
2
|
+
import { type ActionContext, type Behavior, Endpoint, type ServerNode } from '@matter/node';
|
|
3
3
|
import { type ClusterType, type ClusterTyping } from '@matter/types/cluster';
|
|
4
4
|
import { AirQuality } from '@matter/types/clusters/air-quality';
|
|
5
5
|
import { ColorControl } from '@matter/types/clusters/color-control';
|
|
6
6
|
import { ConcentrationMeasurement } from '@matter/types/clusters/concentration-measurement';
|
|
7
7
|
import { DeviceEnergyManagement } from '@matter/types/clusters/device-energy-management';
|
|
8
|
-
import { DeviceEnergyManagementMode } from '@matter/types/clusters/device-energy-management-mode';
|
|
8
|
+
import { type DeviceEnergyManagementMode } from '@matter/types/clusters/device-energy-management-mode';
|
|
9
9
|
import { DoorLock } from '@matter/types/clusters/door-lock';
|
|
10
10
|
import { FanControl } from '@matter/types/clusters/fan-control';
|
|
11
11
|
import { Identify } from '@matter/types/clusters/identify';
|
|
12
|
-
import { ModeSelect } from '@matter/types/clusters/mode-select';
|
|
12
|
+
import { type ModeSelect } from '@matter/types/clusters/mode-select';
|
|
13
13
|
import { OnOff } from '@matter/types/clusters/on-off';
|
|
14
14
|
import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
15
15
|
import { PowerSource } from '@matter/types/clusters/power-source';
|
|
@@ -20,12 +20,12 @@ import { Thermostat } from '@matter/types/clusters/thermostat';
|
|
|
20
20
|
import { ThermostatUserInterfaceConfiguration } from '@matter/types/clusters/thermostat-user-interface-configuration';
|
|
21
21
|
import { ValveConfigurationAndControl } from '@matter/types/clusters/valve-configuration-and-control';
|
|
22
22
|
import { WindowCovering } from '@matter/types/clusters/window-covering';
|
|
23
|
-
import { ClusterId, EndpointNumber } from '@matter/types/datatype';
|
|
24
|
-
import { MeasurementAccuracy, Semtag } from '@matter/types/globals';
|
|
23
|
+
import { type ClusterId, type EndpointNumber } from '@matter/types/datatype';
|
|
24
|
+
import { type MeasurementAccuracy, type Semtag } from '@matter/types/globals';
|
|
25
25
|
import { AnsiLogger, LogLevel } from 'node-ansi-logger';
|
|
26
|
-
import { DeviceTypeDefinition } from './matterbridgeDeviceTypes.js';
|
|
27
|
-
import { CommandHandler, CommandHandlerData, CommandHandlerExecutionResult, CommandHandlerFunction, CommandHandlers } from './matterbridgeEndpointCommandHandler.js';
|
|
28
|
-
import { MatterbridgeEndpointOptions, SerializedMatterbridgeEndpoint } from './matterbridgeEndpointTypes.js';
|
|
26
|
+
import { type DeviceTypeDefinition } from './matterbridgeDeviceTypes.js';
|
|
27
|
+
import { CommandHandler, type CommandHandlerData, type CommandHandlerExecutionResult, type CommandHandlerFunction, type CommandHandlers } from './matterbridgeEndpointCommandHandler.js';
|
|
28
|
+
import { type MatterbridgeEndpointOptions, type SerializedMatterbridgeEndpoint } from './matterbridgeEndpointTypes.js';
|
|
29
29
|
type FirstCommandParam<Params extends unknown[]> = Params extends [] ? undefined : Params[0];
|
|
30
30
|
type BehaviorCluster<T extends Behavior.Type> = T extends {
|
|
31
31
|
cluster: infer C extends ClusterType;
|
|
@@ -59,7 +59,7 @@ export declare function assertMatterbridgeEndpoint(value: unknown, context?: str
|
|
|
59
59
|
export declare class MatterbridgeEndpoint extends Endpoint {
|
|
60
60
|
static logLevel: LogLevel;
|
|
61
61
|
mode: 'server' | 'matter' | undefined;
|
|
62
|
-
serverNode: ServerNode
|
|
62
|
+
serverNode: ServerNode | undefined;
|
|
63
63
|
log: AnsiLogger;
|
|
64
64
|
plugin: string | undefined;
|
|
65
65
|
configUrl: string | undefined;
|
|
@@ -83,7 +83,7 @@ import { MatterbridgeSwitchServer } from './behaviors/switchServer.js';
|
|
|
83
83
|
import { MatterbridgeThermostatServer } from './behaviors/thermostatServer.js';
|
|
84
84
|
import { MatterbridgeValveConfigurationAndControlServer } from './behaviors/valveConfigurationAndControlServer.js';
|
|
85
85
|
import { MatterbridgeWindowCoveringServer } from './behaviors/windowCoveringServer.js';
|
|
86
|
-
import { CommandHandler } from './matterbridgeEndpointCommandHandler.js';
|
|
86
|
+
import { CommandHandler, } from './matterbridgeEndpointCommandHandler.js';
|
|
87
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';
|
|
88
88
|
const MATTERBRIDGE_ENDPOINT_BRAND = Symbol('MatterbridgeEndpoint.brand');
|
|
89
89
|
export function isMatterbridgeEndpoint(value) {
|
|
@@ -199,7 +199,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
199
199
|
this.log = new AnsiLogger({
|
|
200
200
|
logName: this.originalId ?? 'MatterbridgeEndpoint',
|
|
201
201
|
logTimestampFormat: 4,
|
|
202
|
-
logLevel: debug
|
|
202
|
+
logLevel: debug ? "debug" : MatterbridgeEndpoint.logLevel,
|
|
203
203
|
});
|
|
204
204
|
this.log.debug(`${YELLOW}new${db} MatterbridgeEndpoint: ${zb}${'0x' + firstDefinition.code.toString(16).padStart(4, '0')}${db}-${zb}${firstDefinition.name}${db} mode: ${CYAN}${this.mode}${db} id: ${CYAN}${optionsV8.id}${db} number: ${CYAN}${optionsV8.number}${db} taglist: ${CYAN}${options.tagList ? debugStringify(options.tagList) : 'undefined'}${db}`);
|
|
205
205
|
this.behaviors.require(MatterbridgeServer, { log: this.log, commandHandler: this.commandHandler });
|
|
@@ -1275,7 +1275,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1275
1275
|
return false;
|
|
1276
1276
|
}
|
|
1277
1277
|
if (['Single', 'Double', 'Long'].includes(event)) {
|
|
1278
|
-
if (!this.hasClusterServer(Switch.id) || this.getAttribute(Switch.id, 'featureMap').momentarySwitch
|
|
1278
|
+
if (!this.hasClusterServer(Switch.id) || !this.getAttribute(Switch.id, 'featureMap').momentarySwitch) {
|
|
1279
1279
|
this.log.error(`triggerSwitchEvent ${event} error: Switch cluster with MomentarySwitch not found on endpoint ${this.maybeId}:${this.maybeNumber}`);
|
|
1280
1280
|
return false;
|
|
1281
1281
|
}
|
|
@@ -1313,7 +1313,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
1315
|
if (['Press', 'Release'].includes(event)) {
|
|
1316
|
-
if (!this.hasClusterServer(Switch.id) || this.getAttribute(Switch.id, 'featureMap').latchingSwitch
|
|
1316
|
+
if (!this.hasClusterServer(Switch.id) || !this.getAttribute(Switch.id, 'featureMap').latchingSwitch) {
|
|
1317
1317
|
this.log.error(`triggerSwitchEvent ${event} error: Switch cluster with LatchingSwitch not found on endpoint ${this.maybeId}:${this.maybeNumber}`);
|
|
1318
1318
|
return false;
|
|
1319
1319
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { HandlerFunction } from '@matter/general';
|
|
2
|
-
import { ActionContext } from '@matter/main';
|
|
1
|
+
import { type HandlerFunction } from '@matter/general';
|
|
2
|
+
import { type ActionContext } from '@matter/main';
|
|
3
3
|
import type { ClusterType } from '@matter/types/cluster';
|
|
4
|
-
import { ActivatedCarbonFilterMonitoring } from '@matter/types/clusters/activated-carbon-filter-monitoring';
|
|
5
|
-
import { BooleanStateConfiguration } from '@matter/types/clusters/boolean-state-configuration';
|
|
6
|
-
import { ColorControl } from '@matter/types/clusters/color-control';
|
|
7
|
-
import { DeviceEnergyManagement } from '@matter/types/clusters/device-energy-management';
|
|
8
|
-
import { DeviceEnergyManagementMode } from '@matter/types/clusters/device-energy-management-mode';
|
|
9
|
-
import { DishwasherMode } from '@matter/types/clusters/dishwasher-mode';
|
|
10
|
-
import { DoorLock } from '@matter/types/clusters/door-lock';
|
|
11
|
-
import { EnergyEvse } from '@matter/types/clusters/energy-evse';
|
|
12
|
-
import { EnergyEvseMode } from '@matter/types/clusters/energy-evse-mode';
|
|
13
|
-
import { FanControl } from '@matter/types/clusters/fan-control';
|
|
14
|
-
import { HepaFilterMonitoring } from '@matter/types/clusters/hepa-filter-monitoring';
|
|
15
|
-
import { Identify } from '@matter/types/clusters/identify';
|
|
16
|
-
import { KeypadInput } from '@matter/types/clusters/keypad-input';
|
|
17
|
-
import { LaundryWasherMode } from '@matter/types/clusters/laundry-washer-mode';
|
|
18
|
-
import { LevelControl } from '@matter/types/clusters/level-control';
|
|
19
|
-
import { MediaPlayback } from '@matter/types/clusters/media-playback';
|
|
20
|
-
import { MicrowaveOvenControl } from '@matter/types/clusters/microwave-oven-control';
|
|
21
|
-
import { ModeBase } from '@matter/types/clusters/mode-base';
|
|
22
|
-
import { ModeSelect } from '@matter/types/clusters/mode-select';
|
|
23
|
-
import { OnOff } from '@matter/types/clusters/on-off';
|
|
24
|
-
import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
25
|
-
import { ResourceMonitoring } from '@matter/types/clusters/resource-monitoring';
|
|
26
|
-
import { RvcCleanMode } from '@matter/types/clusters/rvc-clean-mode';
|
|
27
|
-
import { RvcOperationalState } from '@matter/types/clusters/rvc-operational-state';
|
|
28
|
-
import { RvcRunMode } from '@matter/types/clusters/rvc-run-mode';
|
|
29
|
-
import { ServiceArea } from '@matter/types/clusters/service-area';
|
|
30
|
-
import { SmokeCoAlarm } from '@matter/types/clusters/smoke-co-alarm';
|
|
31
|
-
import { TemperatureControl } from '@matter/types/clusters/temperature-control';
|
|
32
|
-
import { Thermostat } from '@matter/types/clusters/thermostat';
|
|
33
|
-
import { ThreadNetworkDiagnostics } from '@matter/types/clusters/thread-network-diagnostics';
|
|
34
|
-
import { TimeSynchronization } from '@matter/types/clusters/time-synchronization';
|
|
35
|
-
import { ValveConfigurationAndControl } from '@matter/types/clusters/valve-configuration-and-control';
|
|
36
|
-
import { WaterHeaterManagement } from '@matter/types/clusters/water-heater-management';
|
|
37
|
-
import { WaterHeaterMode } from '@matter/types/clusters/water-heater-mode';
|
|
38
|
-
import { WindowCovering } from '@matter/types/clusters/window-covering';
|
|
39
|
-
import { ClosureControl } from './clusters/closure-control.js';
|
|
40
|
-
import { ClosureDimension } from './clusters/closure-dimension.js';
|
|
4
|
+
import { type ActivatedCarbonFilterMonitoring } from '@matter/types/clusters/activated-carbon-filter-monitoring';
|
|
5
|
+
import { type BooleanStateConfiguration } from '@matter/types/clusters/boolean-state-configuration';
|
|
6
|
+
import { type ColorControl } from '@matter/types/clusters/color-control';
|
|
7
|
+
import { type DeviceEnergyManagement } from '@matter/types/clusters/device-energy-management';
|
|
8
|
+
import { type DeviceEnergyManagementMode } from '@matter/types/clusters/device-energy-management-mode';
|
|
9
|
+
import { type DishwasherMode } from '@matter/types/clusters/dishwasher-mode';
|
|
10
|
+
import { type DoorLock } from '@matter/types/clusters/door-lock';
|
|
11
|
+
import { type EnergyEvse } from '@matter/types/clusters/energy-evse';
|
|
12
|
+
import { type EnergyEvseMode } from '@matter/types/clusters/energy-evse-mode';
|
|
13
|
+
import { type FanControl } from '@matter/types/clusters/fan-control';
|
|
14
|
+
import { type HepaFilterMonitoring } from '@matter/types/clusters/hepa-filter-monitoring';
|
|
15
|
+
import { type Identify } from '@matter/types/clusters/identify';
|
|
16
|
+
import { type KeypadInput } from '@matter/types/clusters/keypad-input';
|
|
17
|
+
import { type LaundryWasherMode } from '@matter/types/clusters/laundry-washer-mode';
|
|
18
|
+
import { type LevelControl } from '@matter/types/clusters/level-control';
|
|
19
|
+
import { type MediaPlayback } from '@matter/types/clusters/media-playback';
|
|
20
|
+
import { type MicrowaveOvenControl } from '@matter/types/clusters/microwave-oven-control';
|
|
21
|
+
import { type ModeBase } from '@matter/types/clusters/mode-base';
|
|
22
|
+
import { type ModeSelect } from '@matter/types/clusters/mode-select';
|
|
23
|
+
import { type OnOff } from '@matter/types/clusters/on-off';
|
|
24
|
+
import { type OperationalState } from '@matter/types/clusters/operational-state';
|
|
25
|
+
import { type ResourceMonitoring } from '@matter/types/clusters/resource-monitoring';
|
|
26
|
+
import { type RvcCleanMode } from '@matter/types/clusters/rvc-clean-mode';
|
|
27
|
+
import { type RvcOperationalState } from '@matter/types/clusters/rvc-operational-state';
|
|
28
|
+
import { type RvcRunMode } from '@matter/types/clusters/rvc-run-mode';
|
|
29
|
+
import { type ServiceArea } from '@matter/types/clusters/service-area';
|
|
30
|
+
import { type SmokeCoAlarm } from '@matter/types/clusters/smoke-co-alarm';
|
|
31
|
+
import { type TemperatureControl } from '@matter/types/clusters/temperature-control';
|
|
32
|
+
import { type Thermostat } from '@matter/types/clusters/thermostat';
|
|
33
|
+
import { type ThreadNetworkDiagnostics } from '@matter/types/clusters/thread-network-diagnostics';
|
|
34
|
+
import { type TimeSynchronization } from '@matter/types/clusters/time-synchronization';
|
|
35
|
+
import { type ValveConfigurationAndControl } from '@matter/types/clusters/valve-configuration-and-control';
|
|
36
|
+
import { type WaterHeaterManagement } from '@matter/types/clusters/water-heater-management';
|
|
37
|
+
import { type WaterHeaterMode } from '@matter/types/clusters/water-heater-mode';
|
|
38
|
+
import { type WindowCovering } from '@matter/types/clusters/window-covering';
|
|
39
|
+
import { type ClosureControl } from './clusters/closure-control.js';
|
|
40
|
+
import { type ClosureDimension } from './clusters/closure-dimension.js';
|
|
41
41
|
import type { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
42
42
|
export interface MatterbridgeEndpointCommands {
|
|
43
43
|
identify: HandlerFunction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionContext, Behavior, ClusterBehavior, Endpoint } from '@matter/node';
|
|
1
|
+
import { type ActionContext, type Behavior, ClusterBehavior, type Endpoint } from '@matter/node';
|
|
2
2
|
import { ElectricalEnergyMeasurementServer } from '@matter/node/behaviors/electrical-energy-measurement';
|
|
3
3
|
import { ElectricalPowerMeasurementServer } from '@matter/node/behaviors/electrical-power-measurement';
|
|
4
4
|
import { OccupancySensingServer } from '@matter/node/behaviors/occupancy-sensing';
|
|
@@ -16,22 +16,22 @@ import { PressureMeasurement } from '@matter/types/clusters/pressure-measurement
|
|
|
16
16
|
import { RelativeHumidityMeasurement } from '@matter/types/clusters/relative-humidity-measurement';
|
|
17
17
|
import { SoilMeasurement } from '@matter/types/clusters/soil-measurement';
|
|
18
18
|
import { TemperatureMeasurement } from '@matter/types/clusters/temperature-measurement';
|
|
19
|
-
import { ClusterId, VendorId } from '@matter/types/datatype';
|
|
20
|
-
import { MeasurementAccuracy, Semtag } from '@matter/types/globals';
|
|
21
|
-
import { AnsiLogger } from 'node-ansi-logger';
|
|
19
|
+
import { type ClusterId, type VendorId } from '@matter/types/datatype';
|
|
20
|
+
import { type MeasurementAccuracy, type Semtag } from '@matter/types/globals';
|
|
21
|
+
import { type AnsiLogger } from 'node-ansi-logger';
|
|
22
22
|
import { MatterbridgeDeviceEnergyManagementModeServer } from './behaviors/deviceEnergyManagementModeServer.js';
|
|
23
23
|
import { MatterbridgeDeviceEnergyManagementServer } from './behaviors/deviceEnergyManagementServer.js';
|
|
24
24
|
import { MatterbridgeOperationalStateServer } from './behaviors/operationalStateServer.js';
|
|
25
25
|
import { MatterbridgePowerSourceServer } from './behaviors/powerSourceServer.js';
|
|
26
|
-
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
27
|
-
import { CommandHandlers } from './matterbridgeEndpointCommandHandler.js';
|
|
26
|
+
import { type MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
27
|
+
import { type CommandHandlers } from './matterbridgeEndpointCommandHandler.js';
|
|
28
28
|
export declare function capitalizeFirstLetter(name: string): string;
|
|
29
29
|
export declare function lowercaseFirstLetter(name: string): string;
|
|
30
30
|
export declare function getSnapshot<T>(value: T): T;
|
|
31
31
|
export declare function checkNotLatinCharacters(deviceName: string): boolean;
|
|
32
32
|
export declare function generateUniqueId(deviceName: string): string;
|
|
33
33
|
export declare function createUniqueId(param1: string, param2: string, param3: string, param4: string): string;
|
|
34
|
-
export declare function getSemtag(semtag: Semtag, label?: string | null
|
|
34
|
+
export declare function getSemtag(semtag: Semtag, label?: string | null, mfgCode?: VendorId | null): Semtag;
|
|
35
35
|
export declare function featuresFor(endpoint: MatterbridgeEndpoint, cluster: Behavior.Type | ClusterType | ClusterId | string): Partial<Record<string, boolean>>;
|
|
36
36
|
export declare function internalFor<T extends Behavior.Type>(endpoint: MatterbridgeEndpoint, cluster: T): Promise<InstanceType<T['Internal']> | undefined>;
|
|
37
37
|
export declare function internalFor<T extends object = Record<string, unknown>>(endpoint: MatterbridgeEndpoint, cluster: ClusterType | ClusterId | string): Promise<T | undefined>;
|
|
@@ -178,7 +178,7 @@ export function createUniqueId(param1, param2, param3, param4) {
|
|
|
178
178
|
hash.update(param1 + param2 + param3 + param4);
|
|
179
179
|
return hash.digest('hex');
|
|
180
180
|
}
|
|
181
|
-
export function getSemtag(semtag, label
|
|
181
|
+
export function getSemtag(semtag, label, mfgCode = null) {
|
|
182
182
|
if (label !== undefined && label !== null && typeof label === 'string')
|
|
183
183
|
label = label.trim().slice(0, 64);
|
|
184
184
|
if (label === undefined)
|
|
@@ -203,9 +203,8 @@ export async function internalFor(endpoint, cluster) {
|
|
|
203
203
|
return undefined;
|
|
204
204
|
}
|
|
205
205
|
const supportedBehavior = endpoint.behaviors.supported[lowercaseFirstLetter(behaviorId)];
|
|
206
|
-
if (!supportedBehavior)
|
|
206
|
+
if (!supportedBehavior)
|
|
207
207
|
return undefined;
|
|
208
|
-
}
|
|
209
208
|
return endpoint.act(() => endpoint.behaviors.internalsOf(supportedBehavior));
|
|
210
209
|
}
|
|
211
210
|
export function optionsFor(type, options) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClusterId, EndpointNumber } from '@matter/types/datatype';
|
|
2
|
-
import { Semtag } from '@matter/types/globals';
|
|
1
|
+
import type { ClusterId, EndpointNumber } from '@matter/types/datatype';
|
|
2
|
+
import type { Semtag } from '@matter/types/globals';
|
|
3
3
|
import type { DeviceTypeDefinition } from './matterbridgeDeviceTypes.js';
|
|
4
4
|
export type PrimitiveTypes = boolean | number | bigint | string | object | undefined | null;
|
|
5
5
|
export interface SerializedMatterbridgeEndpoint {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Behavior } from '@matter/node';
|
|
2
|
-
import { ClusterId } from '@matter/types/datatype';
|
|
1
|
+
import { type Behavior } from '@matter/node';
|
|
2
|
+
import { type ClusterId } from '@matter/types/datatype';
|
|
3
3
|
import type { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
4
4
|
export interface CreateClusterServerOptions {
|
|
5
5
|
features?: Record<string, boolean> | string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EndpointNumber } from '@matter/types/datatype';
|
|
1
|
+
import { type EndpointNumber } from '@matter/types/datatype';
|
|
2
2
|
import type { ApiSelectDevice, ApiSelectEntity, PlatformConfig, PlatformMatterbridge, PlatformSchema } from '@matterbridge/types';
|
|
3
|
-
import { AnsiLogger, LogLevel } from 'node-ansi-logger';
|
|
4
|
-
import { NodeStorage } from 'node-persist-manager';
|
|
5
|
-
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
3
|
+
import { type AnsiLogger, type LogLevel } from 'node-ansi-logger';
|
|
4
|
+
import { type NodeStorage } from 'node-persist-manager';
|
|
5
|
+
import { type MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
6
6
|
export type { BasePlatformConfig, PlatformConfig, PlatformConfigValue, PlatformMatterbridge, PlatformSchema, PlatformSchemaValue } from '@matterbridge/types';
|
|
7
7
|
export declare function isMatterbridgePlatform(value: unknown): value is MatterbridgePlatform;
|
|
8
8
|
export declare function assertMatterbridgePlatform(value: unknown, context?: string): asserts value is MatterbridgePlatform;
|
package/dist/pluginManager.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { type MatterbridgePlatform } from './matterbridgePlatform.js';
|
|
|
11
11
|
export interface Plugin extends ApiPlugin {
|
|
12
12
|
nodeContext?: NodeStorage;
|
|
13
13
|
storageContext?: StorageContext;
|
|
14
|
-
serverNode?: ServerNode
|
|
14
|
+
serverNode?: ServerNode;
|
|
15
15
|
aggregatorNode?: EndpointNode<AggregatorEndpoint>;
|
|
16
16
|
device?: MatterbridgeEndpoint;
|
|
17
17
|
platform?: MatterbridgePlatform;
|
package/dist/pluginManager.js
CHANGED
|
@@ -276,7 +276,7 @@ export class PluginManager extends EventEmitter {
|
|
|
276
276
|
this.log.debug(`Received broadcast response ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}: ${debugStringify(msg)}${db}`);
|
|
277
277
|
switch (msg.type) {
|
|
278
278
|
case 'manager_spawn_response':
|
|
279
|
-
if (msg.result
|
|
279
|
+
if (msg.result?.packageCommand === 'install') {
|
|
280
280
|
if (!msg.result.success) {
|
|
281
281
|
this.log.error(`Failed to install package ${plg}${msg.result.packageName}${er}`);
|
|
282
282
|
return;
|
|
@@ -310,11 +310,11 @@ export class PluginManager extends EventEmitter {
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
if (msg.result
|
|
313
|
+
if (msg.result?.packageCommand === 'uninstall') {
|
|
314
314
|
if (msg.result.success) {
|
|
315
315
|
if (this.has(msg.result.packageName)) {
|
|
316
316
|
const plugin = this.get(msg.result.packageName);
|
|
317
|
-
if (plugin
|
|
317
|
+
if (plugin?.loaded)
|
|
318
318
|
await this.shutdown(plugin, 'Matterbridge is uninstalling the plugin');
|
|
319
319
|
await this.remove(msg.result.packageName);
|
|
320
320
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.1-dev-20260614-18d1a2e",
|
|
4
4
|
"description": "Matterbridge core library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -130,10 +130,10 @@
|
|
|
130
130
|
],
|
|
131
131
|
"dependencies": {
|
|
132
132
|
"@matter/main": "0.17.2",
|
|
133
|
-
"@matterbridge/dgram": "3.9.
|
|
134
|
-
"@matterbridge/thread": "3.9.
|
|
135
|
-
"@matterbridge/types": "3.9.
|
|
136
|
-
"@matterbridge/utils": "3.9.
|
|
133
|
+
"@matterbridge/dgram": "3.9.1-dev-20260614-18d1a2e",
|
|
134
|
+
"@matterbridge/thread": "3.9.1-dev-20260614-18d1a2e",
|
|
135
|
+
"@matterbridge/types": "3.9.1-dev-20260614-18d1a2e",
|
|
136
|
+
"@matterbridge/utils": "3.9.1-dev-20260614-18d1a2e",
|
|
137
137
|
"escape-html": "1.0.3",
|
|
138
138
|
"express": "5.2.1",
|
|
139
139
|
"express-rate-limit": "8.5.2",
|