matterbridge 3.4.3-dev-20251209-e6cb85f → 3.4.3
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 +2 -3
- package/dist/broadcastServer.d.ts +144 -0
- package/dist/broadcastServer.d.ts.map +1 -0
- package/dist/broadcastServer.js +119 -0
- package/dist/broadcastServer.js.map +1 -0
- package/dist/broadcastServerTypes.d.ts +841 -0
- package/dist/broadcastServerTypes.d.ts.map +1 -0
- package/dist/broadcastServerTypes.js +24 -0
- package/dist/broadcastServerTypes.js.map +1 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +97 -1
- package/dist/cli.js.map +1 -0
- package/dist/cliEmitter.d.ts +50 -0
- package/dist/cliEmitter.d.ts.map +1 -0
- package/dist/cliEmitter.js +37 -0
- package/dist/cliEmitter.js.map +1 -0
- package/dist/cliHistory.d.ts +48 -0
- package/dist/cliHistory.d.ts.map +1 -0
- package/dist/cliHistory.js +38 -0
- package/dist/cliHistory.js.map +1 -0
- package/dist/clusters/export.d.ts +2 -0
- package/dist/clusters/export.d.ts.map +1 -0
- package/dist/clusters/export.js +2 -0
- package/dist/clusters/export.js.map +1 -0
- package/dist/deviceManager.d.ts +135 -0
- package/dist/deviceManager.d.ts.map +1 -0
- package/dist/deviceManager.js +113 -1
- package/dist/deviceManager.js.map +1 -0
- package/dist/devices/airConditioner.d.ts +98 -0
- package/dist/devices/airConditioner.d.ts.map +1 -0
- package/dist/devices/airConditioner.js +57 -0
- package/dist/devices/airConditioner.js.map +1 -0
- package/dist/devices/batteryStorage.d.ts +48 -0
- package/dist/devices/batteryStorage.d.ts.map +1 -0
- package/dist/devices/batteryStorage.js +48 -1
- package/dist/devices/batteryStorage.js.map +1 -0
- package/dist/devices/cooktop.d.ts +61 -0
- package/dist/devices/cooktop.d.ts.map +1 -0
- package/dist/devices/cooktop.js +56 -0
- package/dist/devices/cooktop.js.map +1 -0
- package/dist/devices/dishwasher.d.ts +71 -0
- package/dist/devices/dishwasher.d.ts.map +1 -0
- package/dist/devices/dishwasher.js +57 -0
- package/dist/devices/dishwasher.js.map +1 -0
- package/dist/devices/evse.d.ts +76 -0
- package/dist/devices/evse.d.ts.map +1 -0
- package/dist/devices/evse.js +74 -10
- package/dist/devices/evse.js.map +1 -0
- package/dist/devices/export.d.ts +17 -0
- package/dist/devices/export.d.ts.map +1 -0
- package/dist/devices/export.js +5 -0
- package/dist/devices/export.js.map +1 -0
- package/dist/devices/extractorHood.d.ts +46 -0
- package/dist/devices/extractorHood.d.ts.map +1 -0
- package/dist/devices/extractorHood.js +43 -0
- package/dist/devices/extractorHood.js.map +1 -0
- package/dist/devices/heatPump.d.ts +47 -0
- package/dist/devices/heatPump.d.ts.map +1 -0
- package/dist/devices/heatPump.js +50 -2
- package/dist/devices/heatPump.js.map +1 -0
- package/dist/devices/laundryDryer.d.ts +67 -0
- package/dist/devices/laundryDryer.d.ts.map +1 -0
- package/dist/devices/laundryDryer.js +62 -3
- package/dist/devices/laundryDryer.js.map +1 -0
- package/dist/devices/laundryWasher.d.ts +81 -0
- package/dist/devices/laundryWasher.d.ts.map +1 -0
- package/dist/devices/laundryWasher.js +70 -4
- package/dist/devices/laundryWasher.js.map +1 -0
- package/dist/devices/microwaveOven.d.ts +168 -0
- package/dist/devices/microwaveOven.d.ts.map +1 -0
- package/dist/devices/microwaveOven.js +88 -5
- package/dist/devices/microwaveOven.js.map +1 -0
- package/dist/devices/oven.d.ts +105 -0
- package/dist/devices/oven.d.ts.map +1 -0
- package/dist/devices/oven.js +85 -0
- package/dist/devices/oven.js.map +1 -0
- package/dist/devices/refrigerator.d.ts +118 -0
- package/dist/devices/refrigerator.d.ts.map +1 -0
- package/dist/devices/refrigerator.js +102 -0
- package/dist/devices/refrigerator.js.map +1 -0
- package/dist/devices/roboticVacuumCleaner.d.ts +112 -0
- package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
- package/dist/devices/roboticVacuumCleaner.js +100 -9
- package/dist/devices/roboticVacuumCleaner.js.map +1 -0
- package/dist/devices/solarPower.d.ts +40 -0
- package/dist/devices/solarPower.d.ts.map +1 -0
- package/dist/devices/solarPower.js +38 -0
- package/dist/devices/solarPower.js.map +1 -0
- package/dist/devices/speaker.d.ts +87 -0
- package/dist/devices/speaker.d.ts.map +1 -0
- package/dist/devices/speaker.js +84 -0
- package/dist/devices/speaker.js.map +1 -0
- package/dist/devices/temperatureControl.d.ts +166 -0
- package/dist/devices/temperatureControl.d.ts.map +1 -0
- package/dist/devices/temperatureControl.js +24 -3
- package/dist/devices/temperatureControl.js.map +1 -0
- package/dist/devices/waterHeater.d.ts +111 -0
- package/dist/devices/waterHeater.d.ts.map +1 -0
- package/dist/devices/waterHeater.js +82 -2
- package/dist/devices/waterHeater.js.map +1 -0
- package/dist/dgram/coap.d.ts +205 -0
- package/dist/dgram/coap.d.ts.map +1 -0
- package/dist/dgram/coap.js +126 -13
- package/dist/dgram/coap.js.map +1 -0
- package/dist/dgram/dgram.d.ts +141 -0
- package/dist/dgram/dgram.d.ts.map +1 -0
- package/dist/dgram/dgram.js +114 -2
- package/dist/dgram/dgram.js.map +1 -0
- package/dist/dgram/mb_coap.d.ts +24 -0
- package/dist/dgram/mb_coap.d.ts.map +1 -0
- package/dist/dgram/mb_coap.js +41 -3
- package/dist/dgram/mb_coap.js.map +1 -0
- package/dist/dgram/mb_mdns.d.ts +24 -0
- package/dist/dgram/mb_mdns.d.ts.map +1 -0
- package/dist/dgram/mb_mdns.js +80 -15
- package/dist/dgram/mb_mdns.js.map +1 -0
- package/dist/dgram/mdns.d.ts +290 -0
- package/dist/dgram/mdns.d.ts.map +1 -0
- package/dist/dgram/mdns.js +299 -137
- package/dist/dgram/mdns.js.map +1 -0
- package/dist/dgram/multicast.d.ts +67 -0
- package/dist/dgram/multicast.d.ts.map +1 -0
- package/dist/dgram/multicast.js +62 -1
- package/dist/dgram/multicast.js.map +1 -0
- package/dist/dgram/unicast.d.ts +56 -0
- package/dist/dgram/unicast.d.ts.map +1 -0
- package/dist/dgram/unicast.js +54 -0
- package/dist/dgram/unicast.js.map +1 -0
- package/dist/frontend.d.ts +238 -0
- package/dist/frontend.d.ts.map +1 -0
- package/dist/frontend.js +455 -35
- package/dist/frontend.js.map +1 -0
- package/dist/frontendTypes.d.ts +529 -0
- package/dist/frontendTypes.d.ts.map +1 -0
- package/dist/frontendTypes.js +45 -0
- package/dist/frontendTypes.js.map +1 -0
- package/dist/helpers.d.ts +48 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +53 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/jestutils/export.d.ts +2 -0
- package/dist/jestutils/export.d.ts.map +1 -0
- package/dist/jestutils/export.js +1 -0
- package/dist/jestutils/export.js.map +1 -0
- package/dist/jestutils/jestHelpers.d.ts +345 -0
- package/dist/jestutils/jestHelpers.d.ts.map +1 -0
- package/dist/jestutils/jestHelpers.js +371 -14
- package/dist/jestutils/jestHelpers.js.map +1 -0
- package/dist/logger/export.d.ts +2 -0
- package/dist/logger/export.d.ts.map +1 -0
- package/dist/logger/export.js +1 -0
- package/dist/logger/export.js.map +1 -0
- package/dist/matter/behaviors.d.ts +2 -0
- package/dist/matter/behaviors.d.ts.map +1 -0
- package/dist/matter/behaviors.js +2 -0
- package/dist/matter/behaviors.js.map +1 -0
- package/dist/matter/clusters.d.ts +2 -0
- package/dist/matter/clusters.d.ts.map +1 -0
- package/dist/matter/clusters.js +2 -0
- package/dist/matter/clusters.js.map +1 -0
- package/dist/matter/devices.d.ts +2 -0
- package/dist/matter/devices.d.ts.map +1 -0
- package/dist/matter/devices.js +2 -0
- package/dist/matter/devices.js.map +1 -0
- package/dist/matter/endpoints.d.ts +2 -0
- package/dist/matter/endpoints.d.ts.map +1 -0
- package/dist/matter/endpoints.js +2 -0
- package/dist/matter/endpoints.js.map +1 -0
- package/dist/matter/export.d.ts +5 -0
- package/dist/matter/export.d.ts.map +1 -0
- package/dist/matter/export.js +3 -0
- package/dist/matter/export.js.map +1 -0
- package/dist/matter/types.d.ts +3 -0
- package/dist/matter/types.d.ts.map +1 -0
- package/dist/matter/types.js +3 -0
- package/dist/matter/types.js.map +1 -0
- package/dist/matterNode.d.ts +342 -0
- package/dist/matterNode.d.ts.map +1 -0
- package/dist/matterNode.js +369 -8
- package/dist/matterNode.js.map +1 -0
- package/dist/matterbridge.d.ts +492 -0
- package/dist/matterbridge.d.ts.map +1 -0
- package/dist/matterbridge.js +811 -46
- package/dist/matterbridge.js.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts +41 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.js +38 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
- package/dist/matterbridgeBehaviors.d.ts +2404 -0
- package/dist/matterbridgeBehaviors.d.ts.map +1 -0
- package/dist/matterbridgeBehaviors.js +68 -5
- package/dist/matterbridgeBehaviors.js.map +1 -0
- package/dist/matterbridgeDeviceTypes.d.ts +698 -0
- package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
- package/dist/matterbridgeDeviceTypes.js +635 -14
- package/dist/matterbridgeDeviceTypes.js.map +1 -0
- package/dist/matterbridgeDynamicPlatform.d.ts +41 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
- package/dist/matterbridgeDynamicPlatform.js +38 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -0
- package/dist/matterbridgeEndpoint.d.ts +1507 -0
- package/dist/matterbridgeEndpoint.d.ts.map +1 -0
- package/dist/matterbridgeEndpoint.js +1444 -53
- package/dist/matterbridgeEndpoint.js.map +1 -0
- package/dist/matterbridgeEndpointHelpers.d.ts +787 -0
- package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
- package/dist/matterbridgeEndpointHelpers.js +483 -20
- package/dist/matterbridgeEndpointHelpers.js.map +1 -0
- package/dist/matterbridgeEndpointTypes.d.ts +166 -0
- package/dist/matterbridgeEndpointTypes.d.ts.map +1 -0
- package/dist/matterbridgeEndpointTypes.js +25 -0
- package/dist/matterbridgeEndpointTypes.js.map +1 -0
- package/dist/matterbridgePlatform.d.ts +539 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +451 -1
- package/dist/matterbridgePlatform.js.map +1 -0
- package/dist/matterbridgeTypes.d.ts +251 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -0
- package/dist/matterbridgeTypes.js +26 -0
- package/dist/matterbridgeTypes.js.map +1 -0
- package/dist/pluginManager.d.ts +372 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +341 -5
- package/dist/pluginManager.js.map +1 -0
- package/dist/shelly.d.ts +181 -0
- package/dist/shelly.d.ts.map +1 -0
- package/dist/shelly.js +178 -7
- package/dist/shelly.js.map +1 -0
- package/dist/storage/export.d.ts +2 -0
- package/dist/storage/export.d.ts.map +1 -0
- package/dist/storage/export.js +1 -0
- package/dist/storage/export.js.map +1 -0
- package/dist/update.d.ts +84 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +93 -1
- package/dist/update.js.map +1 -0
- package/dist/utils/colorUtils.d.ts +101 -0
- package/dist/utils/colorUtils.d.ts.map +1 -0
- package/dist/utils/colorUtils.js +97 -2
- package/dist/utils/colorUtils.js.map +1 -0
- package/dist/utils/commandLine.d.ts +66 -0
- package/dist/utils/commandLine.d.ts.map +1 -0
- package/dist/utils/commandLine.js +60 -0
- package/dist/utils/commandLine.js.map +1 -0
- package/dist/utils/copyDirectory.d.ts +35 -0
- package/dist/utils/copyDirectory.d.ts.map +1 -0
- package/dist/utils/copyDirectory.js +37 -0
- package/dist/utils/copyDirectory.js.map +1 -0
- package/dist/utils/createDirectory.d.ts +34 -0
- package/dist/utils/createDirectory.d.ts.map +1 -0
- package/dist/utils/createDirectory.js +33 -0
- package/dist/utils/createDirectory.js.map +1 -0
- package/dist/utils/createZip.d.ts +39 -0
- package/dist/utils/createZip.d.ts.map +1 -0
- package/dist/utils/createZip.js +47 -2
- package/dist/utils/createZip.js.map +1 -0
- package/dist/utils/deepCopy.d.ts +32 -0
- package/dist/utils/deepCopy.d.ts.map +1 -0
- package/dist/utils/deepCopy.js +39 -0
- package/dist/utils/deepCopy.js.map +1 -0
- package/dist/utils/deepEqual.d.ts +54 -0
- package/dist/utils/deepEqual.d.ts.map +1 -0
- package/dist/utils/deepEqual.js +72 -1
- package/dist/utils/deepEqual.js.map +1 -0
- package/dist/utils/error.d.ts +45 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +42 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/export.d.ts +13 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/export.js +1 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/format.d.ts +53 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +49 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/hex.d.ts +89 -0
- package/dist/utils/hex.d.ts.map +1 -0
- package/dist/utils/hex.js +124 -0
- package/dist/utils/hex.js.map +1 -0
- package/dist/utils/inspector.d.ts +87 -0
- package/dist/utils/inspector.d.ts.map +1 -0
- package/dist/utils/inspector.js +69 -1
- package/dist/utils/inspector.js.map +1 -0
- package/dist/utils/isvalid.d.ts +103 -0
- package/dist/utils/isvalid.d.ts.map +1 -0
- package/dist/utils/isvalid.js +101 -0
- package/dist/utils/isvalid.js.map +1 -0
- package/dist/utils/network.d.ts +111 -0
- package/dist/utils/network.d.ts.map +1 -0
- package/dist/utils/network.js +96 -5
- package/dist/utils/network.js.map +1 -0
- package/dist/utils/spawn.d.ts +33 -0
- package/dist/utils/spawn.d.ts.map +1 -0
- package/dist/utils/spawn.js +71 -1
- package/dist/utils/spawn.js.map +1 -0
- package/dist/utils/tracker.d.ts +108 -0
- package/dist/utils/tracker.d.ts.map +1 -0
- package/dist/utils/tracker.js +64 -1
- package/dist/utils/tracker.js.map +1 -0
- package/dist/utils/wait.d.ts +54 -0
- package/dist/utils/wait.d.ts.map +1 -0
- package/dist/utils/wait.js +60 -8
- package/dist/utils/wait.js.map +1 -0
- package/dist/workerGlobalPrefix.d.ts +25 -0
- package/dist/workerGlobalPrefix.d.ts.map +1 -0
- package/dist/workerGlobalPrefix.js +37 -5
- package/dist/workerGlobalPrefix.js.map +1 -0
- package/dist/workerTypes.d.ts +52 -0
- package/dist/workerTypes.d.ts.map +1 -0
- package/dist/workerTypes.js +24 -0
- package/dist/workerTypes.js.map +1 -0
- package/dist/workers.d.ts +69 -0
- package/dist/workers.d.ts.map +1 -0
- package/dist/workers.js +68 -4
- package/dist/workers.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
- package/scripts/data_model.mjs +2058 -0
|
@@ -0,0 +1,539 @@
|
|
|
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
|
+
import { AnsiLogger, LogLevel } from 'node-ansi-logger';
|
|
25
|
+
import { NodeStorage } from 'node-persist-manager';
|
|
26
|
+
import { EndpointNumber, VendorId } from '@matter/types/datatype';
|
|
27
|
+
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
28
|
+
import { ApiSelectDevice, ApiSelectEntity } from './frontendTypes.js';
|
|
29
|
+
import { SystemInformation } from './matterbridgeTypes.js';
|
|
30
|
+
/** Platform configuration value type. */
|
|
31
|
+
export type PlatformConfigValue = string | number | boolean | bigint | object | undefined | null;
|
|
32
|
+
/** Platform configuration type. */
|
|
33
|
+
export type PlatformConfig = {
|
|
34
|
+
name: string;
|
|
35
|
+
type: string;
|
|
36
|
+
version: string;
|
|
37
|
+
debug: boolean;
|
|
38
|
+
unregisterOnShutdown: boolean;
|
|
39
|
+
} & Record<string, PlatformConfigValue>;
|
|
40
|
+
/** Platform schema value type. */
|
|
41
|
+
export type PlatformSchemaValue = string | number | boolean | bigint | object | undefined | null;
|
|
42
|
+
/** Platform schema type. */
|
|
43
|
+
export type PlatformSchema = Record<string, PlatformSchemaValue>;
|
|
44
|
+
/** A type representing a subset of readonly properties of Matterbridge for platform use. */
|
|
45
|
+
export type PlatformMatterbridge = {
|
|
46
|
+
readonly systemInformation: Readonly<Pick<SystemInformation, 'interfaceName' | 'macAddress' | 'ipv4Address' | 'ipv6Address' | 'nodeVersion' | 'hostname' | 'user' | 'osType' | 'osRelease' | 'osPlatform' | 'osArch' | 'totalMemory' | 'freeMemory' | 'systemUptime' | 'processUptime' | 'cpuUsage' | 'processCpuUsage' | 'rss' | 'heapTotal' | 'heapUsed'>>;
|
|
47
|
+
readonly rootDirectory: string;
|
|
48
|
+
readonly homeDirectory: string;
|
|
49
|
+
readonly matterbridgeDirectory: string;
|
|
50
|
+
readonly matterbridgePluginDirectory: string;
|
|
51
|
+
readonly matterbridgeCertDirectory: string;
|
|
52
|
+
readonly globalModulesDirectory: string;
|
|
53
|
+
readonly matterbridgeVersion: string;
|
|
54
|
+
readonly matterbridgeLatestVersion: string;
|
|
55
|
+
readonly matterbridgeDevVersion: string;
|
|
56
|
+
readonly frontendVersion: string;
|
|
57
|
+
readonly bridgeMode: 'bridge' | 'childbridge' | 'controller' | '';
|
|
58
|
+
readonly restartMode: 'service' | 'docker' | '';
|
|
59
|
+
readonly virtualMode: 'disabled' | 'outlet' | 'light' | 'switch' | 'mounted_switch';
|
|
60
|
+
readonly aggregatorVendorId: VendorId;
|
|
61
|
+
readonly aggregatorVendorName: string;
|
|
62
|
+
readonly aggregatorProductId: number;
|
|
63
|
+
readonly aggregatorProductName: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Represents the base Matterbridge platform. It is extended by the MatterbridgeAccessoryPlatform and MatterbridgeServicePlatform classes.
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
export declare class MatterbridgePlatform {
|
|
70
|
+
#private;
|
|
71
|
+
/** The PlatformMatterbridge instance of this Platform. */
|
|
72
|
+
readonly matterbridge: PlatformMatterbridge;
|
|
73
|
+
/** The logger instance for this platform. Created by the PluginManager.load() method. */
|
|
74
|
+
readonly log: AnsiLogger;
|
|
75
|
+
/** The configuration for this platform. Set by the PluginManager.load() method using the stored config file. */
|
|
76
|
+
config: PlatformConfig;
|
|
77
|
+
/** The name of the platform. Set by the PluginManager.load() method using the package.json name value. */
|
|
78
|
+
name: string;
|
|
79
|
+
/** The type of the platform. Set by the extending classes: MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform */
|
|
80
|
+
type: 'DynamicPlatform' | 'AccessoryPlatform' | 'AnyPlatform';
|
|
81
|
+
/** The version of the platform. Set by the PluginManager.load() method using the package.json version value. */
|
|
82
|
+
version: string;
|
|
83
|
+
/** Platform context in the storage of matterbridgeDirectory. Use await platform.ready to access it early. */
|
|
84
|
+
context?: NodeStorage;
|
|
85
|
+
/** Indicates whether the platform is is fully initialized (including context and selects). */
|
|
86
|
+
isReady: boolean;
|
|
87
|
+
/** Indicates whether the platform has been loaded. */
|
|
88
|
+
isLoaded: boolean;
|
|
89
|
+
/** Indicates whether the platform has been started. */
|
|
90
|
+
isStarted: boolean;
|
|
91
|
+
/** Indicates whether the platform has been configured. */
|
|
92
|
+
isConfigured: boolean;
|
|
93
|
+
/** Indicates whether the platform is shutting down. */
|
|
94
|
+
isShuttingDown: boolean;
|
|
95
|
+
/** 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. */
|
|
96
|
+
readonly ready: Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* MatterNode helpers injected by the PluginManager.load() method
|
|
99
|
+
*
|
|
100
|
+
* @param {(pluginName: string, device: MatterbridgeEndpoint) => Promise<void>} addBridgedEndpoint - Function to add a bridged endpoint.
|
|
101
|
+
* @param {(pluginName: string, device: MatterbridgeEndpoint) => Promise<void>} removeBridgedEndpoint - Function to remove a bridged endpoint.
|
|
102
|
+
* @param {(pluginName: string, delay?: number) => Promise<void>} removeAllBridgedEndpoints - Function to remove all bridged endpoints.
|
|
103
|
+
* @param {(pluginName: string, name: string, type: 'light' | 'outlet' | 'switch' | 'mounted_switch', callback: () => Promise<void>) => Promise<boolean>} addVirtualEndpoint - Function to add a virtual endpoint.
|
|
104
|
+
*/
|
|
105
|
+
private setMatterNode;
|
|
106
|
+
/**
|
|
107
|
+
* Creates an instance of the base MatterbridgePlatform.
|
|
108
|
+
* Each plugin must extend the MatterbridgeDynamicPlatform or MatterbridgeAccessoryPlatform class.
|
|
109
|
+
* MatterbridgePlatform cannot be instantiated directly, it can only be extended by the MatterbridgeDynamicPlatform or MatterbridgeAccessoryPlatform class.
|
|
110
|
+
*
|
|
111
|
+
* @param {PlatformMatterbridge} matterbridge - The PlatformMatterbridge instance.
|
|
112
|
+
* @param {AnsiLogger} log - The logger instance.
|
|
113
|
+
* @param {PlatformConfig} config - The platform configuration.
|
|
114
|
+
*/
|
|
115
|
+
protected constructor(matterbridge: PlatformMatterbridge, log: AnsiLogger, config: PlatformConfig);
|
|
116
|
+
/**
|
|
117
|
+
* Destroys the platform, cleaning up memory, closing storage and broadcast server.
|
|
118
|
+
*/
|
|
119
|
+
private destroy;
|
|
120
|
+
/**
|
|
121
|
+
* This method shall be overridden in the extended class.
|
|
122
|
+
* It is called when the platform is started.
|
|
123
|
+
* Use this method to create the MatterbridgeEndpoints and call this.registerDevice().
|
|
124
|
+
*
|
|
125
|
+
* @param {string} [reason] - The reason for starting.
|
|
126
|
+
* @throws {Error} - Throws an error if the method is not overridden.
|
|
127
|
+
*/
|
|
128
|
+
onStart(reason?: string): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* This method can be overridden in the extended class. In this case always call super.onConfigure() to save the select and run checkEndpointNumbers().
|
|
131
|
+
* It is called after the platform has started.
|
|
132
|
+
* 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
|
|
133
|
+
* matter storage (i.e. the onOff attribute of the OnOff cluster).
|
|
134
|
+
*/
|
|
135
|
+
onConfigure(): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* 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.
|
|
138
|
+
* It is called when the platform is shutting down.
|
|
139
|
+
* Use this method to clean up any resources you used in the constructor or onStart.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} [reason] - The reason for shutting down.
|
|
142
|
+
*/
|
|
143
|
+
onShutdown(reason?: string): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* Called when the logger level is changed.
|
|
146
|
+
*
|
|
147
|
+
* @param {LogLevel} logLevel The new logger level.
|
|
148
|
+
*/
|
|
149
|
+
onChangeLoggerLevel(logLevel: LogLevel): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Called when a plugin config includes an action button or an action button with text field.
|
|
152
|
+
*
|
|
153
|
+
* @param {string} action The action triggered by the button in plugin config.
|
|
154
|
+
* @param {string} value The value of the field of the action button.
|
|
155
|
+
* @param {string} id The id of the schema associated with the action.
|
|
156
|
+
* @param {PlatformConfig} formData The changed form data of the plugin.
|
|
157
|
+
*
|
|
158
|
+
* @remarks
|
|
159
|
+
* This method can be overridden in the extended class.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* Use this method to handle the action defined in the plugin schema:
|
|
163
|
+
* ```json
|
|
164
|
+
* "addDevice": {
|
|
165
|
+
* "description": "Manually add a device that has not been discovered with mdns:",
|
|
166
|
+
* "type": "boolean",
|
|
167
|
+
* "buttonText": "ADD", // The text on the button. This is used when the action doesn't include a text field.
|
|
168
|
+
* "buttonField": "ADD", // The text on the button. This is used when the action includes a text field.
|
|
169
|
+
* "buttonClose": false, // optional, default is false. When true, the dialog will close after the action is sent.
|
|
170
|
+
* "buttonSave": false, // optional, default is false. When true, the dialog will close and trigger the restart required after the action is sent.
|
|
171
|
+
* "textPlaceholder": "Enter the device IP address", // optional: the placeholder text for the text field.
|
|
172
|
+
* "default": false
|
|
173
|
+
* },
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
onAction(action: string, value?: string, id?: string, formData?: PlatformConfig): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* Called when the plugin config has been updated.
|
|
179
|
+
*
|
|
180
|
+
* @param {PlatformConfig} config The new plugin config.
|
|
181
|
+
*/
|
|
182
|
+
onConfigChanged(config: PlatformConfig): Promise<void>;
|
|
183
|
+
/**
|
|
184
|
+
* Save the platform configuration to the platform config JSON.
|
|
185
|
+
*
|
|
186
|
+
* @param {PlatformConfig} [config] - The platform configuration to save.
|
|
187
|
+
* @returns {void}
|
|
188
|
+
*/
|
|
189
|
+
saveConfig(config: PlatformConfig): void;
|
|
190
|
+
/**
|
|
191
|
+
* Get the platform schema for the config editor. This will retrieve the schema from the Matterbridge plugin manager.
|
|
192
|
+
*
|
|
193
|
+
* @returns {Promise<PlatformSchema | undefined>} The platform schema.
|
|
194
|
+
*/
|
|
195
|
+
getSchema(): Promise<PlatformSchema | undefined>;
|
|
196
|
+
/**
|
|
197
|
+
* 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.
|
|
198
|
+
* It must be called from onStart() to update the schema in the plugin.
|
|
199
|
+
* Calling this method from the platform constructor will have no effect.
|
|
200
|
+
*
|
|
201
|
+
* @param {PlatformSchema} [schema] - The platform schema to set.
|
|
202
|
+
* @returns {void}
|
|
203
|
+
*/
|
|
204
|
+
setSchema(schema: PlatformSchema): void;
|
|
205
|
+
/**
|
|
206
|
+
* Sends a restart required message to the frontend.
|
|
207
|
+
*
|
|
208
|
+
* @param {boolean} [snackbar] - If true, shows a snackbar notification. Default is true.
|
|
209
|
+
* @param {boolean} [fixed] - If true, shows a fixed notification. Default is false.
|
|
210
|
+
* @returns {void}
|
|
211
|
+
*/
|
|
212
|
+
wssSendRestartRequired(snackbar?: boolean, fixed?: boolean): void;
|
|
213
|
+
/**
|
|
214
|
+
* Sends an open snackbar message to all connected clients.
|
|
215
|
+
*
|
|
216
|
+
* @param {string} message - The message to send.
|
|
217
|
+
* @param {number} timeout - The timeout in seconds for the snackbar message. Default is 5 seconds.
|
|
218
|
+
* @param {'info' | 'warning' | 'error' | 'success'} severity - The severity of the message.
|
|
219
|
+
* possible values are: 'info', 'warning', 'error', 'success'. Default is 'info'.
|
|
220
|
+
*
|
|
221
|
+
* @remarks
|
|
222
|
+
* If timeout is 0, the snackbar message will be displayed until closed by the user.
|
|
223
|
+
*/
|
|
224
|
+
wssSendSnackbarMessage(message: string, timeout?: number, severity?: 'error' | 'success' | 'info' | 'warning'): void;
|
|
225
|
+
/**
|
|
226
|
+
* Retrieves the number of devices registered with the platform.
|
|
227
|
+
*
|
|
228
|
+
* @returns {number} The number of registered devices.
|
|
229
|
+
*/
|
|
230
|
+
size(): number;
|
|
231
|
+
/**
|
|
232
|
+
* Retrieves the devices registered with the platform.
|
|
233
|
+
*
|
|
234
|
+
* @returns {MatterbridgeEndpoint[]} The registered devices.
|
|
235
|
+
*/
|
|
236
|
+
getDevices(): MatterbridgeEndpoint[];
|
|
237
|
+
/**
|
|
238
|
+
* Retrieves a registered device by its name.
|
|
239
|
+
*
|
|
240
|
+
* @param {string} deviceName - The device name to search for.
|
|
241
|
+
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
242
|
+
*/
|
|
243
|
+
getDeviceByName(deviceName: string): MatterbridgeEndpoint | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* Retrieves a registered device by its uniqueId.
|
|
246
|
+
*
|
|
247
|
+
* @param {string} uniqueId - The device unique ID to search for.
|
|
248
|
+
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
249
|
+
*/
|
|
250
|
+
getDeviceByUniqueId(uniqueId: string): MatterbridgeEndpoint | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* Retrieves a registered device by its serialNumber.
|
|
253
|
+
*
|
|
254
|
+
* @param {string} serialNumber - The device serial number to search for.
|
|
255
|
+
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
256
|
+
*/
|
|
257
|
+
getDeviceBySerialNumber(serialNumber: string): MatterbridgeEndpoint | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Retrieves a registered device by its id.
|
|
260
|
+
*
|
|
261
|
+
* @param {string} id - The device id to search for.
|
|
262
|
+
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
263
|
+
*/
|
|
264
|
+
getDeviceById(id: string): MatterbridgeEndpoint | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Retrieves a registered device by its originalId.
|
|
267
|
+
*
|
|
268
|
+
* @param {string} originalId - The device originalId to search for.
|
|
269
|
+
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
270
|
+
*/
|
|
271
|
+
getDeviceByOriginalId(originalId: string): MatterbridgeEndpoint | undefined;
|
|
272
|
+
/**
|
|
273
|
+
* Retrieves a registered device by its number.
|
|
274
|
+
*
|
|
275
|
+
* @param {EndpointNumber | number} number - The device number to search for.
|
|
276
|
+
* @returns {MatterbridgeEndpoint | undefined} The registered device or undefined if not found.
|
|
277
|
+
*/
|
|
278
|
+
getDeviceByNumber(number: EndpointNumber | number): MatterbridgeEndpoint | undefined;
|
|
279
|
+
/**
|
|
280
|
+
* Checks if a device with this name is already registered in the platform.
|
|
281
|
+
*
|
|
282
|
+
* @param {string} deviceName - The device name to check.
|
|
283
|
+
* @returns {boolean} True if the device is already registered, false otherwise.
|
|
284
|
+
*/
|
|
285
|
+
hasDeviceName(deviceName: string): boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Checks if a device with this uniqueId is already registered in the platform.
|
|
288
|
+
*
|
|
289
|
+
* @param {string} deviceUniqueId - The device unique ID to check.
|
|
290
|
+
* @returns {boolean} True if the device is already registered, false otherwise.
|
|
291
|
+
*/
|
|
292
|
+
hasDeviceUniqueId(deviceUniqueId: string): boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Registers a virtual device with the Matterbridge platform.
|
|
295
|
+
* Virtual devices are only supported in bridge mode and childbridge mode with a DynamicPlatform.
|
|
296
|
+
*
|
|
297
|
+
* The virtual device is created as an instance of `Endpoint` with the provided device type.
|
|
298
|
+
* When the virtual device is turned on, the provided callback function is executed.
|
|
299
|
+
* The onOff state of the virtual device always reverts to false when the device is turned on.
|
|
300
|
+
*
|
|
301
|
+
* @param { string } name - The name of the virtual device.
|
|
302
|
+
* @param { 'light' | 'outlet' | 'switch' | 'mounted_switch' } type - The type of the virtual device.
|
|
303
|
+
* @param { () => Promise<void> } callback - The callback to call when the virtual device is turned on.
|
|
304
|
+
*
|
|
305
|
+
* @returns {Promise<boolean>} A promise that resolves to true if the virtual device was successfully registered, false otherwise.
|
|
306
|
+
*
|
|
307
|
+
* @remarks
|
|
308
|
+
* The virtual devices don't show up in the device list of the frontend.
|
|
309
|
+
* Type 'switch' is not supported by Alexa and 'mounted_switch' is not supported by Apple Home.
|
|
310
|
+
*/
|
|
311
|
+
registerVirtualDevice(name: string, type: 'light' | 'outlet' | 'switch' | 'mounted_switch', callback: () => Promise<void>): Promise<boolean>;
|
|
312
|
+
/**
|
|
313
|
+
* Registers a device with the Matterbridge platform and performs validation checks.
|
|
314
|
+
*
|
|
315
|
+
* This method also checks if the implementation called createDefaultBasicInformationClusterServer() instead of createDefaultBridgedDeviceBasicInformationClusterServer().
|
|
316
|
+
*
|
|
317
|
+
* This is correct with Accessory platforms so we check if we are running in bridge mode and add the bridgedNode and the BridgedDeviceBasicInformation cluster.
|
|
318
|
+
*
|
|
319
|
+
* If we are in bridge mode, we add the bridgedNode device type and the BridgedDeviceBasicInformation cluster.
|
|
320
|
+
*
|
|
321
|
+
* If we are in childbridge mode and the plugin is a 'DynamicPlatform', we add the bridgedNode device type and the BridgedDeviceBasicInformation cluster.
|
|
322
|
+
*
|
|
323
|
+
* if we are in childbridge mode and the plugin is a 'AccessoryPlatform', the device is not bridged so no action is taken.
|
|
324
|
+
*
|
|
325
|
+
* If the device.mode = 'server', the device is not bridged so no action is taken.
|
|
326
|
+
*
|
|
327
|
+
* If the device.mode = 'matter', the device is not bridged so no action is taken.
|
|
328
|
+
*
|
|
329
|
+
* @param {MatterbridgeEndpoint} device - The device to register.
|
|
330
|
+
*/
|
|
331
|
+
registerDevice(device: MatterbridgeEndpoint): Promise<void>;
|
|
332
|
+
/**
|
|
333
|
+
* Unregisters a device registered with the Matterbridge platform.
|
|
334
|
+
*
|
|
335
|
+
* @param {MatterbridgeEndpoint} device - The device to unregister.
|
|
336
|
+
*/
|
|
337
|
+
unregisterDevice(device: MatterbridgeEndpoint): Promise<void>;
|
|
338
|
+
/**
|
|
339
|
+
* Unregisters all devices registered with the Matterbridge platform.
|
|
340
|
+
*
|
|
341
|
+
* @param {number} [delay] - The delay in milliseconds between removing each bridged endpoint (default: 0).
|
|
342
|
+
*/
|
|
343
|
+
unregisterAllDevices(delay?: number): Promise<void>;
|
|
344
|
+
/**
|
|
345
|
+
* Saves the select devices and entities to storage.
|
|
346
|
+
*
|
|
347
|
+
* This method saves the current state of `selectDevice` and `selectEntity` maps to their respective storage.
|
|
348
|
+
* It logs the number of items being saved and ensures that the storage is properly closed after saving.
|
|
349
|
+
*
|
|
350
|
+
* @returns {Promise<void>} A promise that resolves when the save operation is complete.
|
|
351
|
+
*/
|
|
352
|
+
private saveSelects;
|
|
353
|
+
/**
|
|
354
|
+
* Clears all the select device and entity maps and saves the changes to the storage.
|
|
355
|
+
*
|
|
356
|
+
* @returns {void}
|
|
357
|
+
*/
|
|
358
|
+
clearSelect(): Promise<void>;
|
|
359
|
+
/**
|
|
360
|
+
* Clears the select for a single device and saves the changes to the storage.
|
|
361
|
+
*
|
|
362
|
+
* @param {string} serial - The serial of the device to clear.
|
|
363
|
+
* @returns {void}
|
|
364
|
+
*/
|
|
365
|
+
clearDeviceSelect(serial: string): Promise<void>;
|
|
366
|
+
/**
|
|
367
|
+
* Clears the select for a single entity and saves the changes to the storage.
|
|
368
|
+
*
|
|
369
|
+
* @param {string} name - The name of the entity to clear.
|
|
370
|
+
* @returns {void}
|
|
371
|
+
*/
|
|
372
|
+
clearEntitySelect(name: string): Promise<void>;
|
|
373
|
+
/**
|
|
374
|
+
* Set the select device in the platform map.
|
|
375
|
+
*
|
|
376
|
+
* @param {string} serial - The serial number of the device.
|
|
377
|
+
* @param {string} name - The name of the device.
|
|
378
|
+
* @param {string} [configUrl] - The configuration URL of the device.
|
|
379
|
+
* @param {string} [icon] - The icon of the device: 'wifi', 'ble', 'hub'
|
|
380
|
+
* @param {Array<{ name: string; description: string; icon?: string }>} [entities] - The entities associated with the device.
|
|
381
|
+
* @returns {void}
|
|
382
|
+
*
|
|
383
|
+
* @remarks
|
|
384
|
+
* In the schema use selectFrom: 'serial' or 'name'
|
|
385
|
+
* ```json
|
|
386
|
+
* "whiteList": {
|
|
387
|
+
* "description": "Only the devices in the list will be exposed.",
|
|
388
|
+
* "type": "array",
|
|
389
|
+
* "items": {
|
|
390
|
+
* "type": "string"
|
|
391
|
+
* },
|
|
392
|
+
* "uniqueItems": true,
|
|
393
|
+
* "selectFrom": "name"
|
|
394
|
+
* },
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
setSelectDevice(serial: string, name: string, configUrl?: string, icon?: string, entities?: {
|
|
398
|
+
name: string;
|
|
399
|
+
description: string;
|
|
400
|
+
icon?: string;
|
|
401
|
+
}[]): void;
|
|
402
|
+
/**
|
|
403
|
+
* Retrieve a select device by serial.
|
|
404
|
+
*
|
|
405
|
+
* @param {string} serial - The serial number of the device.
|
|
406
|
+
* @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.
|
|
407
|
+
*/
|
|
408
|
+
getSelectDevice(serial: string): {
|
|
409
|
+
serial: string;
|
|
410
|
+
name: string;
|
|
411
|
+
configUrl?: string;
|
|
412
|
+
icon?: string;
|
|
413
|
+
entities?: {
|
|
414
|
+
name: string;
|
|
415
|
+
description: string;
|
|
416
|
+
icon?: string;
|
|
417
|
+
}[];
|
|
418
|
+
} | undefined;
|
|
419
|
+
/**
|
|
420
|
+
* Set the select device entity in the platform map.
|
|
421
|
+
*
|
|
422
|
+
* @param {string} serial - The serial number of the device.
|
|
423
|
+
* @param {string} entityName - The name of the entity.
|
|
424
|
+
* @param {string} entityDescription - The description of the entity.
|
|
425
|
+
* @param {string} [entityIcon] - The icon of the entity: 'wifi', 'ble', 'hub', 'component', 'matter'
|
|
426
|
+
* @returns {void}
|
|
427
|
+
*
|
|
428
|
+
* @remarks
|
|
429
|
+
* In the schema use selectDeviceEntityFrom: 'name' or 'description'
|
|
430
|
+
* ```json
|
|
431
|
+
* "deviceEntityBlackList": {
|
|
432
|
+
* "description": "List of entities not to be exposed for a single device.",
|
|
433
|
+
* "type": "object",
|
|
434
|
+
* "uniqueItems": true,
|
|
435
|
+
* "selectFrom": "name",
|
|
436
|
+
* "additionalProperties": {
|
|
437
|
+
* "description": "List of entities not to be exposed for this device.",
|
|
438
|
+
* "type": "array",
|
|
439
|
+
* "items": {
|
|
440
|
+
* "type": "string"
|
|
441
|
+
* },
|
|
442
|
+
* "uniqueItems": true,
|
|
443
|
+
* "selectDeviceEntityFrom": "name"
|
|
444
|
+
* }
|
|
445
|
+
* },
|
|
446
|
+
* ```
|
|
447
|
+
*/
|
|
448
|
+
setSelectDeviceEntity(serial: string, entityName: string, entityDescription: string, entityIcon?: string): void;
|
|
449
|
+
/**
|
|
450
|
+
* Retrieves the select devices from the platform map.
|
|
451
|
+
*
|
|
452
|
+
* @returns {ApiSelectDevice[]} The selected devices array.
|
|
453
|
+
*/
|
|
454
|
+
getSelectDevices(): ApiSelectDevice[];
|
|
455
|
+
/**
|
|
456
|
+
* Set the select entity in the platform map.
|
|
457
|
+
*
|
|
458
|
+
* @param {string} name - The entity name.
|
|
459
|
+
* @param {string} description - The entity description.
|
|
460
|
+
* @param {string} [icon] - The entity icon: 'wifi', 'ble', 'hub', 'component', 'matter'
|
|
461
|
+
* @returns {void}
|
|
462
|
+
*
|
|
463
|
+
* @remarks
|
|
464
|
+
* In the schema use selectEntityFrom: 'name' or 'description'
|
|
465
|
+
* ```json
|
|
466
|
+
* "entityBlackList": {
|
|
467
|
+
* "description": "The entities in the list will not be exposed.",
|
|
468
|
+
* "type": "array",
|
|
469
|
+
* "items": {
|
|
470
|
+
* "type": "string"
|
|
471
|
+
* },
|
|
472
|
+
* "uniqueItems": true,
|
|
473
|
+
* "selectEntityFrom": "name"
|
|
474
|
+
* },
|
|
475
|
+
* ```
|
|
476
|
+
*/
|
|
477
|
+
setSelectEntity(name: string, description: string, icon?: string): void;
|
|
478
|
+
/**
|
|
479
|
+
* Retrieve a select entity by name.
|
|
480
|
+
*
|
|
481
|
+
* @param {string} name - The name of the entity.
|
|
482
|
+
* @returns {{ name: string; description: string; icon?: string } | undefined} The select entity or undefined if not found.
|
|
483
|
+
*/
|
|
484
|
+
getSelectEntity(name: string): {
|
|
485
|
+
name: string;
|
|
486
|
+
description: string;
|
|
487
|
+
icon?: string | undefined;
|
|
488
|
+
} | undefined;
|
|
489
|
+
/**
|
|
490
|
+
* Retrieve the select entities.
|
|
491
|
+
*
|
|
492
|
+
* @returns {ApiSelectEntity[]} The select entities array.
|
|
493
|
+
*/
|
|
494
|
+
getSelectEntities(): ApiSelectEntity[];
|
|
495
|
+
/**
|
|
496
|
+
* Verifies if the Matterbridge version meets the required version.
|
|
497
|
+
* If not, it destroys the platform cause the implementation may not call destroy().
|
|
498
|
+
*
|
|
499
|
+
* @param {string} requiredVersion - The required version to compare against.
|
|
500
|
+
* @param {boolean} [destroy] - Whether to destroy the platform if the version check fails. Default is true.
|
|
501
|
+
* @returns {boolean} True if the Matterbridge version meets or exceeds the required version, false otherwise.
|
|
502
|
+
*/
|
|
503
|
+
verifyMatterbridgeVersion(requiredVersion: string, destroy?: boolean): boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Validates if a device is allowed based on the whitelist and blacklist configurations.
|
|
506
|
+
* The blacklist has priority over the whitelist.
|
|
507
|
+
*
|
|
508
|
+
* @param {string | string[]} device - The device name(s) to validate.
|
|
509
|
+
* @param {boolean} [log] - Whether to log the validation result.
|
|
510
|
+
* @returns {boolean} - Returns true if the device is allowed, false otherwise.
|
|
511
|
+
*/
|
|
512
|
+
validateDevice(device: string | string[], log?: boolean): boolean;
|
|
513
|
+
/**
|
|
514
|
+
* Validates if an entity is allowed based on the entity blacklist and device-entity blacklist configurations.
|
|
515
|
+
*
|
|
516
|
+
* @param {string} device - The device to which the entity belongs.
|
|
517
|
+
* @param {string} entity - The entity to validate.
|
|
518
|
+
* @param {boolean} [log] - Whether to log the validation result.
|
|
519
|
+
* @returns {boolean} - Returns true if the entity is allowed, false otherwise.
|
|
520
|
+
*/
|
|
521
|
+
validateEntity(device: string, entity: string, log?: boolean): boolean;
|
|
522
|
+
/**
|
|
523
|
+
* Clears all stored endpoint numbers for checkEndpointNumbers().
|
|
524
|
+
*
|
|
525
|
+
* @returns {Promise<void>} A promise that resolves when the endpoint numbers have been cleared.
|
|
526
|
+
*/
|
|
527
|
+
private clearEndpointNumbers;
|
|
528
|
+
/**
|
|
529
|
+
* Checks and updates the endpoint numbers for Matterbridge devices.
|
|
530
|
+
*
|
|
531
|
+
* This method retrieves the list of Matterbridge devices and their child endpoints,
|
|
532
|
+
* compares their current endpoint numbers with the stored ones, and updates the storage
|
|
533
|
+
* if there are any changes. It logs the changes and updates the endpoint numbers accordingly.
|
|
534
|
+
*
|
|
535
|
+
* @returns {Promise<number>} The size of the updated endpoint map, or -1 if storage is not available.
|
|
536
|
+
*/
|
|
537
|
+
private checkEndpointNumbers;
|
|
538
|
+
}
|
|
539
|
+
//# sourceMappingURL=matterbridgePlatform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matterbridgePlatform.d.ts","sourceRoot":"","sources":["../src/matterbridgePlatform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AASH,OAAO,EAAE,UAAU,EAAgB,QAAQ,EAAU,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAsB,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM3D,yCAAyC;AACzC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAEjG,mCAAmC;AACnC,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,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