matterbridge 3.3.8-dev-20251115-ca5ff21 → 3.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/broadcastServer.d.ts +115 -0
- package/dist/broadcastServer.d.ts.map +1 -0
- package/dist/broadcastServer.js +93 -1
- package/dist/broadcastServer.js.map +1 -0
- package/dist/broadcastServerTypes.d.ts +806 -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/defaultConfigSchema.d.ts +28 -0
- package/dist/defaultConfigSchema.d.ts.map +1 -0
- package/dist/defaultConfigSchema.js +24 -0
- package/dist/defaultConfigSchema.js.map +1 -0
- package/dist/deviceManager.d.ts +128 -0
- package/dist/deviceManager.d.ts.map +1 -0
- package/dist/deviceManager.js +105 -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 +60 -0
- package/dist/devices/cooktop.d.ts.map +1 -0
- package/dist/devices/cooktop.js +55 -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 +92 -11
- 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 +111 -20
- 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 +454 -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 +250 -0
- package/dist/jestutils/jestHelpers.d.ts.map +1 -0
- package/dist/jestutils/jestHelpers.js +275 -4
- 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/matterbridge.d.ts +469 -0
- package/dist/matterbridge.d.ts.map +1 -0
- package/dist/matterbridge.js +788 -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 +77 -14
- 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 +1490 -0
- package/dist/matterbridgeEndpoint.d.ts.map +1 -0
- package/dist/matterbridgeEndpoint.js +1432 -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 +488 -25
- package/dist/matterbridgeEndpointHelpers.js.map +1 -0
- package/dist/matterbridgeEndpointTypes.d.ts +197 -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 +415 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +354 -1
- package/dist/matterbridgePlatform.js.map +1 -0
- package/dist/matterbridgeTypes.d.ts +239 -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 +371 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +339 -4
- package/dist/pluginManager.js.map +1 -0
- package/dist/shelly.d.ts +174 -0
- package/dist/shelly.d.ts.map +1 -0
- package/dist/shelly.js +168 -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 +75 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +69 -0
- 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 +33 -0
- package/dist/utils/copyDirectory.d.ts.map +1 -0
- package/dist/utils/copyDirectory.js +38 -1
- 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 +44 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +41 -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 +101 -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 +35 -0
- package/dist/utils/spawn.d.ts.map +1 -0
- package/dist/utils/spawn.js +71 -0
- 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/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
|
@@ -1,7 +1,34 @@
|
|
|
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.3.0
|
|
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
|
+
// eslint-disable-next-line no-console
|
|
1
25
|
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
2
26
|
console.log('\u001B[32mMatterbridgePlatform loaded.\u001B[40;0m');
|
|
27
|
+
// Node.js modules
|
|
3
28
|
import path from 'node:path';
|
|
29
|
+
// Node AnsiLogger module
|
|
4
30
|
import { CYAN, db, er, nf, wr } from 'node-ansi-logger';
|
|
31
|
+
// Node Storage module
|
|
5
32
|
import { NodeStorageManager } from 'node-persist-manager';
|
|
6
33
|
import { Descriptor } from '@matter/types/clusters/descriptor';
|
|
7
34
|
import { BridgedDeviceBasicInformation } from '@matter/types/clusters/bridged-device-basic-information';
|
|
@@ -9,27 +36,54 @@ import { checkNotLatinCharacters } from './matterbridgeEndpointHelpers.js';
|
|
|
9
36
|
import { bridgedNode } from './matterbridgeDeviceTypes.js';
|
|
10
37
|
import { isValidArray, isValidObject, isValidString } from './utils/isvalid.js';
|
|
11
38
|
import { addVirtualDevice } from './helpers.js';
|
|
39
|
+
/**
|
|
40
|
+
* Represents the base Matterbridge platform. It is extended by the MatterbridgeAccessoryPlatform and MatterbridgeServicePlatform classes.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
12
43
|
export class MatterbridgePlatform {
|
|
44
|
+
/** The Matterbridge instance of this Platform. */
|
|
13
45
|
matterbridge;
|
|
46
|
+
/** The logger instance for this platform. */
|
|
14
47
|
log;
|
|
48
|
+
/** The configuration for this platform. */
|
|
15
49
|
config;
|
|
50
|
+
/** The name of the platform. Will be set by the loadPlugin() method using the package.json value. */
|
|
16
51
|
name = '';
|
|
52
|
+
/** The type of the platform. Will be set by the extending classes. */
|
|
17
53
|
type = 'AnyPlatform';
|
|
54
|
+
/** The version of the platform. Will be set by the loadPlugin() method using the package.json value */
|
|
18
55
|
version = '1.0.0';
|
|
56
|
+
/** Platform node storage manager in the matterbridgeDirectory. */
|
|
19
57
|
storage;
|
|
58
|
+
/** Platform context in the storage of matterbridgeDirectory. Use await platform.ready to access it early. */
|
|
20
59
|
context;
|
|
60
|
+
// Device and entity select in the plugin config UI
|
|
21
61
|
selectDevice = new Map();
|
|
22
62
|
selectEntity = new Map();
|
|
63
|
+
// Promises for platform initialization. They are grouped in platform.ready with Promise.all.
|
|
23
64
|
contextReady;
|
|
24
65
|
selectDeviceContextReady;
|
|
25
66
|
selectEntityContextReady;
|
|
67
|
+
/** The ready promise for the platform, which resolves when the platform is fully initialized (including context and selects). */
|
|
26
68
|
ready;
|
|
69
|
+
/** Registered MatterbridgeEndpoint map keyed by uniqueId */
|
|
27
70
|
registeredEndpointsByUniqueId = new Map();
|
|
71
|
+
/** Registered MatterbridgeEndpoint map keyed by deviceName */
|
|
28
72
|
registeredEndpointsByName = new Map();
|
|
73
|
+
/**
|
|
74
|
+
* Creates an instance of the base MatterbridgePlatform.
|
|
75
|
+
* It is extended by the MatterbridgeAccessoryPlatform and MatterbridgeServicePlatform classes.
|
|
76
|
+
* Each plugin must extend the MatterbridgeAccessoryPlatform and MatterbridgeServicePlatform classes.
|
|
77
|
+
*
|
|
78
|
+
* @param {PlatformMatterbridge} matterbridge - The Matterbridge instance.
|
|
79
|
+
* @param {AnsiLogger} log - The logger instance.
|
|
80
|
+
* @param {PlatformConfig} config - The platform configuration.
|
|
81
|
+
*/
|
|
29
82
|
constructor(matterbridge, log, config) {
|
|
30
83
|
this.matterbridge = matterbridge;
|
|
31
84
|
this.log = log;
|
|
32
85
|
this.config = config;
|
|
86
|
+
// create the NodeStorageManager for the plugin platform
|
|
33
87
|
if (!isValidString(this.config.name, 1))
|
|
34
88
|
throw new Error('Platform: the plugin name is missing or invalid.');
|
|
35
89
|
this.log.debug(`Creating storage for plugin ${this.config.name} in ${path.join(this.matterbridge.matterbridgeDirectory, this.config.name)}`);
|
|
@@ -40,12 +94,14 @@ export class MatterbridgePlatform {
|
|
|
40
94
|
logging: false,
|
|
41
95
|
forgiveParseErrors: true,
|
|
42
96
|
});
|
|
97
|
+
// create the context storage for the plugin platform
|
|
43
98
|
this.log.debug(`Creating context for plugin ${this.config.name}`);
|
|
44
99
|
this.contextReady = this.storage.createStorage('context').then((context) => {
|
|
45
100
|
this.context = context;
|
|
46
101
|
this.log.debug(`Created context for plugin ${this.config.name}`);
|
|
47
102
|
return;
|
|
48
103
|
});
|
|
104
|
+
// create the selectDevice storage for the plugin platform
|
|
49
105
|
this.log.debug(`Loading selectDevice for plugin ${this.config.name}`);
|
|
50
106
|
this.selectDeviceContextReady = this.storage.createStorage('selectDevice').then(async (context) => {
|
|
51
107
|
const selectDevice = await context.get('selectDevice', []);
|
|
@@ -54,6 +110,7 @@ export class MatterbridgePlatform {
|
|
|
54
110
|
this.log.debug(`Loaded ${this.selectDevice.size} selectDevice for plugin ${this.config.name}`);
|
|
55
111
|
return;
|
|
56
112
|
});
|
|
113
|
+
// create the selectEntity storage for the plugin platform
|
|
57
114
|
this.log.debug(`Loading selectEntity for plugin ${this.config.name}`);
|
|
58
115
|
this.selectEntityContextReady = this.storage.createStorage('selectEntity').then(async (context) => {
|
|
59
116
|
const selectEntity = await context.get('selectEntity', []);
|
|
@@ -62,73 +119,192 @@ export class MatterbridgePlatform {
|
|
|
62
119
|
this.log.debug(`Loaded ${this.selectEntity.size} selectEntity for plugin ${this.config.name}`);
|
|
63
120
|
return;
|
|
64
121
|
});
|
|
122
|
+
// Create the `ready` promise for the platform
|
|
65
123
|
this.ready = Promise.all([this.contextReady, this.selectDeviceContextReady, this.selectEntityContextReady]).then(() => {
|
|
66
124
|
this.log.debug(`MatterbridgePlatform for plugin ${this.config.name} is fully initialized`);
|
|
67
125
|
return;
|
|
68
126
|
});
|
|
69
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* This method shall be overridden in the extended class.
|
|
130
|
+
* It is called when the platform is started.
|
|
131
|
+
* Use this method to create the MatterbridgeEndpoints and call this.registerDevice().
|
|
132
|
+
*
|
|
133
|
+
* @param {string} [reason] - The reason for starting.
|
|
134
|
+
* @throws {Error} - Throws an error if the method is not overridden.
|
|
135
|
+
*/
|
|
70
136
|
async onStart(reason) {
|
|
71
137
|
this.log.error('Plugins must override onStart.', reason);
|
|
72
138
|
throw new Error('Plugins must override onStart.');
|
|
73
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* This method can be overridden in the extended class. In this case always call super.onConfigure() to save the select and run checkEndpointNumbers().
|
|
142
|
+
* It is called after the platform has started.
|
|
143
|
+
* 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
|
|
144
|
+
* matter storage (i.e. the onOff attribute of the OnOff cluster).
|
|
145
|
+
*/
|
|
74
146
|
async onConfigure() {
|
|
75
147
|
this.log.debug(`Configuring platform ${this.name}`);
|
|
148
|
+
// Save the selectDevice and selectEntity
|
|
76
149
|
await this.saveSelects();
|
|
150
|
+
// Check and update the endpoint numbers
|
|
77
151
|
await this.checkEndpointNumbers();
|
|
78
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* 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.
|
|
155
|
+
* It is called when the platform is shutting down.
|
|
156
|
+
* Use this method to clean up any resources you used in the constructor or onStart.
|
|
157
|
+
*
|
|
158
|
+
* @param {string} [reason] - The reason for shutting down.
|
|
159
|
+
*/
|
|
79
160
|
async onShutdown(reason) {
|
|
80
161
|
this.log.debug(`Shutting down platform ${this.name}`, reason);
|
|
162
|
+
// Save the selectDevice and selectEntity
|
|
81
163
|
await this.saveSelects();
|
|
164
|
+
// Check and update the endpoint numbers
|
|
82
165
|
await this.checkEndpointNumbers();
|
|
166
|
+
// Cleanup memory
|
|
83
167
|
this.selectDevice.clear();
|
|
84
168
|
this.selectEntity.clear();
|
|
85
169
|
this.registeredEndpointsByUniqueId.clear();
|
|
86
170
|
this.registeredEndpointsByName.clear();
|
|
171
|
+
// Close the storage
|
|
87
172
|
await this.context?.close();
|
|
88
173
|
this.context = undefined;
|
|
89
174
|
await this.storage?.close();
|
|
90
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Called when the logger level is changed.
|
|
178
|
+
*
|
|
179
|
+
* @param {LogLevel} logLevel The new logger level.
|
|
180
|
+
*/
|
|
91
181
|
async onChangeLoggerLevel(logLevel) {
|
|
92
182
|
this.log.debug(`The plugin doesn't override onChangeLoggerLevel. Logger level set to: ${logLevel}`);
|
|
93
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* Called when a plugin config includes an action button or an action button with text field.
|
|
186
|
+
*
|
|
187
|
+
* @param {string} action The action triggered by the button in plugin config.
|
|
188
|
+
* @param {string} value The value of the field of the action button.
|
|
189
|
+
* @param {string} id The id of the schema associated with the action.
|
|
190
|
+
* @param {PlatformConfig} formData The changed form data of the plugin.
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* This method can be overridden in the extended class.
|
|
194
|
+
*
|
|
195
|
+
* Use this method to handle the action defined in the plugin schema:
|
|
196
|
+
* ```json
|
|
197
|
+
* "addDevice": {
|
|
198
|
+
* "description": "Manually add a device that has not been discovered with mdns:",
|
|
199
|
+
* "type": "boolean",
|
|
200
|
+
* "buttonText": "ADD", // The text on the button. This is used when the action doesn't include a text field.
|
|
201
|
+
* "buttonField": "ADD", // The text on the button. This is used when the action includes a text field.
|
|
202
|
+
* "buttonClose": false, // optional, default is false. When true, the dialog will close after the action is sent.
|
|
203
|
+
* "buttonSave": false, // optional, default is false. When true, the dialog will close and trigger the restart required after the action is sent.
|
|
204
|
+
* "textPlaceholder": "Enter the device IP address", // optional: the placeholder text for the text field.
|
|
205
|
+
* "default": false
|
|
206
|
+
* },
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
94
209
|
async onAction(action, value, id, formData) {
|
|
95
210
|
this.log.debug(`The plugin ${CYAN}${this.name}${db} doesn't override onAction. Received action ${CYAN}${action}${db}${value ? ' with ' + CYAN + value + db : ''} ${id ? ' for schema ' + CYAN + id + db : ''}`, formData);
|
|
96
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Called when the plugin config has been updated.
|
|
214
|
+
*
|
|
215
|
+
* @param {PlatformConfig} config The new plugin config.
|
|
216
|
+
*/
|
|
97
217
|
async onConfigChanged(config) {
|
|
98
218
|
this.log.debug(`The plugin ${CYAN}${config.name}${db} doesn't override onConfigChanged. Received new config.`);
|
|
99
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Save the platform configuration to the platform config JSON.
|
|
222
|
+
*
|
|
223
|
+
* @param {PlatformConfig} [config] - The platform configuration to save.
|
|
224
|
+
* @returns {void}
|
|
225
|
+
*/
|
|
100
226
|
saveConfig(config) {
|
|
227
|
+
// TODO: replace with a message to the plugins thread
|
|
101
228
|
const plugin = this.matterbridge.plugins.get(this.name);
|
|
102
229
|
if (!plugin) {
|
|
103
230
|
throw new Error(`Plugin ${this.name} not found`);
|
|
104
231
|
}
|
|
105
|
-
this.matterbridge.plugins.saveConfigFromJson(plugin, config);
|
|
232
|
+
this.matterbridge.plugins.saveConfigFromJson(plugin, config); // No await as it's not necessary to wait
|
|
106
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Get the platform schema for the config editor. This will retrieve the schema from the Matterbridge plugin manager.
|
|
236
|
+
*
|
|
237
|
+
* @returns {PlatformSchema} The platform schema.
|
|
238
|
+
*/
|
|
107
239
|
getSchema() {
|
|
240
|
+
// TODO: replace with a message to the plugins thread
|
|
108
241
|
const plugin = this.matterbridge.plugins.get(this.name);
|
|
109
242
|
if (!plugin || !isValidObject(plugin.schemaJson)) {
|
|
110
243
|
throw new Error(`Plugin ${this.name} not found`);
|
|
111
244
|
}
|
|
112
245
|
return plugin.schemaJson;
|
|
113
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* 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.
|
|
249
|
+
*
|
|
250
|
+
* @param {PlatformSchema} [schema] - The platform schema to set.
|
|
251
|
+
* @returns {void}
|
|
252
|
+
*/
|
|
114
253
|
setSchema(schema) {
|
|
254
|
+
// TODO: replace with a message to the plugins thread
|
|
115
255
|
const plugin = this.matterbridge.plugins.get(this.name);
|
|
116
256
|
if (!plugin) {
|
|
117
257
|
throw new Error(`Plugin ${this.name} not found`);
|
|
118
258
|
}
|
|
119
259
|
plugin.schemaJson = schema;
|
|
120
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Sends a restart required message to the frontend.
|
|
263
|
+
*
|
|
264
|
+
* @param {boolean} [snackbar] - If true, shows a snackbar notification. Default is true.
|
|
265
|
+
* @param {boolean} [fixed] - If true, shows a fixed notification. Default is false.
|
|
266
|
+
* @returns {void}
|
|
267
|
+
*/
|
|
121
268
|
wssSendRestartRequired(snackbar = true, fixed = false) {
|
|
269
|
+
// TODO: replace with a message to the frontend thread
|
|
122
270
|
this.matterbridge.frontend.wssSendRestartRequired(snackbar, fixed);
|
|
123
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Retrieves the devices registered with the platform.
|
|
274
|
+
*
|
|
275
|
+
* @returns {MatterbridgeEndpoint[]} The registered devices.
|
|
276
|
+
*/
|
|
124
277
|
getDevices() {
|
|
125
278
|
return Array.from(this.registeredEndpointsByUniqueId.values());
|
|
126
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Checks if a device with this name is already registered in the platform.
|
|
282
|
+
*
|
|
283
|
+
* @param {string} deviceName - The device name to check.
|
|
284
|
+
* @returns {boolean} True if the device is already registered, false otherwise.
|
|
285
|
+
*/
|
|
127
286
|
hasDeviceName(deviceName) {
|
|
128
287
|
return this.registeredEndpointsByName.has(deviceName);
|
|
129
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Registers a virtual device with the platform aggregator endpoint.
|
|
291
|
+
*
|
|
292
|
+
* The virtual device is created as an instance of `Endpoint` with the provided device type.
|
|
293
|
+
* When the virtual device is turned on, the provided callback function is executed.
|
|
294
|
+
* The onOff state of the virtual device always reverts to false when the device is turned on.
|
|
295
|
+
*
|
|
296
|
+
* @param { string } name - The name of the virtual device.
|
|
297
|
+
* @param { 'light' | 'outlet' | 'switch' | 'mounted_switch' } type - The type of the virtual device.
|
|
298
|
+
* @param { () => Promise<void> } callback - The callback to call when the virtual device is turned on.
|
|
299
|
+
*
|
|
300
|
+
* @returns {Promise<boolean>} A promise that resolves to true if the virtual device was successfully registered, false otherwise.
|
|
301
|
+
*
|
|
302
|
+
* @remarks
|
|
303
|
+
* The virtual devices don't show up in the device list of the frontend.
|
|
304
|
+
*/
|
|
130
305
|
async registerVirtualDevice(name, type, callback) {
|
|
131
306
|
let aggregator;
|
|
307
|
+
// TODO: replace with a message to the matterbridge thread
|
|
132
308
|
if (this.matterbridge.bridgeMode === 'bridge') {
|
|
133
309
|
aggregator = this.matterbridge.aggregatorNode;
|
|
134
310
|
}
|
|
@@ -148,6 +324,25 @@ export class MatterbridgePlatform {
|
|
|
148
324
|
}
|
|
149
325
|
return false;
|
|
150
326
|
}
|
|
327
|
+
/**
|
|
328
|
+
* Registers a device with the Matterbridge platform and performs validation checks.
|
|
329
|
+
*
|
|
330
|
+
* This method also checks if the implementation called createDefaultBasicInformationClusterServer() instead of createDefaultBridgedDeviceBasicInformationClusterServer().
|
|
331
|
+
*
|
|
332
|
+
* This is correct with Accessory platforms so we check if we are running in bridge mode and add the bridgedNode and the BridgedDeviceBasicInformation cluster.
|
|
333
|
+
*
|
|
334
|
+
* If we are in bridge mode, we add the bridgedNode device type and the BridgedDeviceBasicInformation cluster.
|
|
335
|
+
*
|
|
336
|
+
* If we are in childbridge mode and the plugin is a 'DynamicPlatform', we add the bridgedNode device type and the BridgedDeviceBasicInformation cluster.
|
|
337
|
+
*
|
|
338
|
+
* if we are in childbridge mode and the plugin is a 'AccessoryPlatform', the device is not bridged so no action is taken.
|
|
339
|
+
*
|
|
340
|
+
* If the device.mode = 'server', the device is not bridged so no action is taken.
|
|
341
|
+
*
|
|
342
|
+
* If the device.mode = 'matter', the device is not bridged so no action is taken.
|
|
343
|
+
*
|
|
344
|
+
* @param {MatterbridgeEndpoint} device - The device to register.
|
|
345
|
+
*/
|
|
151
346
|
async registerDevice(device) {
|
|
152
347
|
device.plugin = this.name;
|
|
153
348
|
if (!device.uniqueId) {
|
|
@@ -169,7 +364,9 @@ export class MatterbridgePlatform {
|
|
|
169
364
|
if (checkNotLatinCharacters(device.deviceName)) {
|
|
170
365
|
this.log.debug(`Device with name ${CYAN}${device.deviceName}${db} has non latin characters.`);
|
|
171
366
|
}
|
|
367
|
+
// Validate bridgedNode and BridgedDeviceBasicInformation cluster
|
|
172
368
|
if (device.mode === undefined && (this.matterbridge.bridgeMode === 'bridge' || (this.matterbridge.bridgeMode === 'childbridge' && this.type === 'DynamicPlatform'))) {
|
|
369
|
+
// If the device is a bridged device, we add the bridgedNode to the deviceTypes map and to the Descriptor Cluster options
|
|
173
370
|
if (!device.deviceTypes.has(bridgedNode.code)) {
|
|
174
371
|
this.log.debug(`Device with name ${CYAN}${device.deviceName}${db} has no bridgedNode device type. Adding it...`);
|
|
175
372
|
device.deviceTypes.set(bridgedNode.code, bridgedNode);
|
|
@@ -181,27 +378,49 @@ export class MatterbridgePlatform {
|
|
|
181
378
|
}
|
|
182
379
|
}
|
|
183
380
|
}
|
|
381
|
+
// If the device is a bridged device, we add the BridgedDeviceBasicInformation cluster
|
|
184
382
|
if (!device.hasClusterServer(BridgedDeviceBasicInformation.Cluster.id)) {
|
|
185
383
|
this.log.debug(`Device with name ${CYAN}${device.deviceName}${db} has no BridgedDeviceBasicInformation cluster. Adding it...`);
|
|
186
384
|
device.createDefaultBridgedDeviceBasicInformationClusterServer(device.deviceName, device.serialNumber, device.vendorId, device.vendorName, device.productName, device.softwareVersion, device.softwareVersionString, device.hardwareVersion, device.hardwareVersionString);
|
|
187
385
|
}
|
|
188
386
|
}
|
|
387
|
+
// TODO: replace with a message to the matterbridge thread
|
|
189
388
|
await this.matterbridge.addBridgedEndpoint(this.name, device);
|
|
190
389
|
this.registeredEndpointsByUniqueId.set(device.uniqueId, device);
|
|
191
390
|
this.registeredEndpointsByName.set(device.deviceName, device);
|
|
192
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* Unregisters a device registered with the Matterbridge platform.
|
|
394
|
+
*
|
|
395
|
+
* @param {MatterbridgeEndpoint} device - The device to unregister.
|
|
396
|
+
*/
|
|
193
397
|
async unregisterDevice(device) {
|
|
398
|
+
// TODO: replace with a message to the matterbridge thread
|
|
194
399
|
await this.matterbridge.removeBridgedEndpoint(this.name, device);
|
|
195
400
|
if (device.uniqueId)
|
|
196
401
|
this.registeredEndpointsByUniqueId.delete(device.uniqueId);
|
|
197
402
|
if (device.deviceName)
|
|
198
403
|
this.registeredEndpointsByName.delete(device.deviceName);
|
|
199
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Unregisters all devices registered with the Matterbridge platform.
|
|
407
|
+
*
|
|
408
|
+
* @param {number} [delay] - The delay in milliseconds between removing each bridged endpoint (default: 0).
|
|
409
|
+
*/
|
|
200
410
|
async unregisterAllDevices(delay = 0) {
|
|
411
|
+
// TODO: replace with a message to the matterbridge thread
|
|
201
412
|
await this.matterbridge.removeAllBridgedEndpoints(this.name, delay);
|
|
202
413
|
this.registeredEndpointsByUniqueId.clear();
|
|
203
414
|
this.registeredEndpointsByName.clear();
|
|
204
415
|
}
|
|
416
|
+
/**
|
|
417
|
+
* Saves the select devices and entities to storage.
|
|
418
|
+
*
|
|
419
|
+
* This method saves the current state of `selectDevice` and `selectEntity` maps to their respective storage.
|
|
420
|
+
* It logs the number of items being saved and ensures that the storage is properly closed after saving.
|
|
421
|
+
*
|
|
422
|
+
* @returns {Promise<void>} A promise that resolves when the save operation is complete.
|
|
423
|
+
*/
|
|
205
424
|
async saveSelects() {
|
|
206
425
|
if (this.storage) {
|
|
207
426
|
this.log.debug(`Saving ${this.selectDevice.size} selectDevice...`);
|
|
@@ -214,19 +433,60 @@ export class MatterbridgePlatform {
|
|
|
214
433
|
await selectEntity.close();
|
|
215
434
|
}
|
|
216
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Clears all the select device and entity maps.
|
|
438
|
+
*
|
|
439
|
+
* @returns {void}
|
|
440
|
+
*/
|
|
217
441
|
async clearSelect() {
|
|
218
442
|
this.selectDevice.clear();
|
|
219
443
|
this.selectEntity.clear();
|
|
220
444
|
await this.saveSelects();
|
|
221
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
* Clears the select for a single device.
|
|
448
|
+
*
|
|
449
|
+
* @param {string} serial - The serial of the device to clear.
|
|
450
|
+
* @returns {void}
|
|
451
|
+
*/
|
|
222
452
|
async clearDeviceSelect(serial) {
|
|
223
453
|
this.selectDevice.delete(serial);
|
|
224
454
|
await this.saveSelects();
|
|
225
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* Clears the select for a single entity.
|
|
458
|
+
*
|
|
459
|
+
* @param {string} name - The name of the entity to clear.
|
|
460
|
+
* @returns {void}
|
|
461
|
+
*/
|
|
226
462
|
async clearEntitySelect(name) {
|
|
227
463
|
this.selectEntity.delete(name);
|
|
228
464
|
await this.saveSelects();
|
|
229
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* Set the select device in the platform map.
|
|
468
|
+
*
|
|
469
|
+
* @param {string} serial - The serial number of the device.
|
|
470
|
+
* @param {string} name - The name of the device.
|
|
471
|
+
* @param {string} [configUrl] - The configuration URL of the device.
|
|
472
|
+
* @param {string} [icon] - The icon of the device: 'wifi', 'ble', 'hub'
|
|
473
|
+
* @param {Array<{ name: string; description: string; icon?: string }>} [entities] - The entities associated with the device.
|
|
474
|
+
* @returns {void}
|
|
475
|
+
*
|
|
476
|
+
* @remarks
|
|
477
|
+
* In the schema use selectFrom: 'serial' or 'name'
|
|
478
|
+
* ```json
|
|
479
|
+
* "whiteList": {
|
|
480
|
+
* "description": "Only the devices in the list will be exposed.",
|
|
481
|
+
* "type": "array",
|
|
482
|
+
* "items": {
|
|
483
|
+
* "type": "string"
|
|
484
|
+
* },
|
|
485
|
+
* "uniqueItems": true,
|
|
486
|
+
* "selectFrom": "name"
|
|
487
|
+
* },
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
230
490
|
setSelectDevice(serial, name, configUrl, icon, entities) {
|
|
231
491
|
const device = this.selectDevice.get(serial);
|
|
232
492
|
if (device) {
|
|
@@ -243,6 +503,35 @@ export class MatterbridgePlatform {
|
|
|
243
503
|
this.selectDevice.set(serial, { serial, name, configUrl, icon, entities });
|
|
244
504
|
}
|
|
245
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
* Set the select device entity in the platform map.
|
|
508
|
+
*
|
|
509
|
+
* @param {string} serial - The serial number of the device.
|
|
510
|
+
* @param {string} entityName - The name of the entity.
|
|
511
|
+
* @param {string} entityDescription - The description of the entity.
|
|
512
|
+
* @param {string} [entityIcon] - The icon of the entity: 'wifi', 'ble', 'hub', 'component', 'matter'
|
|
513
|
+
* @returns {void}
|
|
514
|
+
*
|
|
515
|
+
* @remarks
|
|
516
|
+
* In the schema use selectDeviceEntityFrom: 'name' or 'description'
|
|
517
|
+
* ```json
|
|
518
|
+
* "deviceEntityBlackList": {
|
|
519
|
+
* "description": "List of entities not to be exposed for a single device.",
|
|
520
|
+
* "type": "object",
|
|
521
|
+
* "uniqueItems": true,
|
|
522
|
+
* "selectFrom": "name",
|
|
523
|
+
* "additionalProperties": {
|
|
524
|
+
* "description": "List of entities not to be exposed for this device.",
|
|
525
|
+
* "type": "array",
|
|
526
|
+
* "items": {
|
|
527
|
+
* "type": "string"
|
|
528
|
+
* },
|
|
529
|
+
* "uniqueItems": true,
|
|
530
|
+
* "selectDeviceEntityFrom": "name"
|
|
531
|
+
* }
|
|
532
|
+
* },
|
|
533
|
+
* ```
|
|
534
|
+
*/
|
|
246
535
|
setSelectDeviceEntity(serial, entityName, entityDescription, entityIcon) {
|
|
247
536
|
const device = this.selectDevice.get(serial);
|
|
248
537
|
if (device) {
|
|
@@ -252,6 +541,11 @@ export class MatterbridgePlatform {
|
|
|
252
541
|
device.entities.push({ name: entityName, description: entityDescription, icon: entityIcon });
|
|
253
542
|
}
|
|
254
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* Retrieves the select devices from the platform map.
|
|
546
|
+
*
|
|
547
|
+
* @returns {ApiSelectDevice[]} The selected devices array.
|
|
548
|
+
*/
|
|
255
549
|
getSelectDevices() {
|
|
256
550
|
const selectDevices = [];
|
|
257
551
|
for (const device of this.selectDevice.values()) {
|
|
@@ -259,9 +553,36 @@ export class MatterbridgePlatform {
|
|
|
259
553
|
}
|
|
260
554
|
return selectDevices;
|
|
261
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* Set the select entity in the platform map.
|
|
558
|
+
*
|
|
559
|
+
* @param {string} name - The entity name.
|
|
560
|
+
* @param {string} description - The entity description.
|
|
561
|
+
* @param {string} [icon] - The entity icon: 'wifi', 'ble', 'hub', 'component', 'matter'
|
|
562
|
+
* @returns {void}
|
|
563
|
+
*
|
|
564
|
+
* @remarks
|
|
565
|
+
* In the schema use selectEntityFrom: 'name' or 'description'
|
|
566
|
+
* ```json
|
|
567
|
+
* "entityBlackList": {
|
|
568
|
+
* "description": "The entities in the list will not be exposed.",
|
|
569
|
+
* "type": "array",
|
|
570
|
+
* "items": {
|
|
571
|
+
* "type": "string"
|
|
572
|
+
* },
|
|
573
|
+
* "uniqueItems": true,
|
|
574
|
+
* "selectEntityFrom": "name"
|
|
575
|
+
* },
|
|
576
|
+
* ```
|
|
577
|
+
*/
|
|
262
578
|
setSelectEntity(name, description, icon) {
|
|
263
579
|
this.selectEntity.set(name, { name, description, icon });
|
|
264
580
|
}
|
|
581
|
+
/**
|
|
582
|
+
* Retrieve the select entities.
|
|
583
|
+
*
|
|
584
|
+
* @returns {ApiSelectEntity[]} The select entities array.
|
|
585
|
+
*/
|
|
265
586
|
getSelectEntities() {
|
|
266
587
|
const selectEntities = [];
|
|
267
588
|
for (const entity of this.selectEntity.values()) {
|
|
@@ -269,6 +590,12 @@ export class MatterbridgePlatform {
|
|
|
269
590
|
}
|
|
270
591
|
return selectEntities;
|
|
271
592
|
}
|
|
593
|
+
/**
|
|
594
|
+
* Verifies if the Matterbridge version meets the required version.
|
|
595
|
+
*
|
|
596
|
+
* @param {string} requiredVersion - The required version to compare against.
|
|
597
|
+
* @returns {boolean} True if the Matterbridge version meets or exceeds the required version, false otherwise.
|
|
598
|
+
*/
|
|
272
599
|
verifyMatterbridgeVersion(requiredVersion) {
|
|
273
600
|
const compareVersions = (matterbridgeVersion, requiredVersion) => {
|
|
274
601
|
const stripTag = (v) => {
|
|
@@ -293,6 +620,14 @@ export class MatterbridgePlatform {
|
|
|
293
620
|
return false;
|
|
294
621
|
return true;
|
|
295
622
|
}
|
|
623
|
+
/**
|
|
624
|
+
* Validates if a device is allowed based on the whitelist and blacklist configurations.
|
|
625
|
+
* The blacklist has priority over the whitelist.
|
|
626
|
+
*
|
|
627
|
+
* @param {string | string[]} device - The device name(s) to validate.
|
|
628
|
+
* @param {boolean} [log] - Whether to log the validation result.
|
|
629
|
+
* @returns {boolean} - Returns true if the device is allowed, false otherwise.
|
|
630
|
+
*/
|
|
296
631
|
validateDevice(device, log = true) {
|
|
297
632
|
if (!Array.isArray(device))
|
|
298
633
|
device = [device];
|
|
@@ -322,6 +657,14 @@ export class MatterbridgePlatform {
|
|
|
322
657
|
this.log.info(`Skipping device ${CYAN}${device.join(', ')}${nf} because not in whitelist`);
|
|
323
658
|
return false;
|
|
324
659
|
}
|
|
660
|
+
/**
|
|
661
|
+
* Validates if an entity is allowed based on the entity blacklist and device-entity blacklist configurations.
|
|
662
|
+
*
|
|
663
|
+
* @param {string} device - The device to which the entity belongs.
|
|
664
|
+
* @param {string} entity - The entity to validate.
|
|
665
|
+
* @param {boolean} [log] - Whether to log the validation result.
|
|
666
|
+
* @returns {boolean} - Returns true if the entity is allowed, false otherwise.
|
|
667
|
+
*/
|
|
325
668
|
validateEntity(device, entity, log = true) {
|
|
326
669
|
if (isValidArray(this.config.entityBlackList, 1) && this.config.entityBlackList.find((e) => e === entity)) {
|
|
327
670
|
if (log)
|
|
@@ -340,6 +683,15 @@ export class MatterbridgePlatform {
|
|
|
340
683
|
}
|
|
341
684
|
return true;
|
|
342
685
|
}
|
|
686
|
+
/**
|
|
687
|
+
* Checks and updates the endpoint numbers for Matterbridge devices.
|
|
688
|
+
*
|
|
689
|
+
* This method retrieves the list of Matterbridge devices and their child endpoints,
|
|
690
|
+
* compares their current endpoint numbers with the stored ones, and updates the storage
|
|
691
|
+
* if there are any changes. It logs the changes and updates the endpoint numbers accordingly.
|
|
692
|
+
*
|
|
693
|
+
* @returns {Promise<number>} The size of the updated endpoint map, or -1 if storage is not available.
|
|
694
|
+
*/
|
|
343
695
|
async checkEndpointNumbers() {
|
|
344
696
|
if (!this.storage)
|
|
345
697
|
return -1;
|
|
@@ -380,3 +732,4 @@ export class MatterbridgePlatform {
|
|
|
380
732
|
return endpointMap.size;
|
|
381
733
|
}
|
|
382
734
|
}
|
|
735
|
+
//# sourceMappingURL=matterbridgePlatform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matterbridgePlatform.js","sourceRoot":"","sources":["../src/matterbridgePlatform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,sCAAsC;AACtC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IAAE,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;AAE7I,kBAAkB;AAClB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,yBAAyB;AACzB,OAAO,EAAc,IAAI,EAAE,EAAE,EAAE,EAAE,EAAY,EAAE,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC9E,sBAAsB;AACtB,OAAO,EAAe,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAIvE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,yDAAyD,CAAC;AAOxG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA8ChD;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAC/B,kDAAkD;IAClD,YAAY,CAAuB;IACnC,6CAA6C;IAC7C,GAAG,CAAa;IAChB,2CAA2C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