@matterbridge/core 3.10.14-dev-20261013-e87a0c8 → 3.10.14-dev-20261014-8d92b7f
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/demoDevices.js +2 -0
- package/dist/devices/batteryStorage.d.ts +1 -0
- package/dist/devices/batteryStorage.js +1 -1
- package/dist/devices/intercom.d.ts +11 -1
- package/dist/devices/intercom.js +13 -2
- package/dist/matterNode.js +1 -1
- package/dist/matterbridge.js +1 -1
- package/dist/matterbridgeEndpoint.d.ts +1 -1
- package/dist/matterbridgeEndpoint.js +2 -2
- package/dist/matterbridgeEndpointHelpers.d.ts +1 -1
- package/dist/matterbridgeEndpointHelpers.js +5 -1
- package/package.json +5 -5
package/dist/demoDevices.js
CHANGED
|
@@ -883,6 +883,7 @@ export async function createDemoDevices(matterbridge) {
|
|
|
883
883
|
id: 'Intercom',
|
|
884
884
|
number: EndpointNumber(16_04),
|
|
885
885
|
identifyType: Identify.IdentifyType.VisibleIndicator,
|
|
886
|
+
switchOptions: { number: EndpointNumber(16_04_2) },
|
|
886
887
|
weriftOfferOptions: { offerVideo: false, offerAudio: true, videoSource: 'none', audioSource: 'test' },
|
|
887
888
|
});
|
|
888
889
|
await registerDevice(ep, 'Intercom I', 'CAMERA-16-04');
|
|
@@ -890,6 +891,7 @@ export async function createDemoDevices(matterbridge) {
|
|
|
890
891
|
id: 'IntercomII',
|
|
891
892
|
number: EndpointNumber(16_04_1),
|
|
892
893
|
identifyType: Identify.IdentifyType.VisibleIndicator,
|
|
894
|
+
switchOptions: { number: EndpointNumber(16_04_1_2) },
|
|
893
895
|
weriftOfferOptions: { offerVideo: false, offerAudio: true, videoSource: 'none', audioSource: 'test' },
|
|
894
896
|
});
|
|
895
897
|
await registerDevice(ep, 'Intercom II', 'CAMERA-16-04-1');
|
|
@@ -9,6 +9,7 @@ export interface BatteryStorageOptions {
|
|
|
9
9
|
tagList?: Semtag[];
|
|
10
10
|
batPercentRemaining?: number;
|
|
11
11
|
batChargeLevel?: PowerSource.BatChargeLevel;
|
|
12
|
+
batCapacity?: number;
|
|
12
13
|
voltage?: number | bigint | null;
|
|
13
14
|
current?: number | bigint | null;
|
|
14
15
|
power?: number | bigint | null;
|
|
@@ -31,7 +31,7 @@ export class BatteryStorage extends MatterbridgeEndpoint {
|
|
|
31
31
|
const battery = this.addChildDeviceType('Battery', [powerSource, electricalSensor], {
|
|
32
32
|
tagList: [getSemtag(PowerSourceTag.Battery)],
|
|
33
33
|
})
|
|
34
|
-
.createDefaultPowerSourceRechargeableBatteryClusterServer(options.batPercentRemaining ?? 100, options.batChargeLevel ?? PowerSource.BatChargeLevel.Ok, 24_000)
|
|
34
|
+
.createDefaultPowerSourceRechargeableBatteryClusterServer(options.batPercentRemaining ?? 100, options.batChargeLevel ?? PowerSource.BatChargeLevel.Ok, 24_000, PowerSource.BatReplaceability.Unspecified, options.batCapacity ?? 200_000, null, null, [])
|
|
35
35
|
.createDefaultPowerTopologyClusterServer()
|
|
36
36
|
.createDefaultElectricalEnergyMeasurementClusterServer(options.energyImported ?? null, options.energyExported ?? null);
|
|
37
37
|
battery.behaviors.require(ElectricalPowerMeasurementServer.with(ElectricalPowerMeasurement.Feature.DirectCurrent), getDefaultElectricalPowerMeasurementClusterServer(options.voltage ?? null, options.current ?? null, options.power ?? null));
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { CameraAvStreamManagement } from '@matter/types/clusters/camera-av-stream-management';
|
|
2
2
|
import { Identify } from '@matter/types/clusters/identify';
|
|
3
|
-
import {
|
|
3
|
+
import type { EndpointNumber } from '@matter/types/datatype';
|
|
4
|
+
import { type Semtag, StreamUsage } from '@matter/types/globals';
|
|
4
5
|
import type { WeriftOfferOptions } from '../behaviors/weriftSession.js';
|
|
5
6
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
6
7
|
import type { MatterbridgeEndpointOptions } from '../matterbridgeEndpointTypes.js';
|
|
8
|
+
export interface IntercomSwitchOptions {
|
|
9
|
+
name?: string;
|
|
10
|
+
tagList?: Semtag[];
|
|
11
|
+
number?: EndpointNumber;
|
|
12
|
+
identifyTime?: number;
|
|
13
|
+
identifyType?: Identify.IdentifyType;
|
|
14
|
+
}
|
|
7
15
|
export interface IntercomOptions extends MatterbridgeEndpointOptions {
|
|
8
16
|
identifyTime?: number;
|
|
9
17
|
identifyType?: Identify.IdentifyType;
|
|
@@ -16,7 +24,9 @@ export interface IntercomOptions extends MatterbridgeEndpointOptions {
|
|
|
16
24
|
speakerCapabilities?: CameraAvStreamManagement.AudioCapabilities;
|
|
17
25
|
twoWayTalkSupport?: CameraAvStreamManagement.TwoWayTalkSupportType;
|
|
18
26
|
weriftOfferOptions?: WeriftOfferOptions;
|
|
27
|
+
switchOptions?: IntercomSwitchOptions;
|
|
19
28
|
}
|
|
20
29
|
export declare class Intercom extends MatterbridgeEndpoint {
|
|
21
30
|
constructor(name: string, serial: string, options?: IntercomOptions);
|
|
31
|
+
addSwitch(name: string, options?: IntercomSwitchOptions): MatterbridgeEndpoint;
|
|
22
32
|
}
|
package/dist/devices/intercom.js
CHANGED
|
@@ -5,11 +5,11 @@ import { createDefaultIntercomCameraAvStreamManagementClusterServer } from '../b
|
|
|
5
5
|
import { addChimeClient, addWebRtcTransportProviderClient, addWebRtcTransportRequestorClient } from '../behaviors/clients.js';
|
|
6
6
|
import { createDefaultWebRtcTransportProviderClusterServer } from '../behaviors/webRtcTransportProviderServer.js';
|
|
7
7
|
import { createDefaultWebRtcTransportRequestorClusterServer } from '../behaviors/webRtcTransportRequestorServer.js';
|
|
8
|
-
import { intercom, powerSource } from '../matterbridgeDeviceTypes.js';
|
|
8
|
+
import { genericSwitch, intercom, powerSource } from '../matterbridgeDeviceTypes.js';
|
|
9
9
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
10
10
|
export class Intercom extends MatterbridgeEndpoint {
|
|
11
11
|
constructor(name, serial, options = {}) {
|
|
12
|
-
const { identifyTime = 0, identifyType = Identify.IdentifyType.None, powerSourceType = 'Wired', maxContentBufferSize = 65_536, maxNetworkBandwidth = 128_000, supportedStreamUsages = [StreamUsage.LiveView], streamUsagePriorities = supportedStreamUsages, microphoneCapabilities = { maxNumberOfChannels: 1, supportedCodecs: [CameraAvStreamManagement.AudioCodec.Opus], supportedSampleRates: [48000], supportedBitDepths: [16] }, speakerCapabilities = { maxNumberOfChannels: 1, supportedCodecs: [CameraAvStreamManagement.AudioCodec.Opus], supportedSampleRates: [48000], supportedBitDepths: [16] }, twoWayTalkSupport = CameraAvStreamManagement.TwoWayTalkSupportType.FullDuplex, weriftOfferOptions, id, number, tagList, mode, } = options;
|
|
12
|
+
const { identifyTime = 0, identifyType = Identify.IdentifyType.None, powerSourceType = 'Wired', maxContentBufferSize = 65_536, maxNetworkBandwidth = 128_000, supportedStreamUsages = [StreamUsage.LiveView], streamUsagePriorities = supportedStreamUsages, microphoneCapabilities = { maxNumberOfChannels: 1, supportedCodecs: [CameraAvStreamManagement.AudioCodec.Opus], supportedSampleRates: [48000], supportedBitDepths: [16] }, speakerCapabilities = { maxNumberOfChannels: 1, supportedCodecs: [CameraAvStreamManagement.AudioCodec.Opus], supportedSampleRates: [48000], supportedBitDepths: [16] }, twoWayTalkSupport = CameraAvStreamManagement.TwoWayTalkSupportType.FullDuplex, weriftOfferOptions, switchOptions = {}, id, number, tagList, mode, } = options;
|
|
13
13
|
super(powerSourceType === 'None' ? [intercom] : [intercom, powerSource], {
|
|
14
14
|
id: id ?? `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}`,
|
|
15
15
|
number,
|
|
@@ -51,5 +51,16 @@ export class Intercom extends MatterbridgeEndpoint {
|
|
|
51
51
|
addWebRtcTransportRequestorClient(this);
|
|
52
52
|
addChimeClient(this);
|
|
53
53
|
this.addRequiredClusters();
|
|
54
|
+
const { name: switchName = 'Switch', tagList: switchTagList = [], number: switchNumber, identifyTime: switchIdentifyTime = 0, identifyType: switchIdentifyType = Identify.IdentifyType.None, } = switchOptions;
|
|
55
|
+
this.addSwitch(switchName, { tagList: switchTagList, number: switchNumber, identifyTime: switchIdentifyTime, identifyType: switchIdentifyType });
|
|
56
|
+
}
|
|
57
|
+
addSwitch(name, options = {}) {
|
|
58
|
+
const { tagList = [], number, identifyTime = 0, identifyType = Identify.IdentifyType.None } = options;
|
|
59
|
+
const switchChild = this.addChildDeviceType(name, genericSwitch, { number, ...(tagList.length > 0 ? { tagList } : {}) });
|
|
60
|
+
switchChild.log.logName = name;
|
|
61
|
+
switchChild.createDefaultIdentifyClusterServer(identifyTime, identifyType);
|
|
62
|
+
switchChild.createDefaultMomentarySwitchClusterServer();
|
|
63
|
+
switchChild.addRequiredClusters();
|
|
64
|
+
return switchChild;
|
|
54
65
|
}
|
|
55
66
|
}
|
package/dist/matterNode.js
CHANGED
|
@@ -97,7 +97,7 @@ export class MatterNode extends EventEmitter {
|
|
|
97
97
|
this.environment.vars.set('path.root', path.join(matterbridge.matterbridgeDirectory, MATTER_STORAGE_DIR));
|
|
98
98
|
this.environment.vars.set('runtime.signals', false);
|
|
99
99
|
this.environment.vars.set('runtime.exitcode', false);
|
|
100
|
-
this.environment.vars.set('endpoint.validation', '
|
|
100
|
+
this.environment.vars.set('endpoint.validation', 'warn');
|
|
101
101
|
if (this.mdnsInterface)
|
|
102
102
|
this.environment.vars.set('mdns.networkInterface', this.mdnsInterface);
|
|
103
103
|
if (this.verbose)
|
package/dist/matterbridge.js
CHANGED
|
@@ -460,7 +460,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
460
460
|
this.environment.vars.set('path.root', path.join(this.matterbridgeDirectory, MATTER_STORAGE_DIR));
|
|
461
461
|
this.environment.vars.set('runtime.signals', false);
|
|
462
462
|
this.environment.vars.set('runtime.exitcode', false);
|
|
463
|
-
this.environment.vars.set('endpoint.validation', '
|
|
463
|
+
this.environment.vars.set('endpoint.validation', 'warn');
|
|
464
464
|
this.registerProcessHandlers();
|
|
465
465
|
try {
|
|
466
466
|
this.log.debug(`Creating node storage manager: ${CYAN}${NODE_STORAGE_DIR}${db}`);
|
|
@@ -151,7 +151,7 @@ export declare class MatterbridgeEndpoint extends Endpoint {
|
|
|
151
151
|
createDefaultPowerSourceWiredClusterServer(wiredCurrentType?: PowerSource.WiredCurrentType): this;
|
|
152
152
|
createDefaultPowerSourceBatteryClusterServer(batPercentRemaining?: null | number, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: null | number, batReplaceability?: PowerSource.BatReplaceability): this;
|
|
153
153
|
createDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining?: number | null, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number | null, batReplacementDescription?: string, batQuantity?: number, batReplaceability?: PowerSource.BatReplaceability): this;
|
|
154
|
-
createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining?: number | null, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number | null, batReplaceability?: PowerSource.BatReplaceability): this;
|
|
154
|
+
createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining?: number | null, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number | null, batReplaceability?: PowerSource.BatReplaceability, batCapacity?: number, batTimeToFullCharge?: number | null, batChargingCurrent?: number | null, activeBatChargeFaults?: PowerSource.BatChargeFault[]): this;
|
|
155
155
|
createDefaultBasicInformationClusterServer(deviceName: string, serialNumber: string, vendorId?: number, vendorName?: string, productId?: number, productName?: string, softwareVersion?: number, softwareVersionString?: string, hardwareVersion?: number, hardwareVersionString?: string, productLabel?: string, productUrl?: string, configurationVersion?: number): this;
|
|
156
156
|
createDefaultBridgedDeviceBasicInformationClusterServer(deviceName: string, serialNumber: string, vendorId?: number, vendorName?: string, productName?: string, softwareVersion?: number, softwareVersionString?: string, hardwareVersion?: number, hardwareVersionString?: string, productLabel?: string, productUrl?: string, configurationVersion?: number, productId?: number): this;
|
|
157
157
|
createDefaultPowerTopologyClusterServer(feature?: PowerTopology.Feature, availableEndpoints?: EndpointNumber[], activeEndpoints?: EndpointNumber[]): this;
|
|
@@ -539,8 +539,8 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
539
539
|
this.behaviors.require(MatterbridgePowerSourceServer.with(PowerSource.Feature.Battery, PowerSource.Feature.Replaceable), getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining, batChargeLevel, batVoltage, batReplacementDescription, batQuantity, batReplaceability));
|
|
540
540
|
return this;
|
|
541
541
|
}
|
|
542
|
-
createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplaceability = PowerSource.BatReplaceability.Unspecified) {
|
|
543
|
-
this.behaviors.require(MatterbridgePowerSourceServer.with(PowerSource.Feature.Battery, PowerSource.Feature.Rechargeable), getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, batVoltage, batReplaceability));
|
|
542
|
+
createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplaceability = PowerSource.BatReplaceability.Unspecified, batCapacity, batTimeToFullCharge, batChargingCurrent, activeBatChargeFaults) {
|
|
543
|
+
this.behaviors.require(MatterbridgePowerSourceServer.with(PowerSource.Feature.Battery, PowerSource.Feature.Rechargeable), getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, batVoltage, batReplaceability, batCapacity, batTimeToFullCharge, batChargingCurrent, activeBatChargeFaults));
|
|
544
544
|
return this;
|
|
545
545
|
}
|
|
546
546
|
createDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId = 0xfff1, vendorName = 'Matterbridge', productId = 0x8000, productName = 'Matterbridge device', softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0', productLabel = 'Matter Endpoint', productUrl = 'https://matterbridge.io', configurationVersion = 1) {
|
|
@@ -81,7 +81,7 @@ export declare function getDefaultPowerSourceReplaceableBatteryClusterServer(bat
|
|
|
81
81
|
replaceable: true;
|
|
82
82
|
wired: false;
|
|
83
83
|
}>, typeof MatterbridgePowerSourceServer>>;
|
|
84
|
-
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, {
|
|
84
|
+
export declare function getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining?: number | null, batChargeLevel?: PowerSource.BatChargeLevel, batVoltage?: number | null, batReplaceability?: PowerSource.BatReplaceability, batCapacity?: number, batTimeToFullCharge?: number | null, batChargingCurrent?: number | null, activeBatChargeFaults?: PowerSource.BatChargeFault[]): Partial<import("@matter/node").ClusterState.Type<ClusterType.WithSupportedFeatures<PowerSource, {
|
|
85
85
|
battery: true;
|
|
86
86
|
rechargeable: true;
|
|
87
87
|
replaceable: false;
|
|
@@ -927,7 +927,7 @@ export function getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentR
|
|
|
927
927
|
batQuantity,
|
|
928
928
|
});
|
|
929
929
|
}
|
|
930
|
-
export function getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplaceability = PowerSource.BatReplaceability.Unspecified) {
|
|
930
|
+
export function getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplaceability = PowerSource.BatReplaceability.Unspecified, batCapacity, batTimeToFullCharge, batChargingCurrent, activeBatChargeFaults) {
|
|
931
931
|
return optionsFor(MatterbridgePowerSourceServer.with(PowerSource.Feature.Battery, PowerSource.Feature.Rechargeable), {
|
|
932
932
|
status: PowerSource.PowerSourceStatus.Active,
|
|
933
933
|
order: 0,
|
|
@@ -943,6 +943,10 @@ export function getDefaultPowerSourceRechargeableBatteryClusterServer(batPercent
|
|
|
943
943
|
activeBatFaults: [],
|
|
944
944
|
batChargeState: PowerSource.BatChargeState.IsNotCharging,
|
|
945
945
|
batFunctionalWhileCharging: true,
|
|
946
|
+
...(batCapacity !== undefined ? { batCapacity } : {}),
|
|
947
|
+
...(batTimeToFullCharge !== undefined ? { batTimeToFullCharge } : {}),
|
|
948
|
+
...(batChargingCurrent !== undefined ? { batChargingCurrent } : {}),
|
|
949
|
+
...(activeBatChargeFaults !== undefined ? { activeBatChargeFaults } : {}),
|
|
946
950
|
});
|
|
947
951
|
}
|
|
948
952
|
export function getDefaultElectricalEnergyMeasurementClusterServer(energyImported = null, energyExported = null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.10.14-dev-
|
|
3
|
+
"version": "3.10.14-dev-20261014-8d92b7f",
|
|
4
4
|
"description": "Matterbridge core library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
},
|
|
137
137
|
"dependencies": {
|
|
138
138
|
"@matter/main": "0.17.9",
|
|
139
|
-
"@matterbridge/dgram": "3.10.14-dev-
|
|
140
|
-
"@matterbridge/thread": "3.10.14-dev-
|
|
141
|
-
"@matterbridge/types": "3.10.14-dev-
|
|
142
|
-
"@matterbridge/utils": "3.10.14-dev-
|
|
139
|
+
"@matterbridge/dgram": "3.10.14-dev-20261014-8d92b7f",
|
|
140
|
+
"@matterbridge/thread": "3.10.14-dev-20261014-8d92b7f",
|
|
141
|
+
"@matterbridge/types": "3.10.14-dev-20261014-8d92b7f",
|
|
142
|
+
"@matterbridge/utils": "3.10.14-dev-20261014-8d92b7f",
|
|
143
143
|
"escape-html": "1.0.3",
|
|
144
144
|
"express": "5.2.1",
|
|
145
145
|
"express-rate-limit": "8.7.1",
|