@matterbridge/core 3.5.3 → 3.5.4-dev-20260211-c4f9359
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/README.md +1 -1
- package/dist/cli.d.ts +0 -24
- package/dist/cli.js +1 -97
- package/dist/cliEmitter.d.ts +0 -36
- package/dist/cliEmitter.js +0 -37
- package/dist/cliHistory.d.ts +0 -42
- package/dist/cliHistory.js +0 -38
- package/dist/clusters/export.d.ts +0 -1
- package/dist/clusters/export.js +0 -2
- package/dist/deviceManager.d.ts +0 -108
- package/dist/deviceManager.js +1 -114
- package/dist/devices/airConditioner.d.ts +0 -75
- package/dist/devices/airConditioner.js +0 -57
- package/dist/devices/basicVideoPlayer.d.ts +0 -58
- package/dist/devices/basicVideoPlayer.js +1 -56
- package/dist/devices/batteryStorage.d.ts +0 -43
- package/dist/devices/batteryStorage.js +1 -48
- package/dist/devices/castingVideoPlayer.d.ts +0 -63
- package/dist/devices/castingVideoPlayer.js +2 -65
- package/dist/devices/cooktop.d.ts +0 -55
- package/dist/devices/cooktop.js +0 -56
- package/dist/devices/dishwasher.d.ts +0 -55
- package/dist/devices/dishwasher.js +0 -57
- package/dist/devices/evse.d.ts +0 -57
- package/dist/devices/evse.js +10 -74
- package/dist/devices/export.d.ts +0 -1
- package/dist/devices/export.js +0 -5
- package/dist/devices/extractorHood.d.ts +0 -41
- package/dist/devices/extractorHood.js +0 -43
- package/dist/devices/heatPump.d.ts +0 -43
- package/dist/devices/heatPump.js +2 -50
- package/dist/devices/laundryDryer.d.ts +0 -58
- package/dist/devices/laundryDryer.js +3 -62
- package/dist/devices/laundryWasher.d.ts +0 -64
- package/dist/devices/laundryWasher.js +4 -70
- package/dist/devices/microwaveOven.d.ts +1 -77
- package/dist/devices/microwaveOven.js +5 -88
- package/dist/devices/oven.d.ts +0 -82
- package/dist/devices/oven.js +0 -85
- package/dist/devices/refrigerator.d.ts +0 -100
- package/dist/devices/refrigerator.js +0 -102
- package/dist/devices/roboticVacuumCleaner.d.ts +0 -83
- package/dist/devices/roboticVacuumCleaner.js +9 -100
- package/dist/devices/solarPower.d.ts +0 -36
- package/dist/devices/solarPower.js +0 -38
- package/dist/devices/speaker.d.ts +0 -79
- package/dist/devices/speaker.js +0 -84
- package/dist/devices/temperatureControl.d.ts +0 -21
- package/dist/devices/temperatureControl.js +3 -24
- package/dist/devices/waterHeater.d.ts +0 -74
- package/dist/devices/waterHeater.js +2 -82
- package/dist/dgram/export.d.ts +0 -1
- package/dist/dgram/export.js +0 -1
- package/dist/export.d.ts +0 -23
- package/dist/export.js +0 -28
- package/dist/frontend.d.ts +0 -187
- package/dist/frontend.js +38 -539
- package/dist/helpers.d.ts +0 -43
- package/dist/helpers.js +0 -86
- package/dist/jestutils/export.d.ts +0 -1
- package/dist/jestutils/export.js +0 -1
- package/dist/jestutils/jestHelpers.d.ts +0 -259
- package/dist/jestutils/jestHelpers.js +14 -395
- package/dist/matter/behaviors.d.ts +0 -1
- package/dist/matter/behaviors.js +0 -2
- package/dist/matter/clusters.d.ts +0 -1
- package/dist/matter/clusters.js +0 -2
- package/dist/matter/devices.d.ts +0 -1
- package/dist/matter/devices.js +0 -2
- package/dist/matter/endpoints.d.ts +0 -1
- package/dist/matter/endpoints.js +0 -2
- package/dist/matter/export.d.ts +0 -1
- package/dist/matter/export.js +0 -2
- package/dist/matter/types.d.ts +0 -1
- package/dist/matter/types.js +0 -2
- package/dist/matterNode.d.ts +0 -258
- package/dist/matterNode.js +8 -356
- package/dist/matterbridge.d.ts +0 -389
- package/dist/matterbridge.js +48 -878
- package/dist/matterbridgeAccessoryPlatform.d.ts +0 -42
- package/dist/matterbridgeAccessoryPlatform.js +0 -50
- package/dist/matterbridgeBehaviors.d.ts +0 -24
- package/dist/matterbridgeBehaviors.js +5 -65
- package/dist/matterbridgeDeviceTypes.d.ts +0 -649
- package/dist/matterbridgeDeviceTypes.js +6 -673
- package/dist/matterbridgeDynamicPlatform.d.ts +0 -42
- package/dist/matterbridgeDynamicPlatform.js +0 -50
- package/dist/matterbridgeEndpoint.d.ts +0 -1369
- package/dist/matterbridgeEndpoint.js +56 -1514
- package/dist/matterbridgeEndpointHelpers.d.ts +0 -425
- package/dist/matterbridgeEndpointHelpers.js +20 -483
- package/dist/matterbridgeEndpointTypes.d.ts +0 -70
- package/dist/matterbridgeEndpointTypes.js +0 -25
- package/dist/matterbridgePlatform.d.ts +0 -434
- package/dist/matterbridgePlatform.js +1 -473
- package/dist/mb_coap.d.ts +0 -23
- package/dist/mb_coap.js +3 -41
- package/dist/mb_health.d.ts +0 -67
- package/dist/mb_health.js +0 -70
- package/dist/mb_mdns.d.ts +0 -23
- package/dist/mb_mdns.js +36 -94
- package/dist/pluginManager.d.ts +0 -307
- package/dist/pluginManager.js +6 -346
- package/dist/spawn.d.ts +0 -32
- package/dist/spawn.js +1 -71
- package/dist/utils/export.d.ts +0 -1
- package/dist/utils/export.js +0 -1
- package/package.json +27 -6
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cliEmitter.d.ts.map +0 -1
- package/dist/cliEmitter.js.map +0 -1
- package/dist/cliHistory.d.ts.map +0 -1
- package/dist/cliHistory.js.map +0 -1
- package/dist/clusters/export.d.ts.map +0 -1
- package/dist/clusters/export.js.map +0 -1
- package/dist/crypto/attestationDecoder.d.ts +0 -180
- package/dist/crypto/attestationDecoder.d.ts.map +0 -1
- package/dist/crypto/attestationDecoder.js +0 -176
- package/dist/crypto/attestationDecoder.js.map +0 -1
- package/dist/crypto/declarationDecoder.d.ts +0 -72
- package/dist/crypto/declarationDecoder.d.ts.map +0 -1
- package/dist/crypto/declarationDecoder.js +0 -241
- package/dist/crypto/declarationDecoder.js.map +0 -1
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.d.ts +0 -9
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.d.ts.map +0 -1
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.js +0 -120
- package/dist/crypto/extract/342/200/220cert/342/200/220extensions.js.map +0 -1
- package/dist/crypto/read-extensions.d.ts +0 -2
- package/dist/crypto/read-extensions.d.ts.map +0 -1
- package/dist/crypto/read-extensions.js +0 -81
- package/dist/crypto/read-extensions.js.map +0 -1
- package/dist/crypto/testData.d.ts +0 -31
- package/dist/crypto/testData.d.ts.map +0 -1
- package/dist/crypto/testData.js +0 -131
- package/dist/crypto/testData.js.map +0 -1
- package/dist/crypto/walk-der.d.ts +0 -2
- package/dist/crypto/walk-der.d.ts.map +0 -1
- package/dist/crypto/walk-der.js +0 -165
- package/dist/crypto/walk-der.js.map +0 -1
- package/dist/deviceManager.d.ts.map +0 -1
- package/dist/deviceManager.js.map +0 -1
- package/dist/devices/airConditioner.d.ts.map +0 -1
- package/dist/devices/airConditioner.js.map +0 -1
- package/dist/devices/basicVideoPlayer.d.ts.map +0 -1
- package/dist/devices/basicVideoPlayer.js.map +0 -1
- package/dist/devices/batteryStorage.d.ts.map +0 -1
- package/dist/devices/batteryStorage.js.map +0 -1
- package/dist/devices/castingVideoPlayer.d.ts.map +0 -1
- package/dist/devices/castingVideoPlayer.js.map +0 -1
- package/dist/devices/cooktop.d.ts.map +0 -1
- package/dist/devices/cooktop.js.map +0 -1
- package/dist/devices/dishwasher.d.ts.map +0 -1
- package/dist/devices/dishwasher.js.map +0 -1
- package/dist/devices/evse.d.ts.map +0 -1
- package/dist/devices/evse.js.map +0 -1
- package/dist/devices/export.d.ts.map +0 -1
- package/dist/devices/export.js.map +0 -1
- package/dist/devices/extractorHood.d.ts.map +0 -1
- package/dist/devices/extractorHood.js.map +0 -1
- package/dist/devices/heatPump.d.ts.map +0 -1
- package/dist/devices/heatPump.js.map +0 -1
- package/dist/devices/laundryDryer.d.ts.map +0 -1
- package/dist/devices/laundryDryer.js.map +0 -1
- package/dist/devices/laundryWasher.d.ts.map +0 -1
- package/dist/devices/laundryWasher.js.map +0 -1
- package/dist/devices/microwaveOven.d.ts.map +0 -1
- package/dist/devices/microwaveOven.js.map +0 -1
- package/dist/devices/oven.d.ts.map +0 -1
- package/dist/devices/oven.js.map +0 -1
- package/dist/devices/refrigerator.d.ts.map +0 -1
- package/dist/devices/refrigerator.js.map +0 -1
- package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
- package/dist/devices/roboticVacuumCleaner.js.map +0 -1
- package/dist/devices/solarPower.d.ts.map +0 -1
- package/dist/devices/solarPower.js.map +0 -1
- package/dist/devices/speaker.d.ts.map +0 -1
- package/dist/devices/speaker.js.map +0 -1
- package/dist/devices/temperatureControl.d.ts.map +0 -1
- package/dist/devices/temperatureControl.js.map +0 -1
- package/dist/devices/waterHeater.d.ts.map +0 -1
- package/dist/devices/waterHeater.js.map +0 -1
- package/dist/dgram/export.d.ts.map +0 -1
- package/dist/dgram/export.js.map +0 -1
- package/dist/export.d.ts.map +0 -1
- package/dist/export.js.map +0 -1
- package/dist/frontend.d.ts.map +0 -1
- package/dist/frontend.js.map +0 -1
- package/dist/helpers.d.ts.map +0 -1
- package/dist/helpers.js.map +0 -1
- package/dist/jestutils/export.d.ts.map +0 -1
- package/dist/jestutils/export.js.map +0 -1
- package/dist/jestutils/jestHelpers.d.ts.map +0 -1
- package/dist/jestutils/jestHelpers.js.map +0 -1
- package/dist/matter/behaviors.d.ts.map +0 -1
- package/dist/matter/behaviors.js.map +0 -1
- package/dist/matter/clusters.d.ts.map +0 -1
- package/dist/matter/clusters.js.map +0 -1
- package/dist/matter/devices.d.ts.map +0 -1
- package/dist/matter/devices.js.map +0 -1
- package/dist/matter/endpoints.d.ts.map +0 -1
- package/dist/matter/endpoints.js.map +0 -1
- package/dist/matter/export.d.ts.map +0 -1
- package/dist/matter/export.js.map +0 -1
- package/dist/matter/types.d.ts.map +0 -1
- package/dist/matter/types.js.map +0 -1
- package/dist/matterNode.d.ts.map +0 -1
- package/dist/matterNode.js.map +0 -1
- package/dist/matterbridge.d.ts.map +0 -1
- package/dist/matterbridge.js.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
- package/dist/matterbridgeBehaviors.d.ts.map +0 -1
- package/dist/matterbridgeBehaviors.js.map +0 -1
- package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
- package/dist/matterbridgeDeviceTypes.js.map +0 -1
- package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
- package/dist/matterbridgeDynamicPlatform.js.map +0 -1
- package/dist/matterbridgeEndpoint.d.ts.map +0 -1
- package/dist/matterbridgeEndpoint.js.map +0 -1
- package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
- package/dist/matterbridgeEndpointHelpers.js.map +0 -1
- package/dist/matterbridgeEndpointTypes.d.ts.map +0 -1
- package/dist/matterbridgeEndpointTypes.js.map +0 -1
- package/dist/matterbridgePlatform.d.ts.map +0 -1
- package/dist/matterbridgePlatform.js.map +0 -1
- package/dist/mb_coap.d.ts.map +0 -1
- package/dist/mb_coap.js.map +0 -1
- package/dist/mb_health.d.ts.map +0 -1
- package/dist/mb_health.js.map +0 -1
- package/dist/mb_mdns.d.ts.map +0 -1
- package/dist/mb_mdns.js.map +0 -1
- package/dist/pluginManager.d.ts.map +0 -1
- package/dist/pluginManager.js.map +0 -1
- package/dist/spawn.d.ts.map +0 -1
- package/dist/spawn.js.map +0 -1
- package/dist/utils/export.d.ts.map +0 -1
- package/dist/utils/export.js.map +0 -1
- package/dist/workers/brand.d.ts +0 -25
- package/dist/workers/brand.d.ts.map +0 -1
- package/dist/workers/brand.extend.d.ts +0 -10
- package/dist/workers/brand.extend.d.ts.map +0 -1
- package/dist/workers/brand.extend.js +0 -15
- package/dist/workers/brand.extend.js.map +0 -1
- package/dist/workers/brand.invalid.d.ts +0 -9
- package/dist/workers/brand.invalid.d.ts.map +0 -1
- package/dist/workers/brand.invalid.js +0 -19
- package/dist/workers/brand.invalid.js.map +0 -1
- package/dist/workers/brand.js +0 -67
- package/dist/workers/brand.js.map +0 -1
- package/dist/workers/clusterTypes.d.ts +0 -47
- package/dist/workers/clusterTypes.d.ts.map +0 -1
- package/dist/workers/clusterTypes.js +0 -57
- package/dist/workers/clusterTypes.js.map +0 -1
- package/dist/workers/frontendWorker.d.ts +0 -2
- package/dist/workers/frontendWorker.d.ts.map +0 -1
- package/dist/workers/frontendWorker.js +0 -90
- package/dist/workers/frontendWorker.js.map +0 -1
- package/dist/workers/helloWorld.d.ts +0 -2
- package/dist/workers/helloWorld.d.ts.map +0 -1
- package/dist/workers/helloWorld.js +0 -135
- package/dist/workers/helloWorld.js.map +0 -1
- package/dist/workers/matterWorker.d.ts +0 -2
- package/dist/workers/matterWorker.d.ts.map +0 -1
- package/dist/workers/matterWorker.js +0 -104
- package/dist/workers/matterWorker.js.map +0 -1
- package/dist/workers/matterbridgeWorker.d.ts +0 -2
- package/dist/workers/matterbridgeWorker.d.ts.map +0 -1
- package/dist/workers/matterbridgeWorker.js +0 -75
- package/dist/workers/matterbridgeWorker.js.map +0 -1
- package/dist/workers/messageLab.d.ts +0 -134
- package/dist/workers/messageLab.d.ts.map +0 -1
- package/dist/workers/messageLab.js +0 -129
- package/dist/workers/messageLab.js.map +0 -1
- package/dist/workers/testWorker.d.ts +0 -2
- package/dist/workers/testWorker.d.ts.map +0 -1
- package/dist/workers/testWorker.js +0 -45
- package/dist/workers/testWorker.js.map +0 -1
- package/dist/workers/usage.d.ts +0 -19
- package/dist/workers/usage.d.ts.map +0 -1
- package/dist/workers/usage.js +0 -140
- package/dist/workers/usage.js.map +0 -1
- package/dist/workers/workerManager.d.ts +0 -115
- package/dist/workers/workerManager.d.ts.map +0 -1
- package/dist/workers/workerManager.js +0 -464
- package/dist/workers/workerManager.js.map +0 -1
- package/dist/workers/workerServer.d.ts +0 -126
- package/dist/workers/workerServer.d.ts.map +0 -1
- package/dist/workers/workerServer.js +0 -340
- package/dist/workers/workerServer.js.map +0 -1
- package/dist/workers/workerTypes.d.ts +0 -23
- package/dist/workers/workerTypes.d.ts.map +0 -1
- package/dist/workers/workerTypes.js +0 -3
- package/dist/workers/workerTypes.js.map +0 -1
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the types for MatterbridgeEndpoint.
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgeEndpointTypes.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @created 2025-11-10
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
* @license Apache-2.0
|
|
9
|
-
*
|
|
10
|
-
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
* you may not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*/
|
|
24
1
|
import { Semtag } from '@matter/types/globals';
|
|
25
2
|
import { ClusterId, EndpointNumber } from '@matter/types/datatype';
|
|
26
3
|
import { HandlerFunction } from '@matter/general';
|
|
@@ -117,56 +94,9 @@ export interface SerializedMatterbridgeEndpoint {
|
|
|
117
94
|
id: string | undefined;
|
|
118
95
|
clusterServersId: ClusterId[];
|
|
119
96
|
}
|
|
120
|
-
/**
|
|
121
|
-
* MatterbridgeEndpointOptions interface is used to define the options for a Matterbridge endpoint.
|
|
122
|
-
*
|
|
123
|
-
* @remarks
|
|
124
|
-
* - tagList?: Semtag[]. It is used to disambiguate the sibling child endpoints (9.2.3. Disambiguation rule).
|
|
125
|
-
* - mfgCode: VendorId | null,
|
|
126
|
-
* - namespaceId: number,
|
|
127
|
-
* - tag: number,
|
|
128
|
-
* - label: string | undefined | null
|
|
129
|
-
* - mode?: 'server' | 'matter'. It is used to activate a special mode for the endpoint.
|
|
130
|
-
* - id?: string. It is the unique storage key for the endpoint.
|
|
131
|
-
* - number?: EndpointNumber. It is the endpoint number for the endpoint.
|
|
132
|
-
*/
|
|
133
97
|
export interface MatterbridgeEndpointOptions {
|
|
134
|
-
/**
|
|
135
|
-
* The semantic tags array for the endpoint.
|
|
136
|
-
* The tagList is used to disambiguate the sibling child endpoints (9.2.3. Disambiguation rule).
|
|
137
|
-
* The tagList is used to identify the endpoint and to provide additional information about the endpoint.
|
|
138
|
-
*
|
|
139
|
-
* @remarks
|
|
140
|
-
* - mfgCode: VendorId | null,
|
|
141
|
-
* - namespaceId: number,
|
|
142
|
-
* - tag: number,
|
|
143
|
-
* - label: string | undefined | null
|
|
144
|
-
*/
|
|
145
98
|
tagList?: Semtag[];
|
|
146
|
-
/**
|
|
147
|
-
* Activates a special mode for this endpoint.
|
|
148
|
-
* - 'server': it creates the device server node and add the device as Matter device that needs to be paired individually.
|
|
149
|
-
* In this case the Matterbridge bridge mode (bridge or childbridge) is not relevant. The device is independent.
|
|
150
|
-
*
|
|
151
|
-
* - 'matter': it adds the device directly to the Matterbridge server node as Matter device alongside the aggregator. In this case the implementation must respect
|
|
152
|
-
* the 9.2.3. Disambiguation rule (i.e. use taglist if needed cause the device doesn't have nodeLabel).
|
|
153
|
-
* Furthermore the device will be a part of the bridge (i.e. will have the same name and will be in the same room).
|
|
154
|
-
* See 9.12.2.2. Native Matter functionality in Bridge.
|
|
155
|
-
*
|
|
156
|
-
* @remarks
|
|
157
|
-
* Always use createDefaultBasicInformationClusterServer() to create the BasicInformation cluster server when using mode 'server' or 'matter'.
|
|
158
|
-
*/
|
|
159
99
|
mode?: 'server' | 'matter';
|
|
160
|
-
/**
|
|
161
|
-
* The unique storage key for the endpoint.
|
|
162
|
-
* If not provided, a default key will be used.
|
|
163
|
-
*/
|
|
164
100
|
id?: string;
|
|
165
|
-
/**
|
|
166
|
-
* The endpoint number for the endpoint.
|
|
167
|
-
* If not provided, the endpoint will be created with the next available endpoint number.
|
|
168
|
-
* If provided, the endpoint will be created with the specified endpoint number.
|
|
169
|
-
*/
|
|
170
101
|
number?: EndpointNumber;
|
|
171
102
|
}
|
|
172
|
-
//# sourceMappingURL=matterbridgeEndpointTypes.d.ts.map
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the types for MatterbridgeEndpoint.
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgeEndpointTypes.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @created 2025-11-10
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
* @license Apache-2.0
|
|
9
|
-
*
|
|
10
|
-
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
* you may not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*/
|
|
24
|
-
// eslint-disable-next-line no-console
|
|
25
1
|
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
26
2
|
console.log('\u001B[32mMatterbridgeEndpointTypes loaded.\u001B[40;0m');
|
|
27
3
|
export {};
|
|
28
|
-
//# sourceMappingURL=matterbridgeEndpointTypes.js.map
|
|
@@ -1,391 +1,63 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class MatterbridgePlatform.
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgePlatform.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @created 2024-03-21
|
|
7
|
-
* @version 1.6.1
|
|
8
|
-
* @license Apache-2.0
|
|
9
|
-
*
|
|
10
|
-
* Copyright 2024, 2025, 2026 Luca Liguori.
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
* you may not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*/
|
|
24
1
|
import { AnsiLogger, LogLevel } from 'node-ansi-logger';
|
|
25
2
|
import { NodeStorage } from 'node-persist-manager';
|
|
26
3
|
import { EndpointNumber } from '@matter/types/datatype';
|
|
27
4
|
import type { ApiSelectDevice, ApiSelectEntity, PlatformConfig, PlatformMatterbridge, PlatformSchema } from '@matterbridge/types';
|
|
28
5
|
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
29
6
|
export type { PlatformConfig, PlatformConfigValue, PlatformSchemaValue, PlatformSchema, PlatformMatterbridge } from '@matterbridge/types';
|
|
30
|
-
/**
|
|
31
|
-
* Type guard to check whether a value is a MatterbridgePlatform instance.
|
|
32
|
-
*
|
|
33
|
-
* @param {unknown} value - the value to check
|
|
34
|
-
* @returns { value is MatterbridgePlatform } - true if the value is a MatterbridgePlatform instance
|
|
35
|
-
*/
|
|
36
7
|
export declare function isMatterbridgePlatform(value: unknown): value is MatterbridgePlatform;
|
|
37
|
-
/**
|
|
38
|
-
* Assert that a value is a MatterbridgePlatform instance.
|
|
39
|
-
*
|
|
40
|
-
* @param {unknown} value - the value to check
|
|
41
|
-
* @param {string} [context] - optional context for error message
|
|
42
|
-
* @returns {asserts value is MatterbridgePlatform} - asserts that the value is a MatterbridgePlatform instance
|
|
43
|
-
* @throws {TypeError} - if the value is not a MatterbridgePlatform instance
|
|
44
|
-
*/
|
|
45
8
|
export declare function assertMatterbridgePlatform(value: unknown, context?: string): asserts value is MatterbridgePlatform;
|
|
46
|
-
/**
|
|
47
|
-
* Represents the base Matterbridge platform. It is extended by the MatterbridgeAccessoryPlatform and MatterbridgeServicePlatform classes.
|
|
48
|
-
*
|
|
49
|
-
*/
|
|
50
9
|
export declare class MatterbridgePlatform {
|
|
51
10
|
#private;
|
|
52
|
-
/** The PlatformMatterbridge instance of this Platform. */
|
|
53
11
|
readonly matterbridge: PlatformMatterbridge;
|
|
54
|
-
/** The logger instance for this platform. Created by the PluginManager.load() method. */
|
|
55
12
|
readonly log: AnsiLogger;
|
|
56
|
-
/** The configuration for this platform. Set by the PluginManager.load() method using the stored config file. */
|
|
57
13
|
config: PlatformConfig;
|
|
58
|
-
/** The name of the platform. Set by the PluginManager.load() method using the package.json name value. */
|
|
59
14
|
name: string;
|
|
60
|
-
/** The type of the platform. Set by the extending classes: MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform */
|
|
61
15
|
type: 'DynamicPlatform' | 'AccessoryPlatform' | 'AnyPlatform';
|
|
62
|
-
/** The version of the platform. Set by the PluginManager.load() method using the package.json version value. */
|
|
63
16
|
version: string;
|
|
64
|
-
/** Platform context in the storage of matterbridgeDirectory. Use await platform.ready to access it early. */
|
|
65
17
|
context?: NodeStorage;
|
|
66
|
-
/** Indicates whether the platform is is fully initialized (including context and selects). */
|
|
67
18
|
isReady: boolean;
|
|
68
|
-
/** Indicates whether the platform has been loaded. */
|
|
69
19
|
isLoaded: boolean;
|
|
70
|
-
/** Indicates whether the platform has been started. */
|
|
71
20
|
isStarted: boolean;
|
|
72
|
-
/** Indicates whether the platform has been configured. */
|
|
73
21
|
isConfigured: boolean;
|
|
74
|
-
/** Indicates whether the platform is shutting down. */
|
|
75
22
|
isShuttingDown: boolean;
|
|
76
|
-
/** The ready promise for the platform, which resolves when the platform is fully initialized (including context and selects). Await platform.ready if you access the platform context or select early. */
|
|
77
23
|
readonly ready: Promise<void>;
|
|
78
|
-
/**
|
|
79
|
-
* MatterNode helpers injected by the PluginManager.load() method
|
|
80
|
-
*
|
|
81
|
-
* @param {(pluginName: string, device: MatterbridgeEndpoint) => Promise<void>} addBridgedEndpoint - Function to add a bridged endpoint.
|
|
82
|
-
* @param {(pluginName: string, device: MatterbridgeEndpoint) => Promise<void>} removeBridgedEndpoint - Function to remove a bridged endpoint.
|
|
83
|
-
* @param {(pluginName: string, delay?: number) => Promise<void>} removeAllBridgedEndpoints - Function to remove all bridged endpoints.
|
|
84
|
-
* @param {(pluginName: string, name: string, type: 'light' | 'outlet' | 'switch' | 'mounted_switch', callback: () => Promise<void>) => Promise<boolean>} addVirtualEndpoint - Function to add a virtual endpoint.
|
|
85
|
-
*/
|
|
86
24
|
private setMatterNode;
|
|
87
|
-
/**
|
|
88
|
-
* Creates an instance of the base MatterbridgePlatform.
|
|
89
|
-
* Each plugin must extend the MatterbridgeDynamicPlatform or MatterbridgeAccessoryPlatform class.
|
|
90
|
-
* MatterbridgePlatform cannot be instantiated directly, it can only be extended by the MatterbridgeDynamicPlatform or MatterbridgeAccessoryPlatform class.
|
|
91
|
-
*
|
|
92
|
-
* @param {PlatformMatterbridge} matterbridge - The PlatformMatterbridge instance.
|
|
93
|
-
* @param {AnsiLogger} log - The logger instance.
|
|
94
|
-
* @param {PlatformConfig} config - The platform configuration.
|
|
95
|
-
*/
|
|
96
25
|
protected constructor(matterbridge: PlatformMatterbridge, log: AnsiLogger, config: PlatformConfig);
|
|
97
|
-
/**
|
|
98
|
-
* Destroys the platform, cleaning up memory, closing storage and broadcast server.
|
|
99
|
-
*/
|
|
100
26
|
private destroy;
|
|
101
|
-
/**
|
|
102
|
-
* This method shall be overridden in the extended class.
|
|
103
|
-
* It is called when the platform is started.
|
|
104
|
-
* Use this method to create the MatterbridgeEndpoints and call this.registerDevice().
|
|
105
|
-
*
|
|
106
|
-
* @param {string} [reason] - The reason for starting.
|
|
107
|
-
* @throws {Error} - Throws an error if the method is not overridden.
|
|
108
|
-
*/
|
|
109
27
|
onStart(reason?: string): Promise<void>;
|
|
110
|
-
/**
|
|
111
|
-
* This method can be overridden in the extended class. In this case always call super.onConfigure() to save the select and run checkEndpointNumbers().
|
|
112
|
-
* It is called after the platform has started.
|
|
113
|
-
* Use this method to perform any configuration of your devices and to override the value of the attributes that are persistent and stored in the
|
|
114
|
-
* matter storage (i.e. the onOff attribute of the OnOff cluster).
|
|
115
|
-
*/
|
|
116
28
|
onConfigure(): Promise<void>;
|
|
117
|
-
/**
|
|
118
|
-
* This method can be overridden in the extended class. In this case always call super.onShutdown() to save the selects, run checkEndpointNumbers() and cleanup memory.
|
|
119
|
-
* It is called when the platform is shutting down.
|
|
120
|
-
* Use this method to clean up any resources you used in the constructor or onStart.
|
|
121
|
-
*
|
|
122
|
-
* @param {string} [reason] - The reason for shutting down.
|
|
123
|
-
*/
|
|
124
29
|
onShutdown(reason?: string): Promise<void>;
|
|
125
|
-
/**
|
|
126
|
-
* Called when the logger level is changed.
|
|
127
|
-
*
|
|
128
|
-
* @param {LogLevel} logLevel The new logger level.
|
|
129
|
-
*/
|
|
130
30
|
onChangeLoggerLevel(logLevel: LogLevel): Promise<void>;
|
|
131
|
-
/**
|
|
132
|
-
* Called when a plugin config includes an action button or an action button with text field.
|
|
133
|
-
*
|
|
134
|
-
* @param {string} action The action triggered by the button in plugin config.
|
|
135
|
-
* @param {string} value The value of the field of the action button.
|
|
136
|
-
* @param {string} id The id of the schema associated with the action.
|
|
137
|
-
* @param {PlatformConfig} formData The changed form data of the plugin.
|
|
138
|
-
*
|
|
139
|
-
* @remarks
|
|
140
|
-
* This method can be overridden in the extended class.
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* Use this method to handle the action defined in the plugin schema:
|
|
144
|
-
* ```json
|
|
145
|
-
* "addDevice": {
|
|
146
|
-
* "description": "Manually add a device that has not been discovered with mdns:",
|
|
147
|
-
* "type": "boolean",
|
|
148
|
-
* "buttonText": "ADD", // The text on the button. This is used when the action doesn't include a text field.
|
|
149
|
-
* "buttonField": "ADD", // The text on the button. This is used when the action includes a text field.
|
|
150
|
-
* "buttonClose": false, // optional, default is false. When true, the dialog will close after the action is sent.
|
|
151
|
-
* "buttonSave": false, // optional, default is false. When true, the dialog will close and trigger the restart required after the action is sent.
|
|
152
|
-
* "textPlaceholder": "Enter the device IP address", // optional: the placeholder text for the text field.
|
|
153
|
-
* "default": false
|
|
154
|
-
* },
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
31
|
onAction(action: string, value?: string, id?: string, formData?: PlatformConfig): Promise<void>;
|
|
158
|
-
/**
|
|
159
|
-
* Called when the plugin config has been updated.
|
|
160
|
-
*
|
|
161
|
-
* @param {PlatformConfig} config The new plugin config.
|
|
162
|
-
*/
|
|
163
32
|
onConfigChanged(config: PlatformConfig): Promise<void>;
|
|
164
|
-
/**
|
|
165
|
-
* Save the platform configuration to the platform config JSON.
|
|
166
|
-
*
|
|
167
|
-
* @param {PlatformConfig} [config] - The platform configuration to save.
|
|
168
|
-
* @returns {void}
|
|
169
|
-
*/
|
|
170
33
|
saveConfig(config: PlatformConfig): void;
|
|
171
|
-
/**
|
|
172
|
-
* Get the platform schema for the config editor. This will retrieve the schema from the Matterbridge plugin manager.
|
|
173
|
-
*
|
|
174
|
-
* @returns {Promise<PlatformSchema | undefined>} The platform schema.
|
|
175
|
-
*/
|
|
176
34
|
getSchema(): Promise<PlatformSchema | undefined>;
|
|
177
|
-
/**
|
|
178
|
-
* Set the platform schema for the config editor. This will update the schema in the Matterbridge plugin manager but will not change the schema file.
|
|
179
|
-
* It must be called from onStart() to update the schema in the plugin.
|
|
180
|
-
* Calling this method from the platform constructor will have no effect.
|
|
181
|
-
*
|
|
182
|
-
* @param {PlatformSchema} [schema] - The platform schema to set.
|
|
183
|
-
* @returns {void}
|
|
184
|
-
*/
|
|
185
35
|
setSchema(schema: PlatformSchema): void;
|
|
186
|
-
/**
|
|
187
|
-
* Sends a restart required message to the frontend.
|
|
188
|
-
*
|
|
189
|
-
* @param {boolean} [snackbar] - If true, shows a snackbar notification. Default is true.
|
|
190
|
-
* @param {boolean} [fixed] - If true, shows a fixed notification. Default is false.
|
|
191
|
-
* @returns {void}
|
|
192
|
-
*/
|
|
193
36
|
wssSendRestartRequired(snackbar?: boolean, fixed?: boolean): void;
|
|
194
|
-
/**
|
|
195
|
-
* Sends an open snackbar message to all connected clients.
|
|
196
|
-
*
|
|
197
|
-
* @param {string} message - The message to send.
|
|
198
|
-
* @param {number} timeout - The timeout in seconds for the snackbar message. Default is 5 seconds.
|
|
199
|
-
* @param {'info' | 'warning' | 'error' | 'success'} severity - The severity of the message.
|
|
200
|
-
* possible values are: 'info', 'warning', 'error', 'success'. Default is 'info'.
|
|
201
|
-
*
|
|
202
|
-
* @remarks
|
|
203
|
-
* If timeout is 0, the snackbar message will be displayed until closed by the user.
|
|
204
|
-
*/
|
|
205
37
|
wssSendSnackbarMessage(message: string, timeout?: number, severity?: 'error' | 'success' | 'info' | 'warning'): void;
|
|
206
|
-
/**
|
|
207
|
-
* Retrieves the number of devices registered with the platform.
|
|
208
|
-
*
|
|
209
|
-
* @returns {number} The number of registered devices.
|
|
210
|
-
*/
|
|
211
38
|
size(): number;
|
|
212
|
-
/**
|
|
213
|
-
* Retrieves the devices registered with the platform.
|
|
214
|
-
*
|
|
215
|
-
* @returns {MatterbridgeEndpoint[]} The registered devices.
|
|
216
|
-
*/
|
|
217
39
|
getDevices(): MatterbridgeEndpoint[];
|
|
218
|
-
/**
|
|
219
|
-
* Retrieves a registered device by its name.
|
|
220
|
-
*
|
|
221
|
-
* @param {string} deviceName - The device name to search for.
|
|
222
|
-
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
223
|
-
*/
|
|
224
40
|
getDeviceByName(deviceName: string): MatterbridgeEndpoint | undefined;
|
|
225
|
-
/**
|
|
226
|
-
* Retrieves a registered device by its uniqueId.
|
|
227
|
-
*
|
|
228
|
-
* @param {string} uniqueId - The device unique ID to search for.
|
|
229
|
-
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
230
|
-
*/
|
|
231
41
|
getDeviceByUniqueId(uniqueId: string): MatterbridgeEndpoint | undefined;
|
|
232
|
-
/**
|
|
233
|
-
* Retrieves a registered device by its serialNumber.
|
|
234
|
-
*
|
|
235
|
-
* @param {string} serialNumber - The device serial number to search for.
|
|
236
|
-
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
237
|
-
*/
|
|
238
42
|
getDeviceBySerialNumber(serialNumber: string): MatterbridgeEndpoint | undefined;
|
|
239
|
-
/**
|
|
240
|
-
* Retrieves a registered device by its id.
|
|
241
|
-
*
|
|
242
|
-
* @param {string} id - The device id to search for.
|
|
243
|
-
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
244
|
-
*/
|
|
245
43
|
getDeviceById(id: string): MatterbridgeEndpoint | undefined;
|
|
246
|
-
/**
|
|
247
|
-
* Retrieves a registered device by its originalId.
|
|
248
|
-
*
|
|
249
|
-
* @param {string} originalId - The device originalId to search for.
|
|
250
|
-
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
251
|
-
*/
|
|
252
44
|
getDeviceByOriginalId(originalId: string): MatterbridgeEndpoint | undefined;
|
|
253
|
-
/**
|
|
254
|
-
* Retrieves a registered device by its number.
|
|
255
|
-
*
|
|
256
|
-
* @param {EndpointNumber | number} number - The device number to search for.
|
|
257
|
-
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
258
|
-
*/
|
|
259
45
|
getDeviceByNumber(number: EndpointNumber | number): MatterbridgeEndpoint | undefined;
|
|
260
|
-
/**
|
|
261
|
-
* Checks if a device with this name is already registered in the platform.
|
|
262
|
-
*
|
|
263
|
-
* @param {string} deviceName - The device name to check.
|
|
264
|
-
* @returns {boolean} True if the device is already registered, false otherwise.
|
|
265
|
-
*/
|
|
266
46
|
hasDeviceName(deviceName: string): boolean;
|
|
267
|
-
/**
|
|
268
|
-
* Checks if a device with this uniqueId is already registered in the platform.
|
|
269
|
-
*
|
|
270
|
-
* @param {string} deviceUniqueId - The device unique ID to check.
|
|
271
|
-
* @returns {boolean} True if the device is already registered, false otherwise.
|
|
272
|
-
*/
|
|
273
47
|
hasDeviceUniqueId(deviceUniqueId: string): boolean;
|
|
274
|
-
/**
|
|
275
|
-
* Registers a virtual device with the Matterbridge platform.
|
|
276
|
-
* Virtual devices are only supported in bridge mode and childbridge mode with a DynamicPlatform.
|
|
277
|
-
*
|
|
278
|
-
* The virtual device is created as an instance of `Endpoint` with the provided device type.
|
|
279
|
-
* When the virtual device is turned on, the provided callback function is executed.
|
|
280
|
-
* The onOff state of the virtual device always reverts to false when the device is turned on.
|
|
281
|
-
*
|
|
282
|
-
* @param { string } name - The name of the virtual device.
|
|
283
|
-
* @param { 'light' | 'outlet' | 'switch' | 'mounted_switch' } type - The type of the virtual device.
|
|
284
|
-
* @param { () => Promise<void> } callback - The callback to call when the virtual device is turned on.
|
|
285
|
-
*
|
|
286
|
-
* @returns {Promise<boolean>} A promise that resolves to true if the virtual device was successfully registered, false otherwise.
|
|
287
|
-
*
|
|
288
|
-
* @remarks
|
|
289
|
-
* The virtual devices don't show up in the device list of the frontend.
|
|
290
|
-
* Type 'switch' is not supported by Alexa and 'mounted_switch' is not supported by Apple Home.
|
|
291
|
-
*/
|
|
292
48
|
registerVirtualDevice(name: string, type: 'light' | 'outlet' | 'switch' | 'mounted_switch', callback: () => Promise<void>): Promise<boolean>;
|
|
293
|
-
/**
|
|
294
|
-
* Registers a device with the Matterbridge platform and performs validation checks.
|
|
295
|
-
*
|
|
296
|
-
* This method also checks if the implementation called createDefaultBasicInformationClusterServer() instead of createDefaultBridgedDeviceBasicInformationClusterServer().
|
|
297
|
-
*
|
|
298
|
-
* This is correct with Accessory platforms so we check if we are running in bridge mode and add the bridgedNode and the BridgedDeviceBasicInformation cluster.
|
|
299
|
-
*
|
|
300
|
-
* If we are in bridge mode, we add the bridgedNode device type and the BridgedDeviceBasicInformation cluster.
|
|
301
|
-
*
|
|
302
|
-
* If we are in childbridge mode and the plugin is a 'DynamicPlatform', we add the bridgedNode device type and the BridgedDeviceBasicInformation cluster.
|
|
303
|
-
*
|
|
304
|
-
* if we are in childbridge mode and the plugin is a 'AccessoryPlatform', the device is not bridged so no action is taken.
|
|
305
|
-
*
|
|
306
|
-
* If the device.mode = 'server', the device is not bridged so no action is taken.
|
|
307
|
-
*
|
|
308
|
-
* If the device.mode = 'matter', the device is not bridged so no action is taken.
|
|
309
|
-
*
|
|
310
|
-
* @param {MatterbridgeEndpoint} device - The device to register.
|
|
311
|
-
*/
|
|
312
49
|
registerDevice(device: MatterbridgeEndpoint): Promise<void>;
|
|
313
|
-
/**
|
|
314
|
-
* Unregisters a device registered with the Matterbridge platform.
|
|
315
|
-
*
|
|
316
|
-
* @param {MatterbridgeEndpoint} device - The device to unregister.
|
|
317
|
-
*/
|
|
318
50
|
unregisterDevice(device: MatterbridgeEndpoint): Promise<void>;
|
|
319
|
-
/**
|
|
320
|
-
* Unregisters all devices registered with the Matterbridge platform.
|
|
321
|
-
*
|
|
322
|
-
* @param {number} [delay] - The delay in milliseconds between removing each bridged endpoint (default: 0).
|
|
323
|
-
*/
|
|
324
51
|
unregisterAllDevices(delay?: number): Promise<void>;
|
|
325
|
-
/**
|
|
326
|
-
* Saves the select devices and entities to storage.
|
|
327
|
-
*
|
|
328
|
-
* This method saves the current state of `selectDevice` and `selectEntity` maps to their respective storage.
|
|
329
|
-
* It logs the number of items being saved and ensures that the storage is properly closed after saving.
|
|
330
|
-
*
|
|
331
|
-
* @returns {Promise<void>} A promise that resolves when the save operation is complete.
|
|
332
|
-
*/
|
|
333
52
|
private saveSelects;
|
|
334
|
-
/**
|
|
335
|
-
* Clears all the select device and entity maps and saves the changes to the storage.
|
|
336
|
-
*
|
|
337
|
-
* @returns {void}
|
|
338
|
-
*/
|
|
339
53
|
clearSelect(): Promise<void>;
|
|
340
|
-
/**
|
|
341
|
-
* Clears the select for a single device and saves the changes to the storage.
|
|
342
|
-
*
|
|
343
|
-
* @param {string} serial - The serial of the device to clear.
|
|
344
|
-
* @returns {void}
|
|
345
|
-
*/
|
|
346
54
|
clearDeviceSelect(serial: string): Promise<void>;
|
|
347
|
-
/**
|
|
348
|
-
* Clears the select for a single entity and saves the changes to the storage.
|
|
349
|
-
*
|
|
350
|
-
* @param {string} name - The name of the entity to clear.
|
|
351
|
-
* @returns {void}
|
|
352
|
-
*/
|
|
353
55
|
clearEntitySelect(name: string): Promise<void>;
|
|
354
|
-
/**
|
|
355
|
-
* Set the select device in the platform map.
|
|
356
|
-
*
|
|
357
|
-
* @param {string} serial - The serial number of the device.
|
|
358
|
-
* @param {string} name - The name of the device.
|
|
359
|
-
* @param {string} [configUrl] - The configuration URL of the device.
|
|
360
|
-
* @param {string} [icon] - The icon of the device: 'wifi', 'ble', 'hub'
|
|
361
|
-
* @param {Array<{ name: string; description: string; icon?: string }>} [entities] - The entities associated with the device.
|
|
362
|
-
* @returns {void}
|
|
363
|
-
*
|
|
364
|
-
* @remarks
|
|
365
|
-
* In the schema use selectFrom: 'serial' or 'name'
|
|
366
|
-
* ```json
|
|
367
|
-
* "whiteList": {
|
|
368
|
-
* "description": "Only the devices in the list will be exposed.",
|
|
369
|
-
* "type": "array",
|
|
370
|
-
* "items": {
|
|
371
|
-
* "type": "string"
|
|
372
|
-
* },
|
|
373
|
-
* "uniqueItems": true,
|
|
374
|
-
* "selectFrom": "name"
|
|
375
|
-
* },
|
|
376
|
-
* ```
|
|
377
|
-
*/
|
|
378
56
|
setSelectDevice(serial: string, name: string, configUrl?: string, icon?: string, entities?: {
|
|
379
57
|
name: string;
|
|
380
58
|
description: string;
|
|
381
59
|
icon?: string;
|
|
382
60
|
}[]): void;
|
|
383
|
-
/**
|
|
384
|
-
* Retrieve a select device by serial.
|
|
385
|
-
*
|
|
386
|
-
* @param {string} serial - The serial number of the device.
|
|
387
|
-
* @returns {{ serial: string; name: string; configUrl?: string; icon?: string; entities?: { name: string; description: string; icon?: string }[] } | undefined} The select device or undefined if not found.
|
|
388
|
-
*/
|
|
389
61
|
getSelectDevice(serial: string): {
|
|
390
62
|
serial: string;
|
|
391
63
|
name: string;
|
|
@@ -397,124 +69,18 @@ export declare class MatterbridgePlatform {
|
|
|
397
69
|
icon?: string;
|
|
398
70
|
}[];
|
|
399
71
|
} | undefined;
|
|
400
|
-
/**
|
|
401
|
-
* Set the select device entity in the platform map.
|
|
402
|
-
*
|
|
403
|
-
* @param {string} serial - The serial number of the device.
|
|
404
|
-
* @param {string} entityName - The name of the entity.
|
|
405
|
-
* @param {string} entityDescription - The description of the entity.
|
|
406
|
-
* @param {string} [entityIcon] - The icon of the entity: 'wifi', 'ble', 'hub', 'component', 'matter'
|
|
407
|
-
* @returns {void}
|
|
408
|
-
*
|
|
409
|
-
* @remarks
|
|
410
|
-
* In the schema use selectDeviceEntityFrom: 'name' or 'description'
|
|
411
|
-
* ```json
|
|
412
|
-
* "deviceEntityBlackList": {
|
|
413
|
-
* "description": "List of entities not to be exposed for a single device.",
|
|
414
|
-
* "type": "object",
|
|
415
|
-
* "uniqueItems": true,
|
|
416
|
-
* "selectFrom": "name",
|
|
417
|
-
* "additionalProperties": {
|
|
418
|
-
* "description": "List of entities not to be exposed for this device.",
|
|
419
|
-
* "type": "array",
|
|
420
|
-
* "items": {
|
|
421
|
-
* "type": "string"
|
|
422
|
-
* },
|
|
423
|
-
* "uniqueItems": true,
|
|
424
|
-
* "selectDeviceEntityFrom": "name"
|
|
425
|
-
* }
|
|
426
|
-
* },
|
|
427
|
-
* ```
|
|
428
|
-
*/
|
|
429
72
|
setSelectDeviceEntity(serial: string, entityName: string, entityDescription: string, entityIcon?: string): void;
|
|
430
|
-
/**
|
|
431
|
-
* Retrieves the select devices from the platform map.
|
|
432
|
-
*
|
|
433
|
-
* @returns {ApiSelectDevice[]} The selected devices array.
|
|
434
|
-
*/
|
|
435
73
|
getSelectDevices(): ApiSelectDevice[];
|
|
436
|
-
/**
|
|
437
|
-
* Set the select entity in the platform map.
|
|
438
|
-
*
|
|
439
|
-
* @param {string} name - The entity name.
|
|
440
|
-
* @param {string} description - The entity description.
|
|
441
|
-
* @param {string} [icon] - The entity icon: 'wifi', 'ble', 'hub', 'component', 'matter'
|
|
442
|
-
* @returns {void}
|
|
443
|
-
*
|
|
444
|
-
* @remarks
|
|
445
|
-
* In the schema use selectEntityFrom: 'name' or 'description'
|
|
446
|
-
* ```json
|
|
447
|
-
* "entityBlackList": {
|
|
448
|
-
* "description": "The entities in the list will not be exposed.",
|
|
449
|
-
* "type": "array",
|
|
450
|
-
* "items": {
|
|
451
|
-
* "type": "string"
|
|
452
|
-
* },
|
|
453
|
-
* "uniqueItems": true,
|
|
454
|
-
* "selectEntityFrom": "name"
|
|
455
|
-
* },
|
|
456
|
-
* ```
|
|
457
|
-
*/
|
|
458
74
|
setSelectEntity(name: string, description: string, icon?: string): void;
|
|
459
|
-
/**
|
|
460
|
-
* Retrieve a select entity by name.
|
|
461
|
-
*
|
|
462
|
-
* @param {string} name - The name of the entity.
|
|
463
|
-
* @returns {{ name: string; description: string; icon?: string } | undefined} The select entity or undefined if not found.
|
|
464
|
-
*/
|
|
465
75
|
getSelectEntity(name: string): {
|
|
466
76
|
name: string;
|
|
467
77
|
description: string;
|
|
468
78
|
icon?: string | undefined;
|
|
469
79
|
} | undefined;
|
|
470
|
-
/**
|
|
471
|
-
* Retrieve the select entities.
|
|
472
|
-
*
|
|
473
|
-
* @returns {ApiSelectEntity[]} The select entities array.
|
|
474
|
-
*/
|
|
475
80
|
getSelectEntities(): ApiSelectEntity[];
|
|
476
|
-
/**
|
|
477
|
-
* Verifies if the Matterbridge version meets the required version.
|
|
478
|
-
* If not, it destroys the platform cause the implementation may not call destroy().
|
|
479
|
-
*
|
|
480
|
-
* @param {string} requiredVersion - The required version to compare against.
|
|
481
|
-
* @param {boolean} [destroy] - Whether to destroy the platform if the version check fails. Default is true.
|
|
482
|
-
* @returns {boolean} True if the Matterbridge version meets or exceeds the required version, false otherwise.
|
|
483
|
-
*/
|
|
484
81
|
verifyMatterbridgeVersion(requiredVersion: string, destroy?: boolean): boolean;
|
|
485
|
-
/**
|
|
486
|
-
* Validates if a device is allowed based on the whitelist and blacklist configurations.
|
|
487
|
-
* The blacklist has priority over the whitelist.
|
|
488
|
-
*
|
|
489
|
-
* @param {string | string[]} device - The device name(s) to validate.
|
|
490
|
-
* @param {boolean} [log] - Whether to log the validation result.
|
|
491
|
-
* @returns {boolean} - Returns true if the device is allowed, false otherwise.
|
|
492
|
-
*/
|
|
493
82
|
validateDevice(device: string | string[], log?: boolean): boolean;
|
|
494
|
-
/**
|
|
495
|
-
* Validates if an entity is allowed based on the entity blacklist and device-entity blacklist configurations.
|
|
496
|
-
*
|
|
497
|
-
* @param {string} device - The device to which the entity belongs.
|
|
498
|
-
* @param {string} entity - The entity to validate.
|
|
499
|
-
* @param {boolean} [log] - Whether to log the validation result.
|
|
500
|
-
* @returns {boolean} - Returns true if the entity is allowed, false otherwise.
|
|
501
|
-
*/
|
|
502
83
|
validateEntity(device: string, entity: string, log?: boolean): boolean;
|
|
503
|
-
/**
|
|
504
|
-
* Clears all stored endpoint numbers for checkEndpointNumbers().
|
|
505
|
-
*
|
|
506
|
-
* @returns {Promise<void>} A promise that resolves when the endpoint numbers have been cleared.
|
|
507
|
-
*/
|
|
508
84
|
private clearEndpointNumbers;
|
|
509
|
-
/**
|
|
510
|
-
* Checks and updates the endpoint numbers for Matterbridge devices.
|
|
511
|
-
*
|
|
512
|
-
* This method retrieves the list of Matterbridge devices and their child endpoints,
|
|
513
|
-
* compares their current endpoint numbers with the stored ones, and updates the storage
|
|
514
|
-
* if there are any changes. It logs the changes and updates the endpoint numbers accordingly.
|
|
515
|
-
*
|
|
516
|
-
* @returns {Promise<number>} The size of the updated endpoint map, or -1 if storage is not available.
|
|
517
|
-
*/
|
|
518
85
|
private checkEndpointNumbers;
|
|
519
86
|
}
|
|
520
|
-
//# sourceMappingURL=matterbridgePlatform.d.ts.map
|