matterbridge 3.5.0 → 3.5.1-dev-20260122-6461be3
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/CHANGELOG.md +18 -0
- package/README-DOCKER.md +4 -2
- package/README.md +4 -1
- package/bin/mb_coap.js +1 -1
- package/bin/mb_mdns.js +1 -1
- package/dist/broadcastServer.d.ts +0 -115
- package/dist/broadcastServer.js +1 -119
- package/dist/broadcastServerTypes.d.ts +0 -43
- package/dist/broadcastServerTypes.js +0 -24
- package/dist/cli.d.ts +1 -26
- package/dist/cli.js +2 -102
- package/dist/cliEmitter.d.ts +0 -36
- package/dist/cliEmitter.js +0 -37
- package/dist/cliHistory.d.ts +0 -42
- package/dist/cliHistory.js +1 -39
- 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 +2 -114
- package/dist/devices/airConditioner.d.ts +0 -75
- package/dist/devices/airConditioner.js +0 -57
- package/dist/devices/batteryStorage.d.ts +0 -43
- package/dist/devices/batteryStorage.js +1 -48
- 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/frontend.d.ts +4 -187
- package/dist/frontend.js +89 -505
- package/dist/frontendTypes.d.ts +0 -57
- package/dist/frontendTypes.js +0 -45
- package/dist/helpers.d.ts +0 -43
- package/dist/helpers.js +1 -54
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -25
- package/dist/jestutils/export.d.ts +0 -1
- package/dist/jestutils/export.js +0 -1
- package/dist/jestutils/jestHelpers.d.ts +0 -255
- package/dist/jestutils/jestHelpers.js +16 -379
- package/dist/logger/export.d.ts +0 -1
- package/dist/logger/export.js +0 -1
- 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 +9 -364
- package/dist/matterbridge.d.ts +0 -362
- package/dist/matterbridge.js +75 -864
- package/dist/matterbridgeAccessoryPlatform.d.ts +0 -36
- package/dist/matterbridgeAccessoryPlatform.js +0 -38
- package/dist/matterbridgeBehaviors.d.ts +0 -24
- package/dist/matterbridgeBehaviors.js +5 -68
- package/dist/matterbridgeDeviceTypes.d.ts +0 -649
- package/dist/matterbridgeDeviceTypes.js +6 -673
- package/dist/matterbridgeDynamicPlatform.d.ts +0 -36
- package/dist/matterbridgeDynamicPlatform.js +0 -38
- package/dist/matterbridgeEndpoint.d.ts +2 -1332
- package/dist/matterbridgeEndpoint.js +94 -1459
- package/dist/matterbridgeEndpointHelpers.d.ts +0 -425
- package/dist/matterbridgeEndpointHelpers.js +22 -487
- package/dist/matterbridgeEndpointTypes.d.ts +0 -70
- package/dist/matterbridgeEndpointTypes.js +0 -25
- package/dist/matterbridgePlatform.d.ts +0 -425
- package/dist/matterbridgePlatform.js +2 -453
- package/dist/matterbridgeTypes.d.ts +0 -46
- package/dist/matterbridgeTypes.js +0 -26
- package/dist/mb_coap.d.ts +1 -0
- package/dist/{dgram/mb_coap.js → mb_coap.js} +3 -41
- package/dist/mb_mdns.d.ts +1 -0
- package/dist/{dgram/mb_mdns.js → mb_mdns.js} +47 -81
- package/dist/pluginManager.d.ts +0 -305
- package/dist/pluginManager.js +8 -345
- package/dist/shelly.d.ts +0 -157
- package/dist/shelly.js +7 -178
- package/dist/spawn.d.ts +1 -0
- package/dist/{utils/spawn.js → spawn.js} +3 -73
- package/dist/storage/export.d.ts +0 -1
- package/dist/storage/export.js +0 -1
- package/dist/update.d.ts +0 -75
- package/dist/update.js +7 -100
- package/dist/utils/export.d.ts +1 -13
- package/dist/utils/export.js +1 -13
- package/dist/workerGlobalPrefix.d.ts +0 -24
- package/dist/workerGlobalPrefix.js +6 -40
- package/dist/workerTypes.d.ts +0 -25
- package/dist/workerTypes.js +0 -24
- package/dist/workers.d.ts +0 -61
- package/dist/workers.js +4 -68
- package/npm-shrinkwrap.json +80 -50
- package/package.json +8 -8
- package/dist/broadcastServer.d.ts.map +0 -1
- package/dist/broadcastServer.js.map +0 -1
- package/dist/broadcastServerTypes.d.ts.map +0 -1
- package/dist/broadcastServerTypes.js.map +0 -1
- 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/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/batteryStorage.d.ts.map +0 -1
- package/dist/devices/batteryStorage.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/coap.d.ts +0 -205
- package/dist/dgram/coap.d.ts.map +0 -1
- package/dist/dgram/coap.js +0 -365
- package/dist/dgram/coap.js.map +0 -1
- package/dist/dgram/dgram.d.ts +0 -144
- package/dist/dgram/dgram.d.ts.map +0 -1
- package/dist/dgram/dgram.js +0 -363
- package/dist/dgram/dgram.js.map +0 -1
- package/dist/dgram/mb_coap.d.ts +0 -24
- package/dist/dgram/mb_coap.d.ts.map +0 -1
- package/dist/dgram/mb_coap.js.map +0 -1
- package/dist/dgram/mb_mdns.d.ts +0 -24
- package/dist/dgram/mb_mdns.d.ts.map +0 -1
- package/dist/dgram/mb_mdns.js.map +0 -1
- package/dist/dgram/mdns.d.ts +0 -371
- package/dist/dgram/mdns.d.ts.map +0 -1
- package/dist/dgram/mdns.js +0 -934
- package/dist/dgram/mdns.js.map +0 -1
- package/dist/dgram/multicast.d.ts +0 -67
- package/dist/dgram/multicast.d.ts.map +0 -1
- package/dist/dgram/multicast.js +0 -179
- package/dist/dgram/multicast.js.map +0 -1
- package/dist/dgram/unicast.d.ts +0 -64
- package/dist/dgram/unicast.d.ts.map +0 -1
- package/dist/dgram/unicast.js +0 -100
- package/dist/dgram/unicast.js.map +0 -1
- package/dist/frontend.d.ts.map +0 -1
- package/dist/frontend.js.map +0 -1
- package/dist/frontendTypes.d.ts.map +0 -1
- package/dist/frontendTypes.js.map +0 -1
- package/dist/helpers.d.ts.map +0 -1
- package/dist/helpers.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.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/logger/export.d.ts.map +0 -1
- package/dist/logger/export.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/matterbridgeTypes.d.ts.map +0 -1
- package/dist/matterbridgeTypes.js.map +0 -1
- package/dist/pluginManager.d.ts.map +0 -1
- package/dist/pluginManager.js.map +0 -1
- package/dist/shelly.d.ts.map +0 -1
- package/dist/shelly.js.map +0 -1
- package/dist/storage/export.d.ts.map +0 -1
- package/dist/storage/export.js.map +0 -1
- package/dist/update.d.ts.map +0 -1
- package/dist/update.js.map +0 -1
- package/dist/utils/colorUtils.d.ts +0 -101
- package/dist/utils/colorUtils.d.ts.map +0 -1
- package/dist/utils/colorUtils.js +0 -282
- package/dist/utils/colorUtils.js.map +0 -1
- package/dist/utils/commandLine.d.ts +0 -66
- package/dist/utils/commandLine.d.ts.map +0 -1
- package/dist/utils/commandLine.js +0 -123
- package/dist/utils/commandLine.js.map +0 -1
- package/dist/utils/copyDirectory.d.ts +0 -35
- package/dist/utils/copyDirectory.d.ts.map +0 -1
- package/dist/utils/copyDirectory.js +0 -76
- package/dist/utils/copyDirectory.js.map +0 -1
- package/dist/utils/createDirectory.d.ts +0 -34
- package/dist/utils/createDirectory.d.ts.map +0 -1
- package/dist/utils/createDirectory.js +0 -54
- package/dist/utils/createDirectory.js.map +0 -1
- package/dist/utils/createZip.d.ts +0 -39
- package/dist/utils/createZip.d.ts.map +0 -1
- package/dist/utils/createZip.js +0 -114
- package/dist/utils/createZip.js.map +0 -1
- package/dist/utils/deepCopy.d.ts +0 -32
- package/dist/utils/deepCopy.d.ts.map +0 -1
- package/dist/utils/deepCopy.js +0 -79
- package/dist/utils/deepCopy.js.map +0 -1
- package/dist/utils/deepEqual.d.ts +0 -54
- package/dist/utils/deepEqual.d.ts.map +0 -1
- package/dist/utils/deepEqual.js +0 -129
- package/dist/utils/deepEqual.js.map +0 -1
- package/dist/utils/error.d.ts +0 -45
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/error.js +0 -54
- package/dist/utils/error.js.map +0 -1
- package/dist/utils/export.d.ts.map +0 -1
- package/dist/utils/export.js.map +0 -1
- package/dist/utils/format.d.ts +0 -53
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/format.js +0 -78
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/hex.d.ts +0 -89
- package/dist/utils/hex.d.ts.map +0 -1
- package/dist/utils/hex.js +0 -242
- package/dist/utils/hex.js.map +0 -1
- package/dist/utils/inspector.d.ts +0 -87
- package/dist/utils/inspector.d.ts.map +0 -1
- package/dist/utils/inspector.js +0 -268
- package/dist/utils/inspector.js.map +0 -1
- package/dist/utils/isValid.d.ts +0 -103
- package/dist/utils/isValid.d.ts.map +0 -1
- package/dist/utils/isValid.js +0 -162
- package/dist/utils/isValid.js.map +0 -1
- package/dist/utils/network.d.ts +0 -141
- package/dist/utils/network.d.ts.map +0 -1
- package/dist/utils/network.js +0 -314
- package/dist/utils/network.js.map +0 -1
- package/dist/utils/spawn.d.ts +0 -33
- package/dist/utils/spawn.d.ts.map +0 -1
- package/dist/utils/spawn.js.map +0 -1
- package/dist/utils/tracker.d.ts +0 -108
- package/dist/utils/tracker.d.ts.map +0 -1
- package/dist/utils/tracker.js +0 -264
- package/dist/utils/tracker.js.map +0 -1
- package/dist/utils/wait.d.ts +0 -54
- package/dist/utils/wait.d.ts.map +0 -1
- package/dist/utils/wait.js +0 -125
- package/dist/utils/wait.js.map +0 -1
- package/dist/workerGlobalPrefix.d.ts.map +0 -1
- package/dist/workerGlobalPrefix.js.map +0 -1
- package/dist/workerTypes.d.ts.map +0 -1
- package/dist/workerTypes.js.map +0 -1
- package/dist/workers.d.ts.map +0 -1
- package/dist/workers.js.map +0 -1
package/dist/frontendTypes.d.ts
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the types for WebSocket messages.
|
|
3
|
-
*
|
|
4
|
-
* @file frontendTypes.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @created 2025-09-17
|
|
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 type { EndpointNumber } from '@matter/types';
|
|
25
2
|
import type { PlatformConfig } from './matterbridgePlatform.js';
|
|
26
3
|
import type { ApiClusters, ApiDevice, ApiMatter, ApiPlugin, MatterbridgeInformation, SystemInformation } from './matterbridgeTypes.js';
|
|
@@ -48,18 +25,12 @@ export interface ApiSelectEntity {
|
|
|
48
25
|
description: string;
|
|
49
26
|
icon?: string;
|
|
50
27
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Base interface for WebSocket messages.
|
|
53
|
-
*/
|
|
54
28
|
export interface WsMessage {
|
|
55
29
|
id: number;
|
|
56
30
|
src: string;
|
|
57
31
|
dst: string;
|
|
58
32
|
method: string;
|
|
59
33
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Base interface for WebSocket request api messages.
|
|
62
|
-
*/
|
|
63
34
|
export interface WsMessageBaseApiRequest {
|
|
64
35
|
id: number;
|
|
65
36
|
src: 'Frontend';
|
|
@@ -68,9 +39,6 @@ export interface WsMessageBaseApiRequest {
|
|
|
68
39
|
sender?: string;
|
|
69
40
|
params: Record<string, string | number | boolean | null | undefined | unknown>;
|
|
70
41
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Base interface for WebSocket success response api messages.
|
|
73
|
-
*/
|
|
74
42
|
export interface WsMessageSuccessApiResponse {
|
|
75
43
|
id: number;
|
|
76
44
|
src: 'Matterbridge';
|
|
@@ -79,9 +47,6 @@ export interface WsMessageSuccessApiResponse {
|
|
|
79
47
|
success: true;
|
|
80
48
|
response?: unknown;
|
|
81
49
|
}
|
|
82
|
-
/**
|
|
83
|
-
* Base interface for WebSocket error response api messages.
|
|
84
|
-
*/
|
|
85
50
|
export interface WsMessageErrorApiResponse {
|
|
86
51
|
id: number;
|
|
87
52
|
src: 'Matterbridge';
|
|
@@ -502,28 +467,6 @@ export interface WsMessageApiShellyMainUpdate extends WsMessageSuccessApiRespons
|
|
|
502
467
|
export type WsMessageApiRequest = WsMessagePingRequest | WsMessageApiLoginRequest | WsMessageApiInstallRequest | WsMessageApiUninstallRequest | WsMessageApiAddPluginRequest | WsMessageApiRemovePluginRequest | WsMessageApiEnablePluginRequest | WsMessageApiDisablePluginRequest | WsMessageApiRestartPluginRequest | WsMessageApiSavePluginConfigRequest | WsMessageApiCheckUpdatesRequest | WsMessageApiShellySysUpdateRequest | WsMessageApiShellyMainUpdateRequest | WsMessageApiShellyCreateSystemLogRequest | WsMessageApiShellyNetConfigRequest | WsMessageApiSoftResetRequest | WsMessageApiHardResetRequest | WsMessageApiRebootRequest | WsMessageApiRestartRequest | WsMessageApiShutdownRequest | WsMessageApiCreateBackupRequest | WsMessageApiUnregisterRequest | WsMessageApiResetRequest | WsMessageApiFactoryResetRequest | WsMessageApiViewHistoryPageRequest | WsMessageApiDownloadHistoryPageRequest | WsMessageApiMatterRequest | WsMessageApiSettingsRequest | WsMessageApiPluginsRequest | WsMessageApiDevicesRequest | WsMessageApiClustersRequest | WsMessageApiSelectDevicesRequest | WsMessageApiSelectEntitiesRequest | WsMessageApiActionRequest | WsMessageApiConfigRequest | WsMessageApiCommandRequest;
|
|
503
468
|
export type WsMessageApiResponse = WsMessagePingResponse | WsMessageApiLoginResponse | WsMessageApiInstallResponse | WsMessageApiUninstallResponse | WsMessageApiAddPluginResponse | WsMessageApiRemovePluginResponse | WsMessageApiEnablePluginResponse | WsMessageApiDisablePluginResponse | WsMessageApiRestartPluginResponse | WsMessageApiSavePluginConfigResponse | WsMessageApiCheckUpdatesResponse | WsMessageApiShellySysUpdateResponse | WsMessageApiShellyMainUpdateResponse | WsMessageApiShellyCreateSystemLogResponse | WsMessageApiShellyNetConfigResponse | WsMessageApiSoftResetResponse | WsMessageApiHardResetResponse | WsMessageApiRebootResponse | WsMessageApiRestartResponse | WsMessageApiShutdownResponse | WsMessageApiCreateBackupResponse | WsMessageApiUnregisterResponse | WsMessageApiResetResponse | WsMessageApiFactoryResetResponse | WsMessageApiViewHistoryPageResponse | WsMessageApiDownloadHistoryPageResponse | WsMessageApiMatterResponse | WsMessageApiSettingsResponse | WsMessageApiPluginsResponse | WsMessageApiDevicesResponse | WsMessageApiClustersResponse | WsMessageApiSelectDevicesResponse | WsMessageApiSelectEntitiesResponse | WsMessageApiActionResponse | WsMessageApiConfigResponse | WsMessageApiCommandResponse | WsMessageApiLog | WsMessageApiRefreshRequired | WsMessageApiRestartRequired | WsMessageApiRestartNotRequired | WsMessageApiUpdateRequired | WsMessageApiCpuUpdate | WsMessageApiMemoryUpdate | WsMessageApiUptimeUpdate | WsMessageApiStateUpdate | WsMessageApiSnackbar | WsMessageApiCloseSnackbar | WsMessageApiShellySysUpdate | WsMessageApiShellyMainUpdate;
|
|
504
469
|
export type WsMessageBroadcast = WsMessageApiLog | WsMessageApiRefreshRequired | WsMessageApiRestartRequired | WsMessageApiRestartNotRequired | WsMessageApiUpdateRequired | WsMessageApiCpuUpdate | WsMessageApiMemoryUpdate | WsMessageApiUptimeUpdate | WsMessageApiStateUpdate | WsMessageApiSnackbar | WsMessageApiCloseSnackbar | WsMessageApiShellySysUpdate | WsMessageApiShellyMainUpdate;
|
|
505
|
-
/**
|
|
506
|
-
* Type guard to check if a message is a WsMessageApiRequest.
|
|
507
|
-
*
|
|
508
|
-
* @param {WsMessage} msg - The message to check.
|
|
509
|
-
*
|
|
510
|
-
* @returns {msg is WsMessageApiRequest} True if the message is a WsMessageApiRequest, false otherwise.
|
|
511
|
-
*/
|
|
512
470
|
export declare function isApiRequest(msg: WsMessage): msg is WsMessageApiRequest;
|
|
513
|
-
/**
|
|
514
|
-
* Type guard to check if a message is a WsMessageApiResponse.
|
|
515
|
-
*
|
|
516
|
-
* @param {WsMessage} msg - The message to check.
|
|
517
|
-
*
|
|
518
|
-
* @returns {msg is WsMessageApiResponse} True if the message is a WsMessageApiResponse, false otherwise.
|
|
519
|
-
*/
|
|
520
471
|
export declare function isApiResponse(msg: WsMessage): msg is WsMessageApiResponse;
|
|
521
|
-
/**
|
|
522
|
-
* Type guard to check if a message is a WsMessageBroadcast.
|
|
523
|
-
*
|
|
524
|
-
* @param {WsMessage} msg - The message to check.
|
|
525
|
-
*
|
|
526
|
-
* @returns {msg is WsMessageBroadcast} True if the message is a WsMessageBroadcast, false otherwise.
|
|
527
|
-
*/
|
|
528
472
|
export declare function isBroadcast(msg: WsMessage): msg is WsMessageBroadcast;
|
|
529
|
-
//# sourceMappingURL=frontendTypes.d.ts.map
|
package/dist/frontendTypes.js
CHANGED
|
@@ -1,54 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the types for WebSocket messages.
|
|
3
|
-
*
|
|
4
|
-
* @file frontendTypes.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @created 2025-09-17
|
|
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
|
-
/**
|
|
25
|
-
* Type guard to check if a message is a WsMessageApiRequest.
|
|
26
|
-
*
|
|
27
|
-
* @param {WsMessage} msg - The message to check.
|
|
28
|
-
*
|
|
29
|
-
* @returns {msg is WsMessageApiRequest} True if the message is a WsMessageApiRequest, false otherwise.
|
|
30
|
-
*/
|
|
31
1
|
export function isApiRequest(msg) {
|
|
32
2
|
return msg.id !== 0 && msg.src === 'Frontend' && msg.dst === 'Matterbridge';
|
|
33
3
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Type guard to check if a message is a WsMessageApiResponse.
|
|
36
|
-
*
|
|
37
|
-
* @param {WsMessage} msg - The message to check.
|
|
38
|
-
*
|
|
39
|
-
* @returns {msg is WsMessageApiResponse} True if the message is a WsMessageApiResponse, false otherwise.
|
|
40
|
-
*/
|
|
41
4
|
export function isApiResponse(msg) {
|
|
42
5
|
return msg.id !== 0 && msg.src === 'Matterbridge' && msg.dst === 'Frontend';
|
|
43
6
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Type guard to check if a message is a WsMessageBroadcast.
|
|
46
|
-
*
|
|
47
|
-
* @param {WsMessage} msg - The message to check.
|
|
48
|
-
*
|
|
49
|
-
* @returns {msg is WsMessageBroadcast} True if the message is a WsMessageBroadcast, false otherwise.
|
|
50
|
-
*/
|
|
51
7
|
export function isBroadcast(msg) {
|
|
52
8
|
return msg.id === 0 && msg.src === 'Matterbridge' && msg.dst === 'Frontend';
|
|
53
9
|
}
|
|
54
|
-
//# sourceMappingURL=frontendTypes.js.map
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,48 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the helpers functions of Matterbridge.
|
|
3
|
-
*
|
|
4
|
-
* @file helpers.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @created 2025-05-12
|
|
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 { Endpoint } from '@matter/node';
|
|
25
2
|
import { AggregatorEndpoint } from '@matter/node/endpoints/aggregator';
|
|
26
3
|
import { Matterbridge } from './matterbridge.js';
|
|
27
|
-
/**
|
|
28
|
-
* Adds a virtual device to the provided endpoint, sets up an event listener for device state changes,
|
|
29
|
-
* and ensures the device is initialized in the off state.
|
|
30
|
-
*
|
|
31
|
-
* @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggragator endpoint to which the virtual device will be added.
|
|
32
|
-
* @param {string} name - The name of the virtual device. Spaces in the name are removed to form the device ID.
|
|
33
|
-
* @param {'light' | 'outlet' | 'switch' | 'mounted_switch'} type - The type of the virtual device. Can be 'light', 'outlet', 'switch', or 'mounted_switch'.
|
|
34
|
-
* @param {() => Promise<void>} callback - A callback function that gets executed when the device's on/off state changes to true.
|
|
35
|
-
* @returns {Promise<Endpoint>} A promise that resolves with the created virtual device.
|
|
36
|
-
* @remarks The virtual device is created as an instance of `Endpoint` with the `OnOffPlugInUnitDevice` device type.
|
|
37
|
-
* The onOff state always reverts to false when the device is turned on.
|
|
38
|
-
*/
|
|
39
4
|
export declare function addVirtualDevice(aggregatorEndpoint: Endpoint<AggregatorEndpoint>, name: string, type: 'light' | 'outlet' | 'switch' | 'mounted_switch', callback: () => Promise<void>): Promise<Endpoint>;
|
|
40
|
-
/**
|
|
41
|
-
* Creates and add the virtual devices to the aggregator.
|
|
42
|
-
*
|
|
43
|
-
* @param {Matterbridge} matterbridge - The Matterbridge instance.
|
|
44
|
-
* @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggregator node to add the virtual devices to.
|
|
45
|
-
* @returns {Promise<void>} A promise that resolves when the virtual devices are added.
|
|
46
|
-
*/
|
|
47
5
|
export declare function addVirtualDevices(matterbridge: Matterbridge, aggregatorEndpoint: Endpoint<AggregatorEndpoint>): Promise<void>;
|
|
48
|
-
//# sourceMappingURL=helpers.d.ts.map
|
package/dist/helpers.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the helpers functions of Matterbridge.
|
|
3
|
-
*
|
|
4
|
-
* @file helpers.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @created 2025-05-12
|
|
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
|
-
// @matter module
|
|
25
1
|
import { OnOff } from '@matter/types/clusters/on-off';
|
|
26
2
|
import { Endpoint } from '@matter/node';
|
|
27
3
|
import { BridgedDeviceBasicInformationServer } from '@matter/node/behaviors/bridged-device-basic-information';
|
|
@@ -30,24 +6,8 @@ import { OnOffPlugInUnitDevice } from '@matter/node/devices/on-off-plug-in-unit'
|
|
|
30
6
|
import { MountedOnOffControlDevice } from '@matter/node/devices/mounted-on-off-control';
|
|
31
7
|
import { OnOffLightDevice } from '@matter/node/devices/on-off-light';
|
|
32
8
|
import { OnOffLightSwitchDevice } from '@matter/node/devices/on-off-light-switch';
|
|
33
|
-
|
|
34
|
-
import { hasParameter } from './utils/commandLine.js';
|
|
35
|
-
/**
|
|
36
|
-
* Adds a virtual device to the provided endpoint, sets up an event listener for device state changes,
|
|
37
|
-
* and ensures the device is initialized in the off state.
|
|
38
|
-
*
|
|
39
|
-
* @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggragator endpoint to which the virtual device will be added.
|
|
40
|
-
* @param {string} name - The name of the virtual device. Spaces in the name are removed to form the device ID.
|
|
41
|
-
* @param {'light' | 'outlet' | 'switch' | 'mounted_switch'} type - The type of the virtual device. Can be 'light', 'outlet', 'switch', or 'mounted_switch'.
|
|
42
|
-
* @param {() => Promise<void>} callback - A callback function that gets executed when the device's on/off state changes to true.
|
|
43
|
-
* @returns {Promise<Endpoint>} A promise that resolves with the created virtual device.
|
|
44
|
-
* @remarks The virtual device is created as an instance of `Endpoint` with the `OnOffPlugInUnitDevice` device type.
|
|
45
|
-
* The onOff state always reverts to false when the device is turned on.
|
|
46
|
-
*/
|
|
9
|
+
import { hasParameter } from '@matterbridge/utils';
|
|
47
10
|
export async function addVirtualDevice(aggregatorEndpoint, name, type, callback) {
|
|
48
|
-
// Create a new virtual device by instantiating `Endpoint` with device information.
|
|
49
|
-
// The device ID is created by replacing all spaces in the name with an empty string.
|
|
50
|
-
// The node label of the bridged device basic information is set to the given name.
|
|
51
11
|
let deviceType;
|
|
52
12
|
switch (type) {
|
|
53
13
|
case 'light':
|
|
@@ -68,9 +28,7 @@ export async function addVirtualDevice(aggregatorEndpoint, name, type, callback)
|
|
|
68
28
|
bridgedDeviceBasicInformation: { nodeLabel: name.slice(0, 32) },
|
|
69
29
|
onOff: { onOff: false, startUpOnOff: OnOff.StartUpOnOff.Off },
|
|
70
30
|
});
|
|
71
|
-
// Set up an event listener for when the `onOff` state changes.
|
|
72
31
|
device.events.onOff.onOff$Changed.on((value) => {
|
|
73
|
-
// If the `onOff` state becomes true, turn off the virtual device and execute the callback.
|
|
74
32
|
if (value) {
|
|
75
33
|
callback();
|
|
76
34
|
process.nextTick(async () => {
|
|
@@ -78,24 +36,14 @@ export async function addVirtualDevice(aggregatorEndpoint, name, type, callback)
|
|
|
78
36
|
await device.setStateOf(OnOffBaseServer, { onOff: false });
|
|
79
37
|
}
|
|
80
38
|
catch (_error) {
|
|
81
|
-
// Not necessary to handle the error
|
|
82
39
|
}
|
|
83
40
|
});
|
|
84
41
|
}
|
|
85
42
|
});
|
|
86
|
-
// Add the created device to the given endpoint.
|
|
87
43
|
await aggregatorEndpoint.add(device);
|
|
88
|
-
// Initially set the state of the virtual device's `OnOffBaseServer` to false (off).
|
|
89
44
|
await device.setStateOf(OnOffBaseServer, { onOff: false });
|
|
90
45
|
return device;
|
|
91
46
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Creates and add the virtual devices to the aggregator.
|
|
94
|
-
*
|
|
95
|
-
* @param {Matterbridge} matterbridge - The Matterbridge instance.
|
|
96
|
-
* @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggregator node to add the virtual devices to.
|
|
97
|
-
* @returns {Promise<void>} A promise that resolves when the virtual devices are added.
|
|
98
|
-
*/
|
|
99
47
|
export async function addVirtualDevices(matterbridge, aggregatorEndpoint) {
|
|
100
48
|
if (matterbridge.virtualMode !== 'disabled' && matterbridge.bridgeMode === 'bridge' && aggregatorEndpoint) {
|
|
101
49
|
matterbridge.log.notice(`Creating virtual devices for Matterbridge server node...`);
|
|
@@ -144,4 +92,3 @@ export async function addVirtualDevices(matterbridge, aggregatorEndpoint) {
|
|
|
144
92
|
}
|
|
145
93
|
}
|
|
146
94
|
}
|
|
147
|
-
//# sourceMappingURL=helpers.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description This file contains the entry point of Matterbridge.
|
|
3
|
-
* @file index.ts
|
|
4
|
-
* @author Luca Liguori
|
|
5
|
-
* @created 2023-12-29
|
|
6
|
-
* @version 1.0.9
|
|
7
|
-
* @license Apache-2.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License.
|
|
22
|
-
*/
|
|
23
1
|
export * from './matterbridge.js';
|
|
24
2
|
export * from './matterbridgeTypes.js';
|
|
25
3
|
export * from './matterbridgeEndpoint.js';
|
|
@@ -31,4 +9,3 @@ export * from './matterbridgePlatform.js';
|
|
|
31
9
|
export * from './matterbridgeAccessoryPlatform.js';
|
|
32
10
|
export * from './matterbridgeDynamicPlatform.js';
|
|
33
11
|
export { addVirtualDevice } from './helpers.js';
|
|
34
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description This file contains the entry point of Matterbridge.
|
|
3
|
-
* @file index.ts
|
|
4
|
-
* @author Luca Liguori
|
|
5
|
-
* @created 2023-12-29
|
|
6
|
-
* @version 1.0.9
|
|
7
|
-
* @license Apache-2.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
// eslint-disable-next-line no-console
|
|
24
1
|
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
25
2
|
console.log('\u001B[32mIndex loaded.\u001B[40;0m');
|
|
26
|
-
// Matterbridge
|
|
27
3
|
export * from './matterbridge.js';
|
|
28
4
|
export * from './matterbridgeTypes.js';
|
|
29
5
|
export * from './matterbridgeEndpoint.js';
|
|
@@ -35,4 +11,3 @@ export * from './matterbridgePlatform.js';
|
|
|
35
11
|
export * from './matterbridgeAccessoryPlatform.js';
|
|
36
12
|
export * from './matterbridgeDynamicPlatform.js';
|
|
37
13
|
export { addVirtualDevice } from './helpers.js';
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
package/dist/jestutils/export.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description This file contains the Jest helpers.
|
|
3
|
-
* @file src/helpers.test.ts
|
|
4
|
-
* @author Luca Liguori
|
|
5
|
-
* @created 2025-09-03
|
|
6
|
-
* @version 1.0.14
|
|
7
|
-
* @license Apache-2.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License.
|
|
22
|
-
*/
|
|
23
1
|
import type { jest } from '@jest/globals';
|
|
24
2
|
import { AnsiLogger } from 'node-ansi-logger';
|
|
25
3
|
import { Environment } from '@matter/general';
|
|
@@ -88,258 +66,25 @@ export declare let environment: Environment;
|
|
|
88
66
|
export declare let server: ServerNode<ServerNode.RootEndpoint>;
|
|
89
67
|
export declare let aggregator: Endpoint<AggregatorEndpoint>;
|
|
90
68
|
export declare let log: AnsiLogger;
|
|
91
|
-
/**
|
|
92
|
-
* Setup the Jest environment:
|
|
93
|
-
* - it will remove any existing home directory
|
|
94
|
-
* - setup the spies for logging
|
|
95
|
-
*
|
|
96
|
-
* @param {string} name The name of the test suite.
|
|
97
|
-
* @param {boolean} debug If true, the logging is not mocked.
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```typescript
|
|
101
|
-
* import { consoleDebugSpy, consoleErrorSpy, consoleInfoSpy, consoleLogSpy, consoleWarnSpy, loggerLogSpy, setDebug, setupTest } from './jestutils/jestHelpers.js';
|
|
102
|
-
*
|
|
103
|
-
* // Setup the test environment
|
|
104
|
-
* await setupTest(NAME, false);
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
69
|
export declare function setupTest(name: string, debug?: boolean): Promise<void>;
|
|
108
|
-
/**
|
|
109
|
-
* Set or unset the debug mode.
|
|
110
|
-
*
|
|
111
|
-
* @param {boolean} debug If true, the logging is not mocked.
|
|
112
|
-
* @returns {Promise<void>} A promise that resolves when the debug mode is set.
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```typescript
|
|
116
|
-
* // Set the debug mode in test environment
|
|
117
|
-
* await setDebug(true);
|
|
118
|
-
* ```
|
|
119
|
-
*
|
|
120
|
-
* ```typescript
|
|
121
|
-
* // Reset the debug mode in test environment
|
|
122
|
-
* await setDebug(false);
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
70
|
export declare function setDebug(debug: boolean): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* Create and start a fully initialized Matterbridge instance for testing.
|
|
128
|
-
*
|
|
129
|
-
* @param {('bridge' | 'childbridge' | 'controller' | '')} bridgeMode The bridge mode to start the Matterbridge instance in.
|
|
130
|
-
* @param {number} frontendPort The frontend port number.
|
|
131
|
-
* @param {number} matterPort The matter port number.
|
|
132
|
-
* @param {number} passcode The passcode number.
|
|
133
|
-
* @param {number} discriminator The discriminator number.
|
|
134
|
-
* @param {number} pluginSize The expected number of plugins.
|
|
135
|
-
* @param {number} devicesSize The expected number of devices.
|
|
136
|
-
* @returns {Promise<Matterbridge>} The Matterbridge instance.
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* ```typescript
|
|
140
|
-
* // Create and start a fully initialized Matterbridge instance for testing.
|
|
141
|
-
* await startMatterbridge();
|
|
142
|
-
* ```
|
|
143
|
-
*/
|
|
144
71
|
export declare function startMatterbridge(bridgeMode?: 'bridge' | 'childbridge' | 'controller' | '', frontendPort?: number, matterPort?: number, passcode?: number, discriminator?: number, pluginSize?: number, devicesSize?: number): Promise<Matterbridge>;
|
|
145
|
-
/**
|
|
146
|
-
* Stop the fully initialized Matterbridge instance.
|
|
147
|
-
*
|
|
148
|
-
* @param {cleanupPause} cleanupPause The pause duration before cleanup. Default is 10 ms.
|
|
149
|
-
* @param {destroyPause} destroyPause The pause duration before destruction. Default is 250 ms.
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* // Stop the fully initialized Matterbridge instance.
|
|
154
|
-
* await stopMatterbridge();
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
72
|
export declare function stopMatterbridge(cleanupPause?: number, destroyPause?: number): Promise<void>;
|
|
158
|
-
/**
|
|
159
|
-
* Create a Matterbridge instance for testing without initializing it.
|
|
160
|
-
*
|
|
161
|
-
* @param {string} name - Name for the environment (jest/name).
|
|
162
|
-
* @returns {Promise<Matterbridge>} The Matterbridge instance.
|
|
163
|
-
*
|
|
164
|
-
* @example
|
|
165
|
-
* ```typescript
|
|
166
|
-
* // Create Matterbridge environment
|
|
167
|
-
* await createMatterbridgeEnvironment(NAME);
|
|
168
|
-
* await startMatterbridgeEnvironment(MATTER_PORT);
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
73
|
export declare function createMatterbridgeEnvironment(name: string): Promise<Matterbridge>;
|
|
172
|
-
/**
|
|
173
|
-
* Start the matterbridge environment.
|
|
174
|
-
* Only node storage, matter storage and the server and aggregator nodes are started.
|
|
175
|
-
*
|
|
176
|
-
* @param {number} port The matter server port.
|
|
177
|
-
* @returns {Promise<[ServerNode<ServerNode.RootEndpoint>, Endpoint<AggregatorEndpoint>]>} The started server and aggregator.
|
|
178
|
-
*
|
|
179
|
-
* @example
|
|
180
|
-
* ```typescript
|
|
181
|
-
* // Create Matterbridge environment
|
|
182
|
-
* await createMatterbridgeEnvironment(NAME);
|
|
183
|
-
* await startMatterbridgeEnvironment(MATTER_PORT);
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
74
|
export declare function startMatterbridgeEnvironment(port?: number): Promise<[ServerNode<ServerNode.RootEndpoint>, Endpoint<AggregatorEndpoint>]>;
|
|
187
|
-
/**
|
|
188
|
-
* Add a matterbridge platform for testing.
|
|
189
|
-
*
|
|
190
|
-
* @param {MatterbridgePlatform} platform The platform to add.
|
|
191
|
-
* @param {string} [name] Optional name of the platform.
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```typescript
|
|
195
|
-
* platform = new Platform(matterbridge, log, config);
|
|
196
|
-
* // Add the platform to the Matterbridge environment
|
|
197
|
-
* addMatterbridgePlatform(platform);
|
|
198
|
-
* ```
|
|
199
|
-
*/
|
|
200
75
|
export declare function addMatterbridgePlatform(platform: MatterbridgePlatform, name?: string): void;
|
|
201
|
-
/**
|
|
202
|
-
* Stop the matterbridge environment
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* ```typescript
|
|
206
|
-
* // Destroy Matterbridge environment
|
|
207
|
-
* await stopMatterbridgeEnvironment();
|
|
208
|
-
* await destroyMatterbridgeEnvironment();
|
|
209
|
-
* ```
|
|
210
|
-
*/
|
|
211
76
|
export declare function stopMatterbridgeEnvironment(): Promise<void>;
|
|
212
|
-
/**
|
|
213
|
-
* Destroy the matterbridge environment
|
|
214
|
-
*
|
|
215
|
-
* @param {number} cleanupPause The timeout for the destroy operation (default 10ms).
|
|
216
|
-
* @param {number} destroyPause The pause duration after cleanup before destroying the instance (default 250ms).
|
|
217
|
-
*
|
|
218
|
-
* @example
|
|
219
|
-
* ```typescript
|
|
220
|
-
* // Destroy Matterbridge environment
|
|
221
|
-
* await stopMatterbridgeEnvironment();
|
|
222
|
-
* await destroyMatterbridgeEnvironment();
|
|
223
|
-
* ```
|
|
224
|
-
*/
|
|
225
77
|
export declare function destroyMatterbridgeEnvironment(cleanupPause?: number, destroyPause?: number): Promise<void>;
|
|
226
|
-
/**
|
|
227
|
-
* Destroy a matterbridge instance
|
|
228
|
-
*
|
|
229
|
-
* @param {Matterbridge} matterbridge The matterbridge instance to destroy.
|
|
230
|
-
* @param {number} cleanupPause The pause duration to wait for the cleanup to complete in milliseconds (default 10ms).
|
|
231
|
-
* @param {number} destroyPause The pause duration to wait after cleanup before destroying the instance in milliseconds (default 250ms).
|
|
232
|
-
*/
|
|
233
78
|
export declare function destroyInstance(matterbridge: Matterbridge, cleanupPause?: number, destroyPause?: number): Promise<void>;
|
|
234
|
-
/**
|
|
235
|
-
* Close the mDNS instance in the matterbridge environment.
|
|
236
|
-
*
|
|
237
|
-
* @param {Matterbridge} matterbridge The matterbridge instance.
|
|
238
|
-
* @returns {Promise<void>} A promise that resolves when the mDNS instance is closed.
|
|
239
|
-
*/
|
|
240
79
|
export declare function closeMdnsInstance(matterbridge: Matterbridge): Promise<void>;
|
|
241
|
-
/**
|
|
242
|
-
* Create a matter test environment for testing:
|
|
243
|
-
* - it will remove any existing home directory
|
|
244
|
-
* - setup the matter environment with name, debug logging and ANSI format
|
|
245
|
-
* - setup the mDNS service in the environment
|
|
246
|
-
*
|
|
247
|
-
* @param {string} name - Name for the environment (jest/name).
|
|
248
|
-
* @returns {Environment} - The default matter environment.
|
|
249
|
-
*/
|
|
250
80
|
export declare function createTestEnvironment(name: string): Environment;
|
|
251
|
-
/**
|
|
252
|
-
* Destroy the matter test environment by closing the mDNS service.
|
|
253
|
-
*
|
|
254
|
-
* @returns {Promise<void>} A promise that resolves when the test environment is destroyed.
|
|
255
|
-
*/
|
|
256
81
|
export declare function destroyTestEnvironment(): Promise<void>;
|
|
257
|
-
/**
|
|
258
|
-
* Advance the Node.js event loop deterministically to allow chained asynchronous work (Promises scheduled in
|
|
259
|
-
* microtasks and follow‑up macrotasks) to complete inside tests without adding arbitrary long timeouts.
|
|
260
|
-
*
|
|
261
|
-
* NOTE: This does not guarantee OS level network IO completion—only JavaScript task queue progression inside the
|
|
262
|
-
* current process.
|
|
263
|
-
*
|
|
264
|
-
* @param {number} ticks Number of macrotask (setImmediate) turns to yield (default 3).
|
|
265
|
-
* @param {number} microTurns Number of microtask drains (Promise.resolve chains) after macrotask yielding (default 10).
|
|
266
|
-
* @param {number} pause Final timer delay in ms; set 0 to disable (default 250ms).
|
|
267
|
-
* @returns {Promise<void>} Resolves after the requested event loop advancement has completed.
|
|
268
|
-
*/
|
|
269
82
|
export declare function flushAsync(ticks?: number, microTurns?: number, pause?: number): Promise<void>;
|
|
270
|
-
/**
|
|
271
|
-
* Summarize live libuv handles/requests inside a process.
|
|
272
|
-
*
|
|
273
|
-
* @param {AnsiLogger} log - Logger to use for output
|
|
274
|
-
*
|
|
275
|
-
* @returns {number} - The total number of active handles and requests
|
|
276
|
-
*/
|
|
277
83
|
export declare function logKeepAlives(log?: AnsiLogger): number;
|
|
278
|
-
/**
|
|
279
|
-
* Flush (await) the lazy endpoint number persistence mechanism used by matter.js.
|
|
280
|
-
*
|
|
281
|
-
* Background:
|
|
282
|
-
* assignNumber() batches persistence (store.saveNumber + updating __nextNumber__) via an internal promise (#numbersPersisted).
|
|
283
|
-
* Calling endpointStores.close() waits for the current batch only. If new endpoints were added in the same macrotask
|
|
284
|
-
* cycle additional micro/macro turns might be needed to ensure the batch started. We defensively yield macrotasks
|
|
285
|
-
* (setImmediate) and then await close() multiple rounds.
|
|
286
|
-
*
|
|
287
|
-
* @param {ServerNode} targetServer The server whose endpoint numbering persistence should be flushed.
|
|
288
|
-
* @param {number} rounds Number of macrotask + close cycles to run (2 is usually sufficient; 1 often works).
|
|
289
|
-
* @returns {Promise<void>} Resolves when pending number persistence batches have completed.
|
|
290
|
-
*/
|
|
291
84
|
export declare function flushAllEndpointNumberPersistence(targetServer: ServerNode, rounds?: number): Promise<void>;
|
|
292
|
-
/**
|
|
293
|
-
* Assert that every endpoint attached to the server has an assigned and (batch-)persisted endpoint number.
|
|
294
|
-
*
|
|
295
|
-
* This waits for any outstanding number persistence batch (endpointStores.close()), then traverses the endpoint
|
|
296
|
-
* graph and asserts:
|
|
297
|
-
* - Root endpoint: number is 0 (allowing undefined to coerce to 0 via nullish coalescing check).
|
|
298
|
-
* - All other endpoints: number > 0.
|
|
299
|
-
*
|
|
300
|
-
* @param {ServerNode} targetServer The server whose endpoint numbers are verified.
|
|
301
|
-
* @returns {Promise<void>} Resolves when assertions complete.
|
|
302
|
-
*/
|
|
303
85
|
export declare function assertAllEndpointNumbersPersisted(targetServer: ServerNode): Promise<number>;
|
|
304
|
-
/**
|
|
305
|
-
* Close the server node stores to flush any pending endpoint number persistence.
|
|
306
|
-
*
|
|
307
|
-
* @param {ServerNode} targetServer The server whose endpoint stores should be closed.
|
|
308
|
-
* @returns {Promise<void>} Resolves when the stores have been closed.
|
|
309
|
-
*/
|
|
310
86
|
export declare function closeServerNodeStores(targetServer?: ServerNode): Promise<void>;
|
|
311
|
-
/**
|
|
312
|
-
* Start a matter server node for testing.
|
|
313
|
-
*
|
|
314
|
-
* @param {string} name Name of the server (used for logging and product description).
|
|
315
|
-
* @param {number} port TCP port to listen on.
|
|
316
|
-
* @param {DeviceTypeId} deviceType Device type identifier for the server node.
|
|
317
|
-
* @returns {Promise<[ServerNode<ServerNode.RootEndpoint>, Endpoint<AggregatorEndpoint>]>} Resolves to an array containing the created ServerNode and its AggregatorNode.
|
|
318
|
-
*/
|
|
319
87
|
export declare function startServerNode(name: string, port: number, deviceType?: DeviceTypeId): Promise<[ServerNode<ServerNode.RootEndpoint>, Endpoint<AggregatorEndpoint>]>;
|
|
320
|
-
/**
|
|
321
|
-
* Stop a matter server node.
|
|
322
|
-
*
|
|
323
|
-
* @param {ServerNode<ServerNode.RootEndpoint>} server The server to stop.
|
|
324
|
-
* @returns {Promise<void>} Resolves when the server has stopped.
|
|
325
|
-
*/
|
|
326
88
|
export declare function stopServerNode(server: ServerNode<ServerNode.RootEndpoint>): Promise<void>;
|
|
327
|
-
/**
|
|
328
|
-
* Add a device (endpoint) to a matter server node or an aggregator.
|
|
329
|
-
*
|
|
330
|
-
* @param {ServerNode<ServerNode.RootEndpoint> | Endpoint<AggregatorEndpoint>} owner The server or aggregator to add the device to.
|
|
331
|
-
* @param {Endpoint} device The device to add.
|
|
332
|
-
* @param {number} pause The pause time in milliseconds after addition (default 10ms).
|
|
333
|
-
* @returns {Promise<void>} Resolves when the device has been added and is ready.
|
|
334
|
-
*/
|
|
335
89
|
export declare function addDevice(owner: ServerNode<ServerNode.RootEndpoint> | Endpoint<AggregatorEndpoint>, device: Endpoint, pause?: number): Promise<boolean>;
|
|
336
|
-
/**
|
|
337
|
-
* Delete a device (endpoint) from a matter server node or an aggregator.
|
|
338
|
-
*
|
|
339
|
-
* @param {ServerNode<ServerNode.RootEndpoint> | Endpoint<AggregatorEndpoint>} owner The server or aggregator to remove the device from.
|
|
340
|
-
* @param {Endpoint} device The device to remove.
|
|
341
|
-
* @param {number} pause The pause time in milliseconds after deletion (default 10ms).
|
|
342
|
-
* @returns {Promise<void>} Resolves when the device has been removed and is no longer ready.
|
|
343
|
-
*/
|
|
344
90
|
export declare function deleteDevice(owner: ServerNode<ServerNode.RootEndpoint> | Endpoint<AggregatorEndpoint>, device: Endpoint, pause?: number): Promise<boolean>;
|
|
345
|
-
//# sourceMappingURL=jestHelpers.d.ts.map
|