matterbridge 1.6.5-dev.2 → 1.6.5-dev.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/CHANGELOG.md +1 -0
- package/dist/cli.js +0 -26
- package/dist/cluster/export.js +0 -2
- package/dist/defaultConfigSchema.js +0 -23
- package/dist/deviceManager.js +1 -26
- package/dist/index.js +0 -30
- package/dist/logger/export.js +0 -1
- package/dist/matter/export.js +0 -1
- package/dist/matterbridge.js +62 -702
- package/dist/matterbridgeAccessoryPlatform.js +0 -33
- package/dist/matterbridgeBehaviors.js +1 -29
- package/dist/matterbridgeDevice.js +117 -884
- package/dist/matterbridgeDeviceTypes.js +12 -40
- package/dist/matterbridgeDynamicPlatform.js +0 -33
- package/dist/matterbridgeEdge.js +0 -525
- package/dist/matterbridgeEndpoint.js +100 -943
- package/dist/matterbridgePlatform.js +3 -74
- package/dist/matterbridgeTypes.js +0 -24
- package/dist/matterbridgeWebsocket.js +0 -45
- package/dist/pluginManager.js +3 -231
- package/dist/storage/export.js +0 -1
- package/dist/utils/colorUtils.js +2 -78
- package/dist/utils/export.js +0 -1
- package/dist/utils/utils.js +7 -252
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.a14c87e7.js → main.0ab89802.js} +3 -3
- package/frontend/build/static/js/{main.a14c87e7.js.map → main.0ab89802.js.map} +1 -1
- package/npm-shrinkwrap.json +5 -5
- package/package.json +4 -4
- package/tsconfig.production.json +19 -0
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cluster/export.d.ts.map +0 -1
- package/dist/cluster/export.js.map +0 -1
- package/dist/defaultConfigSchema.d.ts.map +0 -1
- package/dist/defaultConfigSchema.js.map +0 -1
- package/dist/deviceManager.d.ts +0 -46
- package/dist/deviceManager.d.ts.map +0 -1
- package/dist/deviceManager.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logger/export.d.ts.map +0 -1
- package/dist/logger/export.js.map +0 -1
- package/dist/matter/export.d.ts.map +0 -1
- package/dist/matter/export.js.map +0 -1
- package/dist/matterbridge.d.ts +0 -466
- 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 +0 -934
- package/dist/matterbridgeBehaviors.d.ts.map +0 -1
- package/dist/matterbridgeBehaviors.js.map +0 -1
- package/dist/matterbridgeDevice.d.ts +0 -5307
- package/dist/matterbridgeDevice.d.ts.map +0 -1
- package/dist/matterbridgeDevice.js.map +0 -1
- package/dist/matterbridgeDeviceTypes.d.ts +0 -65
- 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/matterbridgeEdge.d.ts +0 -89
- package/dist/matterbridgeEdge.d.ts.map +0 -1
- package/dist/matterbridgeEdge.js.map +0 -1
- package/dist/matterbridgeEndpoint.d.ts +0 -7368
- package/dist/matterbridgeEndpoint.d.ts.map +0 -1
- package/dist/matterbridgeEndpoint.js.map +0 -1
- package/dist/matterbridgePlatform.d.ts +0 -96
- 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/matterbridgeWebsocket.d.ts.map +0 -1
- package/dist/matterbridgeWebsocket.js.map +0 -1
- package/dist/pluginManager.d.ts +0 -238
- package/dist/pluginManager.d.ts.map +0 -1
- package/dist/pluginManager.js.map +0 -1
- package/dist/storage/export.d.ts.map +0 -1
- package/dist/storage/export.js.map +0 -1
- package/dist/utils/colorUtils.d.ts.map +0 -1
- package/dist/utils/colorUtils.js.map +0 -1
- package/dist/utils/export.d.ts.map +0 -1
- package/dist/utils/export.js.map +0 -1
- package/dist/utils/utils.d.ts +0 -221
- package/dist/utils/utils.d.ts.map +0 -1
- package/dist/utils/utils.js.map +0 -1
- /package/frontend/build/static/js/{main.a14c87e7.js.LICENSE.txt → main.0ab89802.js.LICENSE.txt} +0 -0
|
@@ -1,35 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class MatterbridgeEndpoint that extends the Endpoint class from the Matter.js library.
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgeEndpoint.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2024-10-01
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2024, 2025, 2026 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 @typescript-eslint/no-unused-vars */
|
|
24
|
-
// Node.js modules
|
|
25
1
|
import { createHash } from 'crypto';
|
|
26
|
-
// AnsiLogger module
|
|
27
2
|
import { AnsiLogger, BLUE, CYAN, YELLOW, db, debugStringify, er, hk, or, rs, zb } from 'node-ansi-logger';
|
|
28
|
-
// Matterbridge
|
|
29
3
|
import { MatterbridgeBehavior, MatterbridgeBehaviorDevice, MatterbridgeBooleanStateConfigurationServer, MatterbridgeColorControlServer, MatterbridgeDoorLockServer, MatterbridgeFanControlServer, MatterbridgeIdentifyServer, MatterbridgeLevelControlServer, MatterbridgeOnOffServer, MatterbridgeThermostatServer, MatterbridgeWindowCoveringServer, } from './matterbridgeBehaviors.js';
|
|
30
4
|
import { bridgedNode } from './matterbridgeDeviceTypes.js';
|
|
31
5
|
import { deepCopy, isValidNumber } from './utils/utils.js';
|
|
32
|
-
// @matter
|
|
33
6
|
import { Endpoint, MutableEndpoint, SupportedBehaviors, NamedHandler, Lifecycle } from '@matter/main';
|
|
34
7
|
import { EndpointNumber, VendorId } from '@matter/main';
|
|
35
8
|
import { AirQuality, AirQualityCluster, BasicInformation, BasicInformationCluster, BooleanState, BooleanStateCluster, BooleanStateConfiguration, BooleanStateConfigurationCluster, BridgedDeviceBasicInformation, BridgedDeviceBasicInformationCluster, CarbonDioxideConcentrationMeasurement, CarbonDioxideConcentrationMeasurementCluster, CarbonMonoxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurementCluster, ColorControl, ColorControlCluster, ConcentrationMeasurement, Descriptor, DoorLock, DoorLockCluster, ElectricalEnergyMeasurement, ElectricalEnergyMeasurementCluster, ElectricalPowerMeasurement, ElectricalPowerMeasurementCluster, FanControl, FanControlCluster, FixedLabel, FixedLabelCluster, FlowMeasurement, FlowMeasurementCluster, FormaldehydeConcentrationMeasurement, FormaldehydeConcentrationMeasurementCluster, Groups, GroupsCluster, Identify, IdentifyCluster, IlluminanceMeasurement, IlluminanceMeasurementCluster, LevelControl, LevelControlCluster, ModeSelect, ModeSelectCluster, NitrogenDioxideConcentrationMeasurement, NitrogenDioxideConcentrationMeasurementCluster, OccupancySensing, OccupancySensingCluster, OnOff, OnOffCluster, OzoneConcentrationMeasurement, OzoneConcentrationMeasurementCluster, Pm10ConcentrationMeasurement, Pm10ConcentrationMeasurementCluster, Pm1ConcentrationMeasurement, Pm1ConcentrationMeasurementCluster, Pm25ConcentrationMeasurement, Pm25ConcentrationMeasurementCluster, PowerSource, PowerSourceCluster, PowerSourceConfigurationCluster, PowerTopology, PowerTopologyCluster, PressureMeasurement, PressureMeasurementCluster, RadonConcentrationMeasurement, RadonConcentrationMeasurementCluster, RelativeHumidityMeasurement, RelativeHumidityMeasurementCluster, SmokeCoAlarm, SmokeCoAlarmCluster, Switch, SwitchCluster, TemperatureMeasurement, TemperatureMeasurementCluster, Thermostat, ThermostatCluster, TotalVolatileOrganicCompoundsConcentrationMeasurement, TotalVolatileOrganicCompoundsConcentrationMeasurementCluster, UserLabel, UserLabelCluster, WindowCovering, WindowCoveringCluster, } from '@matter/main/clusters';
|
|
@@ -50,7 +23,7 @@ import { AirQualityServer, BasicInformationServer, CarbonDioxideConcentrationMea
|
|
|
50
23
|
import { ClusterServer, GroupsClusterHandler } from '@project-chip/matter.js/cluster';
|
|
51
24
|
export class MatterbridgeEndpoint extends Endpoint {
|
|
52
25
|
static bridgeMode = '';
|
|
53
|
-
static logLevel = "info"
|
|
26
|
+
static logLevel = "info";
|
|
54
27
|
log;
|
|
55
28
|
plugin = undefined;
|
|
56
29
|
deviceName = undefined;
|
|
@@ -68,20 +41,12 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
68
41
|
deviceType;
|
|
69
42
|
uniqueStorageKey = undefined;
|
|
70
43
|
tagList = undefined;
|
|
71
|
-
// Maps matter deviceTypes and endpoints
|
|
72
44
|
deviceTypes = new Map();
|
|
73
45
|
clusterServers = new Map();
|
|
74
46
|
clusterClients = new Map();
|
|
75
47
|
commandHandler = new NamedHandler();
|
|
76
|
-
/**
|
|
77
|
-
* Represents a MatterbridgeEndpoint.
|
|
78
|
-
* @constructor
|
|
79
|
-
* @param {DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>} definition - The DeviceTypeDefinition(s) of the endpoint.
|
|
80
|
-
* @param {MatterbridgeEndpointOptions} [options={}] - The options for the device.
|
|
81
|
-
*/
|
|
82
48
|
constructor(definition, options = {}, debug = false) {
|
|
83
49
|
let deviceTypeList = [];
|
|
84
|
-
// Get the first DeviceTypeDefinition
|
|
85
50
|
let firstDefinition;
|
|
86
51
|
if (Array.isArray(definition)) {
|
|
87
52
|
firstDefinition = definition[0];
|
|
@@ -94,7 +59,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
94
59
|
firstDefinition = definition;
|
|
95
60
|
deviceTypeList = [{ deviceType: firstDefinition.code, revision: firstDefinition.revision }];
|
|
96
61
|
}
|
|
97
|
-
// Convert the first DeviceTypeDefinition to an EndpointType.Options
|
|
98
62
|
const deviceTypeDefinitionV8 = {
|
|
99
63
|
name: firstDefinition.name.replace('-', '_'),
|
|
100
64
|
deviceType: firstDefinition.code,
|
|
@@ -113,7 +77,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
113
77
|
behaviors: options.tagList ? SupportedBehaviors(DescriptorServer.with(Descriptor.Feature.TagList)) : {},
|
|
114
78
|
};
|
|
115
79
|
const endpointV8 = MutableEndpoint(deviceTypeDefinitionV8);
|
|
116
|
-
// Convert the options to an Endpoint.Options
|
|
117
80
|
const optionsV8 = {
|
|
118
81
|
id: options.uniqueStorageKey?.replace(/[ .]/g, ''),
|
|
119
82
|
number: options.endpointId,
|
|
@@ -131,27 +94,15 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
131
94
|
}
|
|
132
95
|
else
|
|
133
96
|
this.deviceTypes.set(firstDefinition.code, firstDefinition);
|
|
134
|
-
|
|
135
|
-
// console.log('MatterbridgeEndpoint.endpointV8', endpointV8);
|
|
136
|
-
// console.log('MatterbridgeEndpoint.optionsV8', optionsV8);
|
|
137
|
-
// Create the logger
|
|
138
|
-
this.log = new AnsiLogger({ logName: 'MatterbridgeEndpoint', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: debug === true ? "debug" /* LogLevel.DEBUG */ : MatterbridgeEndpoint.logLevel });
|
|
97
|
+
this.log = new AnsiLogger({ logName: 'MatterbridgeEndpoint', logTimestampFormat: 4, logLevel: debug === true ? "debug" : MatterbridgeEndpoint.logLevel });
|
|
139
98
|
this.log.debug(`${YELLOW}new${db} MatterbridgeEndpoint: ${zb}${'0x' + firstDefinition.code.toString(16).padStart(4, '0')}${db}-${zb}${firstDefinition.name}${db} ` +
|
|
140
99
|
`id: ${CYAN}${options.uniqueStorageKey}${db} number: ${CYAN}${options.endpointId}${db} taglist: ${CYAN}${options.tagList ? debugStringify(options.tagList) : 'undefined'}${db}`);
|
|
141
|
-
// Add MatterbridgeBehavior with MatterbridgeBehaviorDevice
|
|
142
100
|
this.behaviors.require(MatterbridgeBehavior, { deviceCommand: new MatterbridgeBehaviorDevice(this.log, this.commandHandler, undefined) });
|
|
143
101
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Loads an instance of the MatterbridgeDevice class.
|
|
146
|
-
*
|
|
147
|
-
* @param {DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>} definition - The DeviceTypeDefinition(s) of the device.
|
|
148
|
-
* @returns MatterbridgeDevice instance.
|
|
149
|
-
*/
|
|
150
102
|
static async loadInstance(definition, options = {}, debug = false) {
|
|
151
103
|
return new MatterbridgeEndpoint(definition, options, debug);
|
|
152
104
|
}
|
|
153
105
|
static getBehaviourTypesFromClusterServerIds(clusterServerList) {
|
|
154
|
-
// Map Server ClusterId to Behavior.Type
|
|
155
106
|
const behaviorTypes = [];
|
|
156
107
|
clusterServerList.forEach((clusterId) => {
|
|
157
108
|
behaviorTypes.push(MatterbridgeEndpoint.getBehaviourTypeFromClusterServerId(clusterId));
|
|
@@ -159,15 +110,12 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
159
110
|
return behaviorTypes;
|
|
160
111
|
}
|
|
161
112
|
static getBehaviourTypesFromClusterClientIds(clusterClientList) {
|
|
162
|
-
// Map Client ClusterId to Behavior.Type
|
|
163
113
|
const behaviorTypes = [];
|
|
164
114
|
clusterClientList.forEach((clusterId) => {
|
|
165
|
-
// behaviorTypes.push(MatterbridgeEndpoint.getBehaviourTypeFromClusterClientId(clusterId));
|
|
166
115
|
});
|
|
167
116
|
return behaviorTypes;
|
|
168
117
|
}
|
|
169
118
|
static getBehaviourTypeFromClusterServerId(clusterId, type) {
|
|
170
|
-
// Map ClusterId to Behavior.Type
|
|
171
119
|
if (clusterId === Identify.Cluster.id)
|
|
172
120
|
return MatterbridgeIdentifyServer;
|
|
173
121
|
if (clusterId === Groups.Cluster.id)
|
|
@@ -259,21 +207,12 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
259
207
|
return MatterbridgeIdentifyServer;
|
|
260
208
|
}
|
|
261
209
|
static getBehaviourTypeFromClusterClientId(clusterId) {
|
|
262
|
-
// Map ClusterId to Behavior.Type
|
|
263
210
|
return IdentifyBehavior;
|
|
264
211
|
}
|
|
265
|
-
/**
|
|
266
|
-
* Adds a device type to the list of device types.
|
|
267
|
-
* If the device type is not already present in the list, it will be added.
|
|
268
|
-
*
|
|
269
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
270
|
-
*/
|
|
271
212
|
addDeviceType(deviceType) {
|
|
272
213
|
if (!this.deviceTypes.has(deviceType.code)) {
|
|
273
|
-
// Keep the Matterbridge internal map
|
|
274
214
|
this.log.debug(`addDeviceType: ${zb}${'0x' + deviceType.code.toString(16).padStart(4, '0')}${db}-${zb}${deviceType.name}${db}`);
|
|
275
215
|
this.deviceTypes.set(deviceType.code, deviceType);
|
|
276
|
-
// Add the device types to the descriptor server
|
|
277
216
|
const deviceTypeList = Array.from(this.deviceTypes.values()).map((dt) => ({
|
|
278
217
|
deviceType: dt.code,
|
|
279
218
|
revision: dt.revision,
|
|
@@ -291,12 +230,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
291
230
|
}
|
|
292
231
|
}
|
|
293
232
|
}
|
|
294
|
-
/**
|
|
295
|
-
* Adds one or more device types with the required cluster servers and the specified cluster servers.
|
|
296
|
-
*
|
|
297
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
298
|
-
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
299
|
-
*/
|
|
300
233
|
addDeviceTypeWithClusterServer(deviceTypes, includeServerList) {
|
|
301
234
|
this.log.debug('addDeviceTypeWithClusterServer:');
|
|
302
235
|
deviceTypes.forEach((deviceType) => {
|
|
@@ -319,12 +252,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
319
252
|
});
|
|
320
253
|
this.addClusterServerFromList(this, includeServerList);
|
|
321
254
|
}
|
|
322
|
-
/**
|
|
323
|
-
* Adds the required cluster servers (only if they are not present) for the device types of the specified endpoint.
|
|
324
|
-
*
|
|
325
|
-
* @param {MatterbridgeEndpoint} endpoint - The endpoint to add the required cluster servers to.
|
|
326
|
-
* @returns {MatterbridgeEndpoint} The updated endpoint with the required cluster servers added.
|
|
327
|
-
*/
|
|
328
255
|
addRequiredClusterServers(endpoint) {
|
|
329
256
|
const requiredServerList = [];
|
|
330
257
|
this.log.debug(`addRequiredClusterServer for ${CYAN}${endpoint.id}${db}`);
|
|
@@ -341,12 +268,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
341
268
|
this.addClusterServerFromList(endpoint, requiredServerList);
|
|
342
269
|
return endpoint;
|
|
343
270
|
}
|
|
344
|
-
/**
|
|
345
|
-
* Adds the optional cluster servers (only if they are not present) for the device types of the specified endpoint.
|
|
346
|
-
*
|
|
347
|
-
* @param {MatterbridgeEndpoint} endpoint - The endpoint to add the required cluster servers to.
|
|
348
|
-
* @returns {MatterbridgeEndpoint} The updated endpoint with the required cluster servers added.
|
|
349
|
-
*/
|
|
350
271
|
addOptionalClusterServers(endpoint) {
|
|
351
272
|
const optionalServerList = [];
|
|
352
273
|
this.log.debug(`addRequiredClusterServer for ${CYAN}${endpoint.id}${db}`);
|
|
@@ -363,17 +284,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
363
284
|
this.addClusterServerFromList(endpoint, optionalServerList);
|
|
364
285
|
return endpoint;
|
|
365
286
|
}
|
|
366
|
-
/**
|
|
367
|
-
* Adds a child endpoint with the specified device types and options.
|
|
368
|
-
* If the child endpoint is not already present, it will be created and added.
|
|
369
|
-
* If the child endpoint is already present, the device types will be added to the existing child endpoint.
|
|
370
|
-
*
|
|
371
|
-
* @param {string} endpointName - The name of the new endpoint to add.
|
|
372
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
373
|
-
* @param {MatterbridgeEndpointOptions} [options={}] - The options for the endpoint.
|
|
374
|
-
* @param {boolean} [debug=false] - Whether to enable debug logging.
|
|
375
|
-
* @returns {MatterbridgeEndpoint} - The child endpoint that was found or added.
|
|
376
|
-
*/
|
|
377
287
|
addChildDeviceType(endpointName, deviceTypes, options = {}, debug = false) {
|
|
378
288
|
this.log.debug(`addChildDeviceType: ${CYAN}${endpointName}${db}`);
|
|
379
289
|
let child = this.getChildEndpointByName(endpointName);
|
|
@@ -404,18 +314,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
404
314
|
}
|
|
405
315
|
return child;
|
|
406
316
|
}
|
|
407
|
-
/**
|
|
408
|
-
* Adds a child endpoint with one or more device types with the required cluster servers and the specified cluster servers.
|
|
409
|
-
* If the child endpoint is not already present in the childEndpoints, it will be added.
|
|
410
|
-
* If the child endpoint is already present in the childEndpoints, the device types and cluster servers will be added to the existing child endpoint.
|
|
411
|
-
*
|
|
412
|
-
* @param {string} endpointName - The name of the new enpoint to add.
|
|
413
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
414
|
-
* @param {ClusterId[]} [includeServerList=[]] - The list of cluster IDs to include.
|
|
415
|
-
* @param {MatterbridgeEndpointOptions} [options={}] - The options for the device.
|
|
416
|
-
* @param {boolean} [debug=false] - Whether to enable debug logging.
|
|
417
|
-
* @returns {MatterbridgeEndpoint} - The child endpoint that was found or added.
|
|
418
|
-
*/
|
|
419
317
|
addChildDeviceTypeWithClusterServer(endpointName, deviceTypes, includeServerList = [], options = {}, debug = false) {
|
|
420
318
|
this.log.debug(`addChildDeviceTypeWithClusterServer: ${CYAN}${endpointName}${db}`);
|
|
421
319
|
let child = this.getChildEndpointByName(endpointName);
|
|
@@ -459,12 +357,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
459
357
|
}
|
|
460
358
|
return child;
|
|
461
359
|
}
|
|
462
|
-
/**
|
|
463
|
-
* Retrieves a child endpoint by its name.
|
|
464
|
-
*
|
|
465
|
-
* @param {string} endpointName - The name of the endpoint to retrieve.
|
|
466
|
-
* @returns {Endpoint | undefined} The child endpoint with the specified name, or undefined if not found.
|
|
467
|
-
*/
|
|
468
360
|
getChildEndpointByName(endpointName) {
|
|
469
361
|
return this.parts.find((part) => part.id === endpointName);
|
|
470
362
|
}
|
|
@@ -483,8 +375,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
483
375
|
});
|
|
484
376
|
}
|
|
485
377
|
async setBridgedDeviceReachability(reachable) {
|
|
486
|
-
// await this.setAttribute(BridgedDeviceBasicInformationCluster.id, 'reachable', reachable, this.log);
|
|
487
|
-
// await this.triggerEvent(BridgedDeviceBasicInformationCluster.id, 'reachableChanged', { reachableNewValue: reachable }, this.log);
|
|
488
378
|
}
|
|
489
379
|
hasClusterServer(cluster) {
|
|
490
380
|
return this.clusterServers.has(cluster.id);
|
|
@@ -502,16 +392,11 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
502
392
|
return this.clusterServers.get(clusterId);
|
|
503
393
|
}
|
|
504
394
|
addTagList(endpoint, mfgCode, namespaceId, tag, label) {
|
|
505
|
-
// Do nothing here only for old api compatibility
|
|
506
395
|
}
|
|
507
396
|
addClusterServer(cluster) {
|
|
508
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
509
397
|
const options = {};
|
|
510
398
|
for (const attribute of Object.values(cluster.attributes)) {
|
|
511
|
-
// console.error('Attribute:', (attribute as any).id, (attribute as any).name, (attribute as any).value);
|
|
512
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
513
399
|
if (attribute.id < 0xfff0) {
|
|
514
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
515
400
|
options[attribute.name] = attribute.value;
|
|
516
401
|
}
|
|
517
402
|
}
|
|
@@ -538,25 +423,18 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
538
423
|
type = 'AutoModeThermostat';
|
|
539
424
|
const behavior = MatterbridgeEndpoint.getBehaviourTypeFromClusterServerId(cluster.id, type);
|
|
540
425
|
if (cluster.id === PowerTopologyCluster.id && this.clusterServers.has(cluster.id))
|
|
541
|
-
return;
|
|
426
|
+
return;
|
|
542
427
|
if (cluster.id === ElectricalPowerMeasurementCluster.id && this.clusterServers.has(cluster.id))
|
|
543
|
-
return;
|
|
428
|
+
return;
|
|
544
429
|
if (cluster.id === ElectricalEnergyMeasurementCluster.id && this.clusterServers.has(cluster.id))
|
|
545
|
-
return;
|
|
430
|
+
return;
|
|
546
431
|
if (cluster.id === ThermostatCluster.id && this.clusterServers.has(cluster.id))
|
|
547
|
-
return;
|
|
432
|
+
return;
|
|
548
433
|
this.clusterServers.set(cluster.id, cluster);
|
|
549
434
|
if (cluster.id === BasicInformationCluster.id)
|
|
550
|
-
return;
|
|
435
|
+
return;
|
|
551
436
|
this.behaviors.require(behavior, options);
|
|
552
437
|
}
|
|
553
|
-
/**
|
|
554
|
-
* Adds cluster servers to the specified endpoint based on the provided server list.
|
|
555
|
-
*
|
|
556
|
-
* @param {Endpoint} endpoint - The endpoint to add cluster servers to.
|
|
557
|
-
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
558
|
-
* @returns void
|
|
559
|
-
*/
|
|
560
438
|
addClusterServerFromList(endpoint, includeServerList) {
|
|
561
439
|
if (includeServerList.includes(Identify.Cluster.id))
|
|
562
440
|
endpoint.addClusterServer(this.getDefaultIdentifyClusterServer());
|
|
@@ -626,8 +504,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
626
504
|
endpoint.addClusterServer(this.getDefaultRadonConcentrationMeasurementClusterServer());
|
|
627
505
|
if (includeServerList.includes(TotalVolatileOrganicCompoundsConcentrationMeasurement.Cluster.id))
|
|
628
506
|
endpoint.addClusterServer(this.getDefaultTvocMeasurementClusterServer());
|
|
629
|
-
// if (includeServerList.includes(DeviceEnergyManagement.Cluster.id)) endpoint.addClusterServer(this.getDefaultDeviceEnergyManagementClusterServer());
|
|
630
|
-
// if (includeServerList.includes(DeviceEnergyManagementMode.Cluster.id)) endpoint.addClusterServer(this.getDefaultDeviceEnergyManagementModeClusterServer());
|
|
631
507
|
}
|
|
632
508
|
async addFixedLabel(label, value) {
|
|
633
509
|
if (!this.clusterServers.get(FixedLabelCluster.id)) {
|
|
@@ -638,7 +514,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
638
514
|
return;
|
|
639
515
|
}
|
|
640
516
|
this.log.debug(`addFixedLabel: add label ${CYAN}${label}${db} value ${CYAN}${value}${db}`);
|
|
641
|
-
// if (this.construction.status !== Lifecycle.Status.Active) await this.construction.ready;
|
|
642
517
|
const labelList = (this.getAttribute(FixedLabelCluster.id, 'labelList', this.log) ?? []).filter((entryLabel) => entryLabel.label !== label);
|
|
643
518
|
labelList.push({ label, value });
|
|
644
519
|
await this.setAttribute(FixedLabelCluster.id, 'labelList', labelList, this.log);
|
|
@@ -652,7 +527,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
652
527
|
return;
|
|
653
528
|
}
|
|
654
529
|
this.log.debug(`addUserLabel: add label ${CYAN}${label}${db} value ${CYAN}${value}${db}`);
|
|
655
|
-
// if (this.construction.status !== Lifecycle.Status.Active) await this.construction.ready;
|
|
656
530
|
const labelList = (this.getAttribute(UserLabelCluster.id, 'labelList', this.log) ?? []).filter((entryLabel) => entryLabel.label !== label);
|
|
657
531
|
labelList.push({ label, value });
|
|
658
532
|
await this.setAttribute(UserLabelCluster.id, 'labelList', labelList, this.log);
|
|
@@ -667,16 +541,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
667
541
|
return name;
|
|
668
542
|
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
669
543
|
}
|
|
670
|
-
/**
|
|
671
|
-
* Retrieves the value of the specified attribute from the given endpoint and cluster.
|
|
672
|
-
*
|
|
673
|
-
* @param {ClusterId} clusterId - The ID of the cluster to retrieve the attribute from.
|
|
674
|
-
* @param {string} attribute - The name of the attribute to retrieve.
|
|
675
|
-
* @param {AnsiLogger} [log] - Optional logger for error and info messages.
|
|
676
|
-
* @param {MatterbridgeEndpoint} [endpoint] - Optional the child endpoint to retrieve the attribute from.
|
|
677
|
-
* @returns {any} The value of the attribute, or undefined if the attribute is not found.
|
|
678
|
-
*/
|
|
679
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
680
544
|
getAttribute(clusterId, attribute, log, endpoint) {
|
|
681
545
|
if (!endpoint)
|
|
682
546
|
endpoint = this;
|
|
@@ -685,7 +549,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
685
549
|
this.log.error(`getAttribute ${hk}${clusterName}.${attribute}${er} error: Endpoint ${or}${endpoint.id}${er} is in the ${BLUE}${endpoint.construction.status}${er} state`);
|
|
686
550
|
return undefined;
|
|
687
551
|
}
|
|
688
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
689
552
|
const state = endpoint.state;
|
|
690
553
|
if (!(clusterName in state)) {
|
|
691
554
|
this.log.error(`getAttribute error: Cluster ${'0x' + clusterId.toString(16).padStart(4, '0')}:${clusterName} not found on endpoint ${or}${endpoint.id}${er}:${or}${endpoint.number}${er}`);
|
|
@@ -700,27 +563,14 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
700
563
|
log?.info(`${db}Get endpoint ${or}${endpoint.id}${db}:${or}${endpoint.number}${db} attribute ${hk}${this.capitalizeFirstLetter(clusterName)}${db}.${hk}${attribute}${db} value ${YELLOW}${typeof value === 'object' ? debugStringify(value) : value}${db}`);
|
|
701
564
|
return value;
|
|
702
565
|
}
|
|
703
|
-
/**
|
|
704
|
-
* Sets the value of an attribute on a cluster server endpoint.
|
|
705
|
-
*
|
|
706
|
-
* @param {ClusterId} clusterId - The ID of the cluster.
|
|
707
|
-
* @param {string} attribute - The name of the attribute.
|
|
708
|
-
* @param {any} value - The value to set for the attribute.
|
|
709
|
-
* @param {AnsiLogger} [log] - (Optional) The logger to use for logging errors and information.
|
|
710
|
-
* @param {MatterbridgeEndpoint} [endpoint] - (Optional) The endpoint to set the attribute on. If not provided, the attribute will be set on the current endpoint.
|
|
711
|
-
* @returns {Promise<boolean>} - A promise that resolves to a boolean indicating whether the attribute was successfully set.
|
|
712
|
-
*/
|
|
713
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
714
566
|
async setAttribute(clusterId, attribute, value, log, endpoint) {
|
|
715
567
|
if (!endpoint)
|
|
716
568
|
endpoint = this;
|
|
717
569
|
const clusterName = this.lowercaseFirstLetter(getClusterNameById(clusterId));
|
|
718
570
|
if (endpoint.construction.status !== Lifecycle.Status.Active) {
|
|
719
571
|
this.log.error(`setAttribute ${hk}${clusterName}.${attribute}${er} error: Endpoint ${or}${endpoint.id}${er} is in the ${BLUE}${endpoint.construction.status}${er} state`);
|
|
720
|
-
// await endpoint.construction.ready;
|
|
721
572
|
return false;
|
|
722
573
|
}
|
|
723
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
724
574
|
const state = endpoint.state;
|
|
725
575
|
if (!(clusterName in state)) {
|
|
726
576
|
this.log.error(`setAttribute ${hk}${attribute}${er} error: Cluster ${'0x' + clusterId.toString(16).padStart(4, '0')}:${clusterName} not found on endpoint ${or}${endpoint.id}${er}:${or}${endpoint.number}${er}`);
|
|
@@ -735,32 +585,18 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
735
585
|
if (typeof oldValue === 'object')
|
|
736
586
|
oldValue = deepCopy(oldValue);
|
|
737
587
|
await endpoint.setStateOf(endpoint.behaviors.supported[clusterName], { [attribute]: value });
|
|
738
|
-
// await endpoint.set({ [clusterName]: { [attribute]: value } });
|
|
739
588
|
log?.info(`${db}Set endpoint ${or}${endpoint.id}${db}:${or}${endpoint.number}${db} attribute ${hk}${this.capitalizeFirstLetter(clusterName)}${db}.${hk}${attribute}${db} ` +
|
|
740
589
|
`from ${YELLOW}${typeof oldValue === 'object' ? debugStringify(oldValue) : oldValue}${db} ` +
|
|
741
590
|
`to ${YELLOW}${typeof value === 'object' ? debugStringify(value) : value}${db}`);
|
|
742
591
|
return true;
|
|
743
592
|
}
|
|
744
|
-
/**
|
|
745
|
-
* Subscribes to an attribute on a cluster.
|
|
746
|
-
*
|
|
747
|
-
* @param {ClusterId} clusterId - The ID of the cluster.
|
|
748
|
-
* @param {string} attribute - The name of the attribute to subscribe to.
|
|
749
|
-
* @param {(newValue: any, oldValue: any) => void} listener - A callback function that will be called when the attribute value changes.
|
|
750
|
-
* @param {AnsiLogger} [log] - Optional logger for logging errors and information.
|
|
751
|
-
* @param {MatterbridgeEndpoint} [endpoint] - Optional endpoint to subscribe the attribute on. Defaults to the current endpoint.
|
|
752
|
-
* @returns {boolean} - A boolean indicating whether the subscription was successful.
|
|
753
|
-
*/
|
|
754
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
755
593
|
async subscribeAttribute(clusterId, attribute, listener, log, endpoint) {
|
|
756
594
|
if (!endpoint)
|
|
757
595
|
endpoint = this;
|
|
758
596
|
const clusterName = this.lowercaseFirstLetter(getClusterNameById(clusterId));
|
|
759
597
|
if (endpoint.construction.status !== Lifecycle.Status.Active) {
|
|
760
|
-
// this.log.error(`subscribeAttribute ${hk}${clusterName}.${attribute}${er} error: Endpoint ${or}${endpoint.id}${er} is in the ${BLUE}${endpoint.construction.status}${er} state`);
|
|
761
598
|
await endpoint.construction.ready;
|
|
762
599
|
}
|
|
763
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
764
600
|
const events = endpoint.events;
|
|
765
601
|
if (!(clusterName in events)) {
|
|
766
602
|
this.log.error(`subscribeAttribute ${hk}${attribute}${er} error: Cluster ${'0x' + clusterId.toString(16).padStart(4, '0')}:${clusterName} not found on endpoint ${or}${endpoint.id}${er}:${or}${endpoint.number}${er}`);
|
|
@@ -775,120 +611,31 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
775
611
|
log?.info(`${db}Subscribe endpoint ${or}${endpoint.id}${db}:${or}${endpoint.number}${db} attribute ${hk}${this.capitalizeFirstLetter(clusterName)}${db}.${hk}${attribute}${db}`);
|
|
776
612
|
return true;
|
|
777
613
|
}
|
|
778
|
-
/**
|
|
779
|
-
* Triggers an event on the specified cluster.
|
|
780
|
-
*
|
|
781
|
-
* @param {ClusterId} clusterId - The ID of the cluster.
|
|
782
|
-
* @param {string} event - The name of the event to trigger.
|
|
783
|
-
* @param {Record<string, boolean | number | bigint | string | object | undefined | null>} payload - The payload to pass to the event.
|
|
784
|
-
* @param {AnsiLogger} [log] - Optional logger for logging information.
|
|
785
|
-
* @param {MatterbridgeEndpoint} [endpoint] - Optional endpoint to trigger the event on. Defaults to the current endpoint.
|
|
786
|
-
* @returns {Promise<boolean>} - A promise that resolves to a boolean indicating whether the event was successfully triggered.
|
|
787
|
-
*/
|
|
788
614
|
async triggerEvent(clusterId, event, payload, log, endpoint) {
|
|
789
615
|
if (!endpoint)
|
|
790
616
|
endpoint = this;
|
|
791
617
|
const clusterName = this.lowercaseFirstLetter(getClusterNameById(clusterId));
|
|
792
618
|
if (endpoint.construction.status !== Lifecycle.Status.Active) {
|
|
793
|
-
// this.log.error(`triggerEvent ${hk}${clusterName}.${event}${er} error: Endpoint ${or}${endpoint.id}${er} is in the ${BLUE}${endpoint.construction.status}${er} state`);
|
|
794
619
|
await endpoint.construction.ready;
|
|
795
|
-
// return false;
|
|
796
620
|
}
|
|
797
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
798
621
|
const events = endpoint.events;
|
|
799
622
|
if (!(clusterName in events) || !(event in events[clusterName])) {
|
|
800
623
|
this.log.error(`triggerEvent ${hk}${event}${er} error: Cluster ${'0x' + clusterId.toString(16).padStart(4, '0')}:${clusterName} not found on endpoint ${or}${endpoint.id}${er}:${or}${endpoint.number}${er}`);
|
|
801
624
|
return false;
|
|
802
625
|
}
|
|
803
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
804
|
-
// @ts-ignore
|
|
805
626
|
await endpoint.act((agent) => agent[clusterName].events[event].emit(payload, agent.context));
|
|
806
627
|
log?.info(`${db}Trigger event ${hk}${this.capitalizeFirstLetter(clusterName)}${db}.${hk}${event}${db} with ${debugStringify(payload)}${db} on endpoint ${or}${endpoint.id}${db}:${or}${endpoint.number}${db} `);
|
|
807
628
|
return true;
|
|
808
629
|
}
|
|
809
|
-
/**
|
|
810
|
-
* Adds a command handler for the specified command.
|
|
811
|
-
*
|
|
812
|
-
* @param {keyof MatterbridgeEndpointCommands} command - The command to add the handler for.
|
|
813
|
-
* @param {(data: any) => void} handler - The handler function to execute when the command is received.
|
|
814
|
-
* @returns {void}
|
|
815
|
-
*/
|
|
816
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
817
630
|
addCommandHandler(command, handler) {
|
|
818
631
|
this.commandHandler.addHandler(command, handler);
|
|
819
632
|
}
|
|
820
|
-
/**
|
|
821
|
-
* Serializes the Matterbridge device into a serialized object.
|
|
822
|
-
*
|
|
823
|
-
* @param pluginName - The name of the plugin.
|
|
824
|
-
* @returns The serialized Matterbridge device object.
|
|
825
|
-
*/
|
|
826
633
|
serialize() {
|
|
827
634
|
return undefined;
|
|
828
|
-
|
|
829
|
-
if (!this.serialNumber || !this.deviceName || !this.uniqueId) return;
|
|
830
|
-
const cluster = this.getClusterServer(BasicInformationCluster) ?? this.getClusterServer(BridgedDeviceBasicInformationCluster);
|
|
831
|
-
if (!cluster) return;
|
|
832
|
-
const serialized: SerializedMatterbridgeDevice = {
|
|
833
|
-
pluginName: this.plugin ?? 'Unknown',
|
|
834
|
-
serialNumber: this.serialNumber,
|
|
835
|
-
deviceName: this.deviceName,
|
|
836
|
-
uniqueId: this.uniqueId,
|
|
837
|
-
productName: cluster.attributes.productName?.getLocal(),
|
|
838
|
-
vendorId: cluster.attributes.vendorId?.getLocal(),
|
|
839
|
-
vendorName: cluster.attributes.vendorName?.getLocal(),
|
|
840
|
-
deviceTypes: Array.from(this.deviceTypes.values()),
|
|
841
|
-
endpoint: this.number,
|
|
842
|
-
endpointName: this.id,
|
|
843
|
-
clusterServersId: [],
|
|
844
|
-
};
|
|
845
|
-
this.getAllClusterServers().forEach((clusterServer) => {
|
|
846
|
-
serialized.clusterServersId.push(clusterServer.id);
|
|
847
|
-
});
|
|
848
|
-
return serialized;
|
|
849
|
-
*/
|
|
850
|
-
}
|
|
851
|
-
/**
|
|
852
|
-
* Deserializes the device into a serialized object.
|
|
853
|
-
*
|
|
854
|
-
* @returns The deserialized MatterbridgeDevice.
|
|
855
|
-
*/
|
|
635
|
+
}
|
|
856
636
|
static deserialize(serializedDevice) {
|
|
857
637
|
return undefined;
|
|
858
|
-
|
|
859
|
-
const device = new MatterbridgeDevice(serializedDevice.deviceTypes);
|
|
860
|
-
device.serialNumber = serializedDevice.serialNumber;
|
|
861
|
-
device.deviceName = serializedDevice.deviceName;
|
|
862
|
-
device.uniqueId = serializedDevice.uniqueId;
|
|
863
|
-
for (const clusterId of serializedDevice.clusterServersId) {
|
|
864
|
-
if (clusterId === BasicInformationCluster.id)
|
|
865
|
-
device.createDefaultBasicInformationClusterServer(
|
|
866
|
-
serializedDevice.deviceName,
|
|
867
|
-
serializedDevice.serialNumber,
|
|
868
|
-
serializedDevice.vendorId ?? 0xfff1,
|
|
869
|
-
serializedDevice.vendorName ?? 'Matterbridge',
|
|
870
|
-
serializedDevice.productId ?? 0x8000,
|
|
871
|
-
serializedDevice.productName ?? 'Matterbridge device',
|
|
872
|
-
);
|
|
873
|
-
else if (clusterId === BridgedDeviceBasicInformationCluster.id)
|
|
874
|
-
device.createDefaultBridgedDeviceBasicInformationClusterServer(
|
|
875
|
-
serializedDevice.deviceName,
|
|
876
|
-
serializedDevice.serialNumber,
|
|
877
|
-
serializedDevice.vendorId ?? 0xfff1,
|
|
878
|
-
serializedDevice.vendorName ?? 'Matterbridge',
|
|
879
|
-
serializedDevice.productName ?? 'Matterbridge device',
|
|
880
|
-
);
|
|
881
|
-
else device.addClusterServerFromList(device, [clusterId]);
|
|
882
|
-
}
|
|
883
|
-
return device;
|
|
884
|
-
*/
|
|
885
|
-
}
|
|
886
|
-
/**
|
|
887
|
-
* From here copy paste from MatterbridgeDevice
|
|
888
|
-
*/
|
|
889
|
-
/**
|
|
890
|
-
* Get a default IdentifyCluster server.
|
|
891
|
-
*/
|
|
638
|
+
}
|
|
892
639
|
getDefaultIdentifyClusterServer(identifyTime = 0, identifyType = Identify.IdentifyType.None) {
|
|
893
640
|
return ClusterServer(IdentifyCluster, {
|
|
894
641
|
identifyTime,
|
|
@@ -904,88 +651,28 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
904
651
|
},
|
|
905
652
|
});
|
|
906
653
|
}
|
|
907
|
-
/**
|
|
908
|
-
* Creates a default IdentifyCluster server.
|
|
909
|
-
*/
|
|
910
654
|
createDefaultIdentifyClusterServer(identifyTime = 0, identifyType = Identify.IdentifyType.None) {
|
|
911
655
|
this.addClusterServer(this.getDefaultIdentifyClusterServer(identifyTime, identifyType));
|
|
912
656
|
}
|
|
913
|
-
/**
|
|
914
|
-
* Get a default IdentifyCluster server.
|
|
915
|
-
*/
|
|
916
657
|
getDefaultGroupsClusterServer() {
|
|
917
658
|
return ClusterServer(GroupsCluster, {
|
|
918
659
|
nameSupport: {
|
|
919
660
|
nameSupport: true,
|
|
920
661
|
},
|
|
921
662
|
}, GroupsClusterHandler());
|
|
922
|
-
// return createDefaultGroupsClusterServer();
|
|
923
663
|
}
|
|
924
|
-
/**
|
|
925
|
-
* Creates a default groups cluster server and adds it to the device.
|
|
926
|
-
*/
|
|
927
664
|
createDefaultGroupsClusterServer() {
|
|
928
665
|
this.addClusterServer(this.getDefaultGroupsClusterServer());
|
|
929
666
|
}
|
|
930
|
-
/**
|
|
931
|
-
* Get a default scenes cluster server and adds it to the current instance.
|
|
932
|
-
* @deprecated This method is deprecated.
|
|
933
|
-
*
|
|
934
|
-
*/
|
|
935
667
|
getDefaultScenesClusterServer() {
|
|
936
|
-
|
|
937
|
-
return ClusterServer(
|
|
938
|
-
ScenesCluster,
|
|
939
|
-
{
|
|
940
|
-
sceneCount: 0,
|
|
941
|
-
currentScene: 0,
|
|
942
|
-
currentGroup: GroupId(0),
|
|
943
|
-
sceneValid: false,
|
|
944
|
-
nameSupport: {
|
|
945
|
-
nameSupport: true,
|
|
946
|
-
},
|
|
947
|
-
lastConfiguredBy: null,
|
|
948
|
-
},
|
|
949
|
-
{},
|
|
950
|
-
);
|
|
951
|
-
*/
|
|
952
|
-
}
|
|
953
|
-
/**
|
|
954
|
-
* Creates a default scenes cluster server and adds it to the current instance.
|
|
955
|
-
* @deprecated This method is deprecated.
|
|
956
|
-
*/
|
|
668
|
+
}
|
|
957
669
|
createDefaultScenesClusterServer() {
|
|
958
|
-
|
|
959
|
-
this.addClusterServer(this.getDefaultScenesClusterServer());
|
|
960
|
-
*/
|
|
961
|
-
}
|
|
962
|
-
/**
|
|
963
|
-
* Creates a unique identifier based on the provided parameters.
|
|
964
|
-
* @param param1 - The first parameter.
|
|
965
|
-
* @param param2 - The second parameter.
|
|
966
|
-
* @param param3 - The third parameter.
|
|
967
|
-
* @param param4 - The fourth parameter.
|
|
968
|
-
* @returns A unique identifier generated using the MD5 hash algorithm.
|
|
969
|
-
*/
|
|
670
|
+
}
|
|
970
671
|
createUniqueId(param1, param2, param3, param4) {
|
|
971
672
|
const hash = createHash('md5');
|
|
972
673
|
hash.update(param1 + param2 + param3 + param4);
|
|
973
674
|
return hash.digest('hex');
|
|
974
675
|
}
|
|
975
|
-
/**
|
|
976
|
-
* Get a default Basic Information Cluster Server.
|
|
977
|
-
*
|
|
978
|
-
* @param deviceName - The name of the device.
|
|
979
|
-
* @param serialNumber - The serial number of the device.
|
|
980
|
-
* @param vendorId - The vendor ID of the device.
|
|
981
|
-
* @param vendorName - The vendor name of the device.
|
|
982
|
-
* @param productId - The product ID of the device.
|
|
983
|
-
* @param productName - The product name of the device.
|
|
984
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
985
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
986
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
987
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
988
|
-
*/
|
|
989
676
|
getDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
990
677
|
this.log.logName = deviceName;
|
|
991
678
|
this.deviceName = deviceName;
|
|
@@ -1025,20 +712,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1025
712
|
reachableChanged: true,
|
|
1026
713
|
});
|
|
1027
714
|
}
|
|
1028
|
-
/**
|
|
1029
|
-
* Creates a default Basic Information Cluster Server.
|
|
1030
|
-
*
|
|
1031
|
-
* @param deviceName - The name of the device.
|
|
1032
|
-
* @param serialNumber - The serial number of the device.
|
|
1033
|
-
* @param vendorId - The vendor ID of the device.
|
|
1034
|
-
* @param vendorName - The vendor name of the device.
|
|
1035
|
-
* @param productId - The product ID of the device.
|
|
1036
|
-
* @param productName - The product name of the device.
|
|
1037
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
1038
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
1039
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
1040
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
1041
|
-
*/
|
|
1042
715
|
createDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
1043
716
|
if (MatterbridgeEndpoint.bridgeMode === 'bridge') {
|
|
1044
717
|
this.addDeviceType(bridgedNode);
|
|
@@ -1047,19 +720,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1047
720
|
}
|
|
1048
721
|
this.addClusterServer(this.getDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
1049
722
|
}
|
|
1050
|
-
/**
|
|
1051
|
-
* Get a default BridgedDeviceBasicInformationClusterServer.
|
|
1052
|
-
*
|
|
1053
|
-
* @param deviceName - The name of the device.
|
|
1054
|
-
* @param serialNumber - The serial number of the device.
|
|
1055
|
-
* @param vendorId - The vendor ID of the device.
|
|
1056
|
-
* @param vendorName - The name of the vendor.
|
|
1057
|
-
* @param productName - The name of the product.
|
|
1058
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
1059
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
1060
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
1061
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
1062
|
-
*/
|
|
1063
723
|
getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
1064
724
|
this.log.logName = deviceName;
|
|
1065
725
|
this.deviceName = deviceName;
|
|
@@ -1074,7 +734,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1074
734
|
this.hardwareVersion = hardwareVersion;
|
|
1075
735
|
this.hardwareVersionString = hardwareVersionString;
|
|
1076
736
|
return ClusterServer(BridgedDeviceBasicInformationCluster, {
|
|
1077
|
-
vendorId: vendorId !== undefined ? VendorId(vendorId) : undefined,
|
|
737
|
+
vendorId: vendorId !== undefined ? VendorId(vendorId) : undefined,
|
|
1078
738
|
vendorName: vendorName.slice(0, 32),
|
|
1079
739
|
productName: productName.slice(0, 32),
|
|
1080
740
|
productLabel: deviceName.slice(0, 64),
|
|
@@ -1093,36 +753,12 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1093
753
|
reachableChanged: true,
|
|
1094
754
|
});
|
|
1095
755
|
}
|
|
1096
|
-
/**
|
|
1097
|
-
* Creates a default BridgedDeviceBasicInformationClusterServer.
|
|
1098
|
-
*
|
|
1099
|
-
* @param deviceName - The name of the device.
|
|
1100
|
-
* @param serialNumber - The serial number of the device.
|
|
1101
|
-
* @param vendorId - The vendor ID of the device.
|
|
1102
|
-
* @param vendorName - The name of the vendor.
|
|
1103
|
-
* @param productName - The name of the product.
|
|
1104
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
1105
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
1106
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
1107
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
1108
|
-
*/
|
|
1109
756
|
createDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
1110
757
|
this.addClusterServer(this.getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
1111
758
|
}
|
|
1112
|
-
/**
|
|
1113
|
-
* Get a default Power Topology Cluster Server. Only needed for an electricalSensor device type.
|
|
1114
|
-
*
|
|
1115
|
-
* @returns {ClusterServer} - The configured Power Topology Cluster Server.
|
|
1116
|
-
*/
|
|
1117
759
|
getDefaultPowerTopologyClusterServer() {
|
|
1118
760
|
return ClusterServer(PowerTopologyCluster.with(PowerTopology.Feature.TreeTopology), {}, {}, {});
|
|
1119
761
|
}
|
|
1120
|
-
/**
|
|
1121
|
-
* Get a default Electrical Energy Measurement Cluster Server.
|
|
1122
|
-
*
|
|
1123
|
-
* @param {number} energy - The total consumption value in mW/h.
|
|
1124
|
-
* @returns {ClusterServer} - The configured Electrical Energy Measurement Cluster Server.
|
|
1125
|
-
*/
|
|
1126
762
|
getDefaultElectricalEnergyMeasurementClusterServer(energy = null) {
|
|
1127
763
|
return ClusterServer(ElectricalEnergyMeasurementCluster.with(ElectricalEnergyMeasurement.Feature.ImportedEnergy, ElectricalEnergyMeasurement.Feature.ExportedEnergy, ElectricalEnergyMeasurement.Feature.CumulativeEnergy), {
|
|
1128
764
|
accuracy: {
|
|
@@ -1139,15 +775,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1139
775
|
cumulativeEnergyMeasured: true,
|
|
1140
776
|
});
|
|
1141
777
|
}
|
|
1142
|
-
/**
|
|
1143
|
-
* Get a default Electrical Power Measurement Cluster Server.
|
|
1144
|
-
*
|
|
1145
|
-
* @param {number} voltage - The voltage value in millivolts.
|
|
1146
|
-
* @param {number} current - The current value in milliamperes.
|
|
1147
|
-
* @param {number} power - The power value in milliwatts.
|
|
1148
|
-
* @param {number} frequency - The frequency value in millihertz.
|
|
1149
|
-
* @returns {ClusterServer} - The configured Electrical Power Measurement Cluster Server.
|
|
1150
|
-
*/
|
|
1151
778
|
getDefaultElectricalPowerMeasurementClusterServer(voltage = null, current = null, power = null, frequency = null) {
|
|
1152
779
|
return ClusterServer(ElectricalPowerMeasurementCluster.with(ElectricalPowerMeasurement.Feature.AlternatingCurrent), {
|
|
1153
780
|
powerMode: ElectricalPowerMeasurement.PowerMode.Ac,
|
|
@@ -1188,16 +815,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1188
815
|
frequency: frequency,
|
|
1189
816
|
}, {}, {});
|
|
1190
817
|
}
|
|
1191
|
-
/**
|
|
1192
|
-
* Get a default OnOff cluster server.
|
|
1193
|
-
*
|
|
1194
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
1195
|
-
* @param {boolean} [globalSceneControl=false] - The global scene control state.
|
|
1196
|
-
* @param {number} [onTime=0] - The on time value.
|
|
1197
|
-
* @param {number} [offWaitTime=0] - The off wait time value.
|
|
1198
|
-
* @param {OnOff.StartUpOnOff | null} [startUpOnOff=null] - The start-up OnOff state. Null means previous state.
|
|
1199
|
-
* @returns {ClusterServer} - The configured OnOff cluster server.
|
|
1200
|
-
*/
|
|
1201
818
|
getDefaultOnOffClusterServer(onOff = false, globalSceneControl = false, onTime = 0, offWaitTime = 0, startUpOnOff = null) {
|
|
1202
819
|
return ClusterServer(OnOffCluster.with(OnOff.Feature.Lighting), {
|
|
1203
820
|
onOff,
|
|
@@ -1207,46 +824,22 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1207
824
|
startUpOnOff,
|
|
1208
825
|
}, {
|
|
1209
826
|
on: async (data) => {
|
|
1210
|
-
// Never called in edge
|
|
1211
827
|
},
|
|
1212
828
|
off: async (data) => {
|
|
1213
|
-
// Never called in edge
|
|
1214
829
|
},
|
|
1215
830
|
toggle: async (data) => {
|
|
1216
|
-
// Never called in edge
|
|
1217
831
|
},
|
|
1218
832
|
offWithEffect: async () => {
|
|
1219
|
-
// Never called in edge
|
|
1220
833
|
},
|
|
1221
834
|
onWithRecallGlobalScene: async () => {
|
|
1222
|
-
// Never called in edge
|
|
1223
835
|
},
|
|
1224
836
|
onWithTimedOff: async () => {
|
|
1225
|
-
// Never called in edge
|
|
1226
837
|
},
|
|
1227
838
|
}, {});
|
|
1228
839
|
}
|
|
1229
|
-
/**
|
|
1230
|
-
* Creates a default OnOff cluster server.
|
|
1231
|
-
*
|
|
1232
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
1233
|
-
* @param {boolean} [globalSceneControl=false] - The global scene control state.
|
|
1234
|
-
* @param {number} [onTime=0] - The on time value.
|
|
1235
|
-
* @param {number} [offWaitTime=0] - The off wait time value.
|
|
1236
|
-
* @param {OnOff.StartUpOnOff | null} [startUpOnOff=null] - The start-up OnOff state. Null means previous state.
|
|
1237
|
-
* @returns {void}
|
|
1238
|
-
*/
|
|
1239
840
|
createDefaultOnOffClusterServer(onOff = false, globalSceneControl = false, onTime = 0, offWaitTime = 0, startUpOnOff = null) {
|
|
1240
841
|
this.addClusterServer(this.getDefaultOnOffClusterServer(onOff, globalSceneControl, onTime, offWaitTime, startUpOnOff));
|
|
1241
842
|
}
|
|
1242
|
-
/**
|
|
1243
|
-
* Get a default level control cluster server.
|
|
1244
|
-
*
|
|
1245
|
-
* @param currentLevel - The current level (default: 254).
|
|
1246
|
-
* @param minLevel - The minimum level (default: 0).
|
|
1247
|
-
* @param maxLevel - The maximum level (default: 254).
|
|
1248
|
-
* @param onLevel - The on level (default: null).
|
|
1249
|
-
*/
|
|
1250
843
|
getDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 0, maxLevel = 254, onLevel = 254) {
|
|
1251
844
|
return ClusterServer(LevelControlCluster.with(LevelControl.Feature.OnOff), {
|
|
1252
845
|
currentLevel,
|
|
@@ -1286,28 +879,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1286
879
|
},
|
|
1287
880
|
});
|
|
1288
881
|
}
|
|
1289
|
-
/**
|
|
1290
|
-
* Creates a default level control cluster server.
|
|
1291
|
-
*
|
|
1292
|
-
* @param currentLevel - The current level (default: 254).
|
|
1293
|
-
* @param minLevel - The minimum level (default: 0).
|
|
1294
|
-
* @param maxLevel - The maximum level (default: 254).
|
|
1295
|
-
* @param onLevel - The on level (default: null).
|
|
1296
|
-
*/
|
|
1297
882
|
createDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 0, maxLevel = 254, onLevel = 254) {
|
|
1298
883
|
this.addClusterServer(this.getDefaultLevelControlClusterServer(currentLevel, minLevel, maxLevel, onLevel));
|
|
1299
884
|
}
|
|
1300
|
-
/**
|
|
1301
|
-
* Get a default color control cluster server.
|
|
1302
|
-
*
|
|
1303
|
-
* @param currentX - The current X value.
|
|
1304
|
-
* @param currentY - The current Y value.
|
|
1305
|
-
* @param currentHue - The current hue value.
|
|
1306
|
-
* @param currentSaturation - The current saturation value.
|
|
1307
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1308
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1309
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1310
|
-
*/
|
|
1311
885
|
getDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1312
886
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
1313
887
|
colorMode: ColorControl.ColorMode.CurrentHueAndCurrentSaturation,
|
|
@@ -1376,33 +950,94 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1376
950
|
},
|
|
1377
951
|
}, {});
|
|
1378
952
|
}
|
|
1379
|
-
/**
|
|
1380
|
-
* Creates a default color control cluster server.
|
|
1381
|
-
*
|
|
1382
|
-
* @param currentX - The current X value.
|
|
1383
|
-
* @param currentY - The current Y value.
|
|
1384
|
-
* @param currentHue - The current hue value.
|
|
1385
|
-
* @param currentSaturation - The current saturation value.
|
|
1386
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1387
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1388
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1389
|
-
*/
|
|
1390
953
|
createDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1391
954
|
this.addClusterServer(this.getDefaultColorControlClusterServer(currentX, currentY, currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1392
955
|
}
|
|
956
|
+
getXyColorControlClusterServer(currentX = 0, currentY = 0) {
|
|
957
|
+
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy), {
|
|
958
|
+
colorMode: ColorControl.ColorMode.CurrentXAndCurrentY,
|
|
959
|
+
enhancedColorMode: ColorControl.EnhancedColorMode.CurrentXAndCurrentY,
|
|
960
|
+
colorCapabilities: { xy: true, hueSaturation: false, colorLoop: false, enhancedHue: false, colorTemperature: false },
|
|
961
|
+
options: {
|
|
962
|
+
executeIfOff: false,
|
|
963
|
+
},
|
|
964
|
+
numberOfPrimaries: null,
|
|
965
|
+
currentX,
|
|
966
|
+
currentY,
|
|
967
|
+
}, {
|
|
968
|
+
moveToColor: async () => {
|
|
969
|
+
},
|
|
970
|
+
moveColor: async () => {
|
|
971
|
+
},
|
|
972
|
+
stepColor: async () => {
|
|
973
|
+
},
|
|
974
|
+
stopMoveStep: async () => {
|
|
975
|
+
},
|
|
976
|
+
}, {});
|
|
977
|
+
}
|
|
978
|
+
createXyControlClusterServer(currentX = 0, currentY = 0) {
|
|
979
|
+
this.addClusterServer(this.getXyColorControlClusterServer(currentX, currentY));
|
|
980
|
+
}
|
|
981
|
+
getHsColorControlClusterServer(currentHue = 0, currentSaturation = 0) {
|
|
982
|
+
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation), {
|
|
983
|
+
colorMode: ColorControl.ColorMode.CurrentHueAndCurrentSaturation,
|
|
984
|
+
enhancedColorMode: ColorControl.EnhancedColorMode.CurrentHueAndCurrentSaturation,
|
|
985
|
+
colorCapabilities: { xy: false, hueSaturation: true, colorLoop: false, enhancedHue: false, colorTemperature: false },
|
|
986
|
+
options: {
|
|
987
|
+
executeIfOff: false,
|
|
988
|
+
},
|
|
989
|
+
numberOfPrimaries: null,
|
|
990
|
+
currentHue,
|
|
991
|
+
currentSaturation,
|
|
992
|
+
}, {
|
|
993
|
+
moveToHue: async ({ request, attributes, endpoint }) => {
|
|
994
|
+
},
|
|
995
|
+
moveHue: async () => {
|
|
996
|
+
},
|
|
997
|
+
stepHue: async () => {
|
|
998
|
+
},
|
|
999
|
+
moveToSaturation: async ({ request, attributes, endpoint }) => {
|
|
1000
|
+
},
|
|
1001
|
+
moveSaturation: async () => {
|
|
1002
|
+
},
|
|
1003
|
+
stepSaturation: async () => {
|
|
1004
|
+
},
|
|
1005
|
+
moveToHueAndSaturation: async ({ request, attributes, endpoint }) => {
|
|
1006
|
+
},
|
|
1007
|
+
stopMoveStep: async () => {
|
|
1008
|
+
},
|
|
1009
|
+
}, {});
|
|
1010
|
+
}
|
|
1011
|
+
createHsColorControlClusterServer(currentHue = 0, currentSaturation = 0) {
|
|
1012
|
+
this.addClusterServer(this.getHsColorControlClusterServer(currentHue, currentSaturation));
|
|
1013
|
+
}
|
|
1014
|
+
getCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1015
|
+
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.ColorTemperature), {
|
|
1016
|
+
colorMode: ColorControl.ColorMode.ColorTemperatureMireds,
|
|
1017
|
+
enhancedColorMode: ColorControl.EnhancedColorMode.ColorTemperatureMireds,
|
|
1018
|
+
colorCapabilities: { xy: false, hueSaturation: false, colorLoop: false, enhancedHue: false, colorTemperature: true },
|
|
1019
|
+
options: {
|
|
1020
|
+
executeIfOff: false,
|
|
1021
|
+
},
|
|
1022
|
+
numberOfPrimaries: null,
|
|
1023
|
+
colorTemperatureMireds,
|
|
1024
|
+
colorTempPhysicalMinMireds,
|
|
1025
|
+
colorTempPhysicalMaxMireds,
|
|
1026
|
+
}, {
|
|
1027
|
+
stopMoveStep: async () => {
|
|
1028
|
+
},
|
|
1029
|
+
moveToColorTemperature: async ({ request, attributes, endpoint }) => {
|
|
1030
|
+
},
|
|
1031
|
+
moveColorTemperature: async () => {
|
|
1032
|
+
},
|
|
1033
|
+
stepColorTemperature: async () => {
|
|
1034
|
+
},
|
|
1035
|
+
}, {});
|
|
1036
|
+
}
|
|
1037
|
+
createCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1038
|
+
this.addClusterServer(this.getCtColorControlClusterServer(colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1039
|
+
}
|
|
1393
1040
|
isColorControlConfigured = false;
|
|
1394
|
-
/**
|
|
1395
|
-
* Configures the color control cluster for a device.
|
|
1396
|
-
*
|
|
1397
|
-
* @remark This method must be called only after creating the cluster with getDefaultColorControlClusterServer or createDefaultColorControlClusterServer
|
|
1398
|
-
* and before starting the matter node.
|
|
1399
|
-
*
|
|
1400
|
-
* @param {boolean} hueSaturation - A boolean indicating whether the device supports hue and saturation control.
|
|
1401
|
-
* @param {boolean} xy - A boolean indicating whether the device supports XY control.
|
|
1402
|
-
* @param {boolean} colorTemperature - A boolean indicating whether the device supports color temperature control.
|
|
1403
|
-
* @param {ColorControl.ColorMode} colorMode - An optional parameter specifying the color mode of the device.
|
|
1404
|
-
* @param {Endpoint} endpoint - An optional parameter specifying the endpoint to configure. If not provided, the device endpoint will be used.
|
|
1405
|
-
*/
|
|
1406
1041
|
async configureColorControlCluster(hueSaturation, xy, colorTemperature, colorMode, endpoint) {
|
|
1407
1042
|
if (!endpoint)
|
|
1408
1043
|
endpoint = this;
|
|
@@ -1425,12 +1060,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1425
1060
|
}
|
|
1426
1061
|
this.isColorControlConfigured = true;
|
|
1427
1062
|
}
|
|
1428
|
-
/**
|
|
1429
|
-
* Configures the color control mode for the device.
|
|
1430
|
-
*
|
|
1431
|
-
* @param {ColorControl.ColorMode} colorMode - The color mode to set.
|
|
1432
|
-
* @param {Endpoint} endpoint - The optional endpoint to configure. If not provided, the method will configure the current endpoint.
|
|
1433
|
-
*/
|
|
1434
1063
|
async configureColorControlMode(colorMode, endpoint) {
|
|
1435
1064
|
if (!endpoint)
|
|
1436
1065
|
endpoint = this;
|
|
@@ -1439,11 +1068,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1439
1068
|
await endpoint.setAttribute(ColorControlCluster.id, 'enhancedColorMode', colorMode, this.log, endpoint);
|
|
1440
1069
|
}
|
|
1441
1070
|
}
|
|
1442
|
-
/**
|
|
1443
|
-
* Get a default window covering cluster server.
|
|
1444
|
-
*
|
|
1445
|
-
* @param positionPercent100ths - The position percentage in 100ths (0-10000). Defaults to 0. Matter uses 10000 = fully closed 0 = fully opened.
|
|
1446
|
-
*/
|
|
1447
1071
|
getDefaultWindowCoveringClusterServer(positionPercent100ths) {
|
|
1448
1072
|
return ClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift), {
|
|
1449
1073
|
type: WindowCovering.WindowCoveringType.Rollershade,
|
|
@@ -1459,8 +1083,8 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1459
1083
|
operationalStatus: { global: WindowCovering.MovementStatus.Stopped, lift: WindowCovering.MovementStatus.Stopped, tilt: WindowCovering.MovementStatus.Stopped },
|
|
1460
1084
|
endProductType: WindowCovering.EndProductType.RollerShade,
|
|
1461
1085
|
mode: { motorDirectionReversed: false, calibrationMode: false, maintenanceMode: false, ledFeedback: false },
|
|
1462
|
-
targetPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
1463
|
-
currentPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
1086
|
+
targetPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
1087
|
+
currentPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
1464
1088
|
}, {
|
|
1465
1089
|
upOrOpen: async (data) => {
|
|
1466
1090
|
this.log.debug('Matter command: upOrOpen');
|
|
@@ -1481,22 +1105,13 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1481
1105
|
},
|
|
1482
1106
|
}, {});
|
|
1483
1107
|
}
|
|
1484
|
-
/**
|
|
1485
|
-
* Creates a default window covering cluster server.
|
|
1486
|
-
*
|
|
1487
|
-
* @param positionPercent100ths - The position percentage in 100ths (0-10000). Defaults to 0. Matter uses 10000 = fully closed 0 = fully opened.
|
|
1488
|
-
*/
|
|
1489
1108
|
createDefaultWindowCoveringClusterServer(positionPercent100ths) {
|
|
1490
1109
|
this.addClusterServer(this.getDefaultWindowCoveringClusterServer(positionPercent100ths));
|
|
1491
1110
|
}
|
|
1492
|
-
/**
|
|
1493
|
-
* Sets the window covering target position as the current position and stops the movement.
|
|
1494
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1495
|
-
*/
|
|
1496
1111
|
async setWindowCoveringTargetAsCurrentAndStopped(endpoint) {
|
|
1497
1112
|
if (!endpoint)
|
|
1498
1113
|
endpoint = this;
|
|
1499
|
-
const position = endpoint.getAttribute(WindowCoveringCluster.id, 'currentPositionLiftPercent100ths', this.log, endpoint);
|
|
1114
|
+
const position = endpoint.getAttribute(WindowCoveringCluster.id, 'currentPositionLiftPercent100ths', this.log, endpoint);
|
|
1500
1115
|
if (position !== null) {
|
|
1501
1116
|
await endpoint.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', position, this.log, endpoint);
|
|
1502
1117
|
await endpoint.setAttribute(WindowCoveringCluster.id, 'operationalStatus', {
|
|
@@ -1507,13 +1122,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1507
1122
|
}
|
|
1508
1123
|
this.log.debug(`Set WindowCovering currentPositionLiftPercent100ths and targetPositionLiftPercent100ths to ${position} and operationalStatus to Stopped.`);
|
|
1509
1124
|
}
|
|
1510
|
-
/**
|
|
1511
|
-
* Sets the current and target status of a window covering.
|
|
1512
|
-
* @param {number} current - The current position of the window covering.
|
|
1513
|
-
* @param {number} target - The target position of the window covering.
|
|
1514
|
-
* @param {WindowCovering.MovementStatus} status - The movement status of the window covering.
|
|
1515
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1516
|
-
*/
|
|
1517
1125
|
async setWindowCoveringCurrentTargetStatus(current, target, status, endpoint) {
|
|
1518
1126
|
if (!endpoint)
|
|
1519
1127
|
endpoint = this;
|
|
@@ -1526,11 +1134,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1526
1134
|
}, this.log, endpoint);
|
|
1527
1135
|
this.log.debug(`Set WindowCovering currentPositionLiftPercent100ths: ${current}, targetPositionLiftPercent100ths: ${target} and operationalStatus: ${status}.`);
|
|
1528
1136
|
}
|
|
1529
|
-
/**
|
|
1530
|
-
* Sets the status of the window covering.
|
|
1531
|
-
* @param {WindowCovering.MovementStatus} status - The movement status to set.
|
|
1532
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1533
|
-
*/
|
|
1534
1137
|
async setWindowCoveringStatus(status, endpoint) {
|
|
1535
1138
|
if (!endpoint)
|
|
1536
1139
|
endpoint = this;
|
|
@@ -1541,12 +1144,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1541
1144
|
}, this.log, endpoint);
|
|
1542
1145
|
this.log.debug(`Set WindowCovering operationalStatus: ${status}`);
|
|
1543
1146
|
}
|
|
1544
|
-
/**
|
|
1545
|
-
* Retrieves the status of the window covering.
|
|
1546
|
-
* @param {Endpoint} endpoint - The endpoint on which to get the window covering (default the device endpoint).
|
|
1547
|
-
*
|
|
1548
|
-
* @returns The global operational status of the window covering.
|
|
1549
|
-
*/
|
|
1550
1147
|
getWindowCoveringStatus(endpoint) {
|
|
1551
1148
|
if (!endpoint)
|
|
1552
1149
|
endpoint = this;
|
|
@@ -1554,12 +1151,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1554
1151
|
this.log.debug(`Get WindowCovering operationalStatus: ${status.global}`);
|
|
1555
1152
|
return status.global;
|
|
1556
1153
|
}
|
|
1557
|
-
/**
|
|
1558
|
-
* Sets the target and current position of the window covering.
|
|
1559
|
-
*
|
|
1560
|
-
* @param position - The position to set, specified as a number.
|
|
1561
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1562
|
-
*/
|
|
1563
1154
|
async setWindowCoveringTargetAndCurrentPosition(position, endpoint) {
|
|
1564
1155
|
if (!endpoint)
|
|
1565
1156
|
endpoint = this;
|
|
@@ -1567,13 +1158,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1567
1158
|
await endpoint.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', position, this.log, endpoint);
|
|
1568
1159
|
this.log.debug(`Set WindowCovering currentPositionLiftPercent100ths: ${position} and targetPositionLiftPercent100ths: ${position}.`);
|
|
1569
1160
|
}
|
|
1570
|
-
/**
|
|
1571
|
-
* Get a default door lock cluster server.
|
|
1572
|
-
*
|
|
1573
|
-
* @remarks
|
|
1574
|
-
* This method adds a cluster server for a door lock cluster with default settings.
|
|
1575
|
-
*
|
|
1576
|
-
*/
|
|
1577
1161
|
getDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.DeadBolt) {
|
|
1578
1162
|
return ClusterServer(DoorLockCluster, {
|
|
1579
1163
|
operatingMode: DoorLock.OperatingMode.Normal,
|
|
@@ -1596,22 +1180,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1596
1180
|
lockOperationError: true,
|
|
1597
1181
|
});
|
|
1598
1182
|
}
|
|
1599
|
-
/**
|
|
1600
|
-
* Creates a default door lock cluster server.
|
|
1601
|
-
*
|
|
1602
|
-
* @remarks
|
|
1603
|
-
* This method adds a cluster server for a door lock cluster with default settings.
|
|
1604
|
-
*
|
|
1605
|
-
*/
|
|
1606
1183
|
createDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.DeadBolt) {
|
|
1607
1184
|
this.addClusterServer(this.getDefaultDoorLockClusterServer(lockState, lockType));
|
|
1608
1185
|
}
|
|
1609
|
-
/**
|
|
1610
|
-
* Get a default momentary switch cluster server.
|
|
1611
|
-
*
|
|
1612
|
-
* @remarks
|
|
1613
|
-
* This method adds a cluster server with default momentary switch features and configurations suitable for (AppleHome) Single Double Long automations.
|
|
1614
|
-
*/
|
|
1615
1186
|
getDefaultSwitchClusterServer() {
|
|
1616
1187
|
return ClusterServer(SwitchCluster.with(Switch.Feature.MomentarySwitch, Switch.Feature.MomentarySwitchRelease, Switch.Feature.MomentarySwitchLongPress, Switch.Feature.MomentarySwitchMultiPress), {
|
|
1617
1188
|
numberOfPositions: 2,
|
|
@@ -1626,21 +1197,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1626
1197
|
multiPressComplete: true,
|
|
1627
1198
|
});
|
|
1628
1199
|
}
|
|
1629
|
-
/**
|
|
1630
|
-
* Creates a default momentary switch cluster server.
|
|
1631
|
-
*
|
|
1632
|
-
* @remarks
|
|
1633
|
-
* This method adds a cluster server with default momentary switch features and configurations.
|
|
1634
|
-
*/
|
|
1635
1200
|
createDefaultSwitchClusterServer() {
|
|
1636
1201
|
this.addClusterServer(this.getDefaultSwitchClusterServer());
|
|
1637
1202
|
}
|
|
1638
|
-
/**
|
|
1639
|
-
* Get a default latching switch cluster server.
|
|
1640
|
-
*
|
|
1641
|
-
* @remarks
|
|
1642
|
-
* This method adds a cluster server with default latching switch features and configuration.
|
|
1643
|
-
*/
|
|
1644
1203
|
getDefaultLatchingSwitchClusterServer() {
|
|
1645
1204
|
return ClusterServer(SwitchCluster.with(Switch.Feature.LatchingSwitch), {
|
|
1646
1205
|
numberOfPositions: 2,
|
|
@@ -1649,22 +1208,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1649
1208
|
switchLatched: true,
|
|
1650
1209
|
});
|
|
1651
1210
|
}
|
|
1652
|
-
/**
|
|
1653
|
-
* Creates a default latching switch cluster server.
|
|
1654
|
-
*
|
|
1655
|
-
* @remarks
|
|
1656
|
-
* This method adds a cluster server with default latching switch features and configuration.
|
|
1657
|
-
*/
|
|
1658
1211
|
createDefaultLatchingSwitchClusterServer() {
|
|
1659
1212
|
this.addClusterServer(this.getDefaultLatchingSwitchClusterServer());
|
|
1660
1213
|
}
|
|
1661
|
-
/**
|
|
1662
|
-
* Triggers a switch event on the specified endpoint.
|
|
1663
|
-
*
|
|
1664
|
-
* @param {string} event - The type of event to trigger. Possible values are 'Single', 'Double', 'Long' for momentarySwitch and 'Press', 'Release' for latchingSwitch.
|
|
1665
|
-
* @param {Endpoint} endpoint - The endpoint on which to trigger the event (default the device endpoint).
|
|
1666
|
-
* @returns {void}
|
|
1667
|
-
*/
|
|
1668
1214
|
async triggerSwitchEvent(event, log, endpoint) {
|
|
1669
1215
|
if (!endpoint)
|
|
1670
1216
|
endpoint = this;
|
|
@@ -1732,15 +1278,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1732
1278
|
}
|
|
1733
1279
|
return true;
|
|
1734
1280
|
}
|
|
1735
|
-
/**
|
|
1736
|
-
* Retrieves the default mode select cluster server.
|
|
1737
|
-
*
|
|
1738
|
-
* @param description - The description of the cluster server.
|
|
1739
|
-
* @param supportedModes - The supported modes for the cluster server.
|
|
1740
|
-
* @param currentMode - The current mode of the cluster server. Defaults to 0.
|
|
1741
|
-
* @param startUpMode - The startup mode of the cluster server. Defaults to 0.
|
|
1742
|
-
* @returns The default mode select cluster server.
|
|
1743
|
-
*/
|
|
1744
1281
|
getDefaultModeSelectClusterServer(description, supportedModes, currentMode = 0, startUpMode = 0) {
|
|
1745
1282
|
return ClusterServer(ModeSelectCluster, {
|
|
1746
1283
|
description: description,
|
|
@@ -1755,26 +1292,11 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1755
1292
|
},
|
|
1756
1293
|
});
|
|
1757
1294
|
}
|
|
1758
|
-
/**
|
|
1759
|
-
* Creates a default mode select cluster server.
|
|
1760
|
-
*
|
|
1761
|
-
* @param description - The description of the cluster server.
|
|
1762
|
-
* @param supportedModes - The supported modes for the cluster server.
|
|
1763
|
-
* @param currentMode - The current mode of the cluster server. Defaults to 0.
|
|
1764
|
-
* @param startUpMode - The startup mode of the cluster server. Defaults to 0.
|
|
1765
|
-
* @param endpoint - The endpoint to add the cluster server to. Defaults to `this` if not provided.
|
|
1766
|
-
*
|
|
1767
|
-
*/
|
|
1768
1295
|
createDefaultModeSelectClusterServer(description, supportedModes, currentMode = 0, startUpMode = 0, endpoint) {
|
|
1769
1296
|
if (!endpoint)
|
|
1770
1297
|
endpoint = this;
|
|
1771
1298
|
endpoint.addClusterServer(this.getDefaultModeSelectClusterServer(description, supportedModes, currentMode, startUpMode));
|
|
1772
1299
|
}
|
|
1773
|
-
/**
|
|
1774
|
-
* Get a default occupancy sensing cluster server.
|
|
1775
|
-
*
|
|
1776
|
-
* @param occupied - A boolean indicating whether the occupancy is occupied or not. Default is false.
|
|
1777
|
-
*/
|
|
1778
1300
|
getDefaultOccupancySensingClusterServer(occupied = false) {
|
|
1779
1301
|
return ClusterServer(OccupancySensingCluster, {
|
|
1780
1302
|
occupancy: { occupied },
|
|
@@ -1783,19 +1305,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1783
1305
|
pirOccupiedToUnoccupiedDelay: 30,
|
|
1784
1306
|
}, {});
|
|
1785
1307
|
}
|
|
1786
|
-
/**
|
|
1787
|
-
* Creates a default occupancy sensing cluster server.
|
|
1788
|
-
*
|
|
1789
|
-
* @param occupied - A boolean indicating whether the occupancy is occupied or not. Default is false.
|
|
1790
|
-
*/
|
|
1791
1308
|
createDefaultOccupancySensingClusterServer(occupied = false) {
|
|
1792
1309
|
this.addClusterServer(this.getDefaultOccupancySensingClusterServer(occupied));
|
|
1793
1310
|
}
|
|
1794
|
-
/**
|
|
1795
|
-
* Get a default Illuminance Measurement Cluster Server.
|
|
1796
|
-
*
|
|
1797
|
-
* @param measuredValue - The measured value of illuminance.
|
|
1798
|
-
*/
|
|
1799
1311
|
getDefaultIlluminanceMeasurementClusterServer(measuredValue = 0) {
|
|
1800
1312
|
return ClusterServer(IlluminanceMeasurementCluster, {
|
|
1801
1313
|
measuredValue,
|
|
@@ -1804,19 +1316,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1804
1316
|
tolerance: 0,
|
|
1805
1317
|
}, {}, {});
|
|
1806
1318
|
}
|
|
1807
|
-
/**
|
|
1808
|
-
* Creates a default Illuminance Measurement Cluster Server.
|
|
1809
|
-
*
|
|
1810
|
-
* @param measuredValue - The measured value of illuminance.
|
|
1811
|
-
*/
|
|
1812
1319
|
createDefaultIlluminanceMeasurementClusterServer(measuredValue = 0) {
|
|
1813
1320
|
this.addClusterServer(this.getDefaultIlluminanceMeasurementClusterServer(measuredValue));
|
|
1814
1321
|
}
|
|
1815
|
-
/**
|
|
1816
|
-
* Get a default flow measurement cluster server.
|
|
1817
|
-
*
|
|
1818
|
-
* @param measuredValue - The measured value of the flow in 10 x m/h.
|
|
1819
|
-
*/
|
|
1820
1322
|
getDefaultFlowMeasurementClusterServer(measuredValue = 0) {
|
|
1821
1323
|
return ClusterServer(FlowMeasurementCluster, {
|
|
1822
1324
|
measuredValue,
|
|
@@ -1825,19 +1327,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1825
1327
|
tolerance: 0,
|
|
1826
1328
|
}, {}, {});
|
|
1827
1329
|
}
|
|
1828
|
-
/**
|
|
1829
|
-
* Creates a default flow measurement cluster server.
|
|
1830
|
-
*
|
|
1831
|
-
* @param measuredValue - The measured value of the flow in 10 x m/h.
|
|
1832
|
-
*/
|
|
1833
1330
|
createDefaultFlowMeasurementClusterServer(measuredValue = 0) {
|
|
1834
1331
|
this.addClusterServer(this.getDefaultFlowMeasurementClusterServer(measuredValue));
|
|
1835
1332
|
}
|
|
1836
|
-
/**
|
|
1837
|
-
* Get a default temperature measurement cluster server.
|
|
1838
|
-
*
|
|
1839
|
-
* @param measuredValue - The measured value of the temperature x 100.
|
|
1840
|
-
*/
|
|
1841
1333
|
getDefaultTemperatureMeasurementClusterServer(measuredValue = 0) {
|
|
1842
1334
|
return ClusterServer(TemperatureMeasurementCluster, {
|
|
1843
1335
|
measuredValue,
|
|
@@ -1846,19 +1338,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1846
1338
|
tolerance: 0,
|
|
1847
1339
|
}, {}, {});
|
|
1848
1340
|
}
|
|
1849
|
-
/**
|
|
1850
|
-
* Creates a default temperature measurement cluster server.
|
|
1851
|
-
*
|
|
1852
|
-
* @param measuredValue - The measured value of the temperature x 100.
|
|
1853
|
-
*/
|
|
1854
1341
|
createDefaultTemperatureMeasurementClusterServer(measuredValue = 0) {
|
|
1855
1342
|
this.addClusterServer(this.getDefaultTemperatureMeasurementClusterServer(measuredValue));
|
|
1856
1343
|
}
|
|
1857
|
-
/**
|
|
1858
|
-
* Get a default RelativeHumidityMeasurementCluster server.
|
|
1859
|
-
*
|
|
1860
|
-
* @param measuredValue - The measured value of the relative humidity x 100.
|
|
1861
|
-
*/
|
|
1862
1344
|
getDefaultRelativeHumidityMeasurementClusterServer(measuredValue = 0) {
|
|
1863
1345
|
return ClusterServer(RelativeHumidityMeasurementCluster, {
|
|
1864
1346
|
measuredValue,
|
|
@@ -1867,19 +1349,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1867
1349
|
tolerance: 0,
|
|
1868
1350
|
}, {}, {});
|
|
1869
1351
|
}
|
|
1870
|
-
/**
|
|
1871
|
-
* Creates a default RelativeHumidityMeasurementCluster server.
|
|
1872
|
-
*
|
|
1873
|
-
* @param measuredValue - The measured value of the relative humidity x 100.
|
|
1874
|
-
*/
|
|
1875
1352
|
createDefaultRelativeHumidityMeasurementClusterServer(measuredValue = 0) {
|
|
1876
1353
|
this.addClusterServer(this.getDefaultRelativeHumidityMeasurementClusterServer(measuredValue));
|
|
1877
1354
|
}
|
|
1878
|
-
/**
|
|
1879
|
-
* Get a default Pressure Measurement Cluster Server.
|
|
1880
|
-
*
|
|
1881
|
-
* @param measuredValue - The measured value for the pressure.
|
|
1882
|
-
*/
|
|
1883
1355
|
getDefaultPressureMeasurementClusterServer(measuredValue = 1000) {
|
|
1884
1356
|
return ClusterServer(PressureMeasurementCluster, {
|
|
1885
1357
|
measuredValue,
|
|
@@ -1888,39 +1360,19 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1888
1360
|
tolerance: 0,
|
|
1889
1361
|
}, {}, {});
|
|
1890
1362
|
}
|
|
1891
|
-
/**
|
|
1892
|
-
* Creates a default Pressure Measurement Cluster Server.
|
|
1893
|
-
*
|
|
1894
|
-
* @param measuredValue - The measured value for the pressure.
|
|
1895
|
-
*/
|
|
1896
1363
|
createDefaultPressureMeasurementClusterServer(measuredValue = 1000) {
|
|
1897
1364
|
this.addClusterServer(this.getDefaultPressureMeasurementClusterServer(measuredValue));
|
|
1898
1365
|
}
|
|
1899
|
-
/**
|
|
1900
|
-
* Get a default boolean state cluster server.
|
|
1901
|
-
*
|
|
1902
|
-
* @param contact - Optional boolean value indicating the contact state. Defaults to `true` if not provided.
|
|
1903
|
-
*/
|
|
1904
1366
|
getDefaultBooleanStateClusterServer(contact) {
|
|
1905
1367
|
return ClusterServer(BooleanStateCluster, {
|
|
1906
|
-
stateValue: contact ?? true,
|
|
1368
|
+
stateValue: contact ?? true,
|
|
1907
1369
|
}, {}, {
|
|
1908
1370
|
stateChange: true,
|
|
1909
1371
|
});
|
|
1910
1372
|
}
|
|
1911
|
-
/**
|
|
1912
|
-
* Creates a default boolean state configuration cluster server.
|
|
1913
|
-
*
|
|
1914
|
-
* @param contact - Optional boolean value indicating the contact state. Defaults to `true` if not provided.
|
|
1915
|
-
*/
|
|
1916
1373
|
createDefaultBooleanStateClusterServer(contact) {
|
|
1917
1374
|
this.addClusterServer(this.getDefaultBooleanStateClusterServer(contact));
|
|
1918
1375
|
}
|
|
1919
|
-
/**
|
|
1920
|
-
* Get a default boolean state configuration cluster server.
|
|
1921
|
-
*
|
|
1922
|
-
* @param contact - Optional boolean value indicating the sensor fault state. Defaults to `false` if not provided.
|
|
1923
|
-
*/
|
|
1924
1376
|
getDefaultBooleanStateConfigurationClusterServer(sensorFault = false) {
|
|
1925
1377
|
return ClusterServer(BooleanStateConfigurationCluster.with(BooleanStateConfiguration.Feature.Visual, BooleanStateConfiguration.Feature.Audible, BooleanStateConfiguration.Feature.SensitivityLevel), {
|
|
1926
1378
|
currentSensitivityLevel: 0,
|
|
@@ -1929,7 +1381,6 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1929
1381
|
alarmsActive: { visual: false, audible: false },
|
|
1930
1382
|
alarmsEnabled: { visual: false, audible: false },
|
|
1931
1383
|
alarmsSupported: { visual: true, audible: true },
|
|
1932
|
-
// alarmsSuppressed: { visual: false, audible: false },
|
|
1933
1384
|
sensorFault: { generalFault: sensorFault },
|
|
1934
1385
|
}, {
|
|
1935
1386
|
enableDisableAlarm: async (data) => {
|
|
@@ -1941,23 +1392,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1941
1392
|
sensorFault: true,
|
|
1942
1393
|
});
|
|
1943
1394
|
}
|
|
1944
|
-
/**
|
|
1945
|
-
* Creates a default boolean state configuration cluster server.
|
|
1946
|
-
*
|
|
1947
|
-
* @param contact - Optional boolean value indicating the sensor fault state. Defaults to `false` if not provided.
|
|
1948
|
-
*/
|
|
1949
1395
|
createDefaultBooleanStateConfigurationClusterServer(sensorFault = false) {
|
|
1950
1396
|
this.addClusterServer(this.getDefaultBooleanStateConfigurationClusterServer(sensorFault));
|
|
1951
1397
|
}
|
|
1952
|
-
/**
|
|
1953
|
-
* Get a default power source replaceable battery cluster server.
|
|
1954
|
-
*
|
|
1955
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
1956
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
1957
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
1958
|
-
* @param batReplacementDescription - The battery replacement description (default: 'Battery type').
|
|
1959
|
-
* @param batQuantity - The battery quantity (default: 1).
|
|
1960
|
-
*/
|
|
1961
1398
|
getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplacementDescription = 'Battery type', batQuantity = 1) {
|
|
1962
1399
|
return ClusterServer(PowerSourceCluster.with(PowerSource.Feature.Battery, PowerSource.Feature.Replaceable), {
|
|
1963
1400
|
status: PowerSource.PowerSourceStatus.Active,
|
|
@@ -1974,25 +1411,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1974
1411
|
endpointList: [],
|
|
1975
1412
|
}, {}, {});
|
|
1976
1413
|
}
|
|
1977
|
-
/**
|
|
1978
|
-
* Creates a default power source replaceable battery cluster server.
|
|
1979
|
-
*
|
|
1980
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
1981
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
1982
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
1983
|
-
* @param batReplacementDescription - The battery replacement description (default: 'Battery type').
|
|
1984
|
-
* @param batQuantity - The battery quantity (default: 1).
|
|
1985
|
-
*/
|
|
1986
1414
|
createDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplacementDescription = 'Battery type', batQuantity = 1) {
|
|
1987
1415
|
this.addClusterServer(this.getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining, batChargeLevel, batVoltage, batReplacementDescription, batQuantity));
|
|
1988
1416
|
}
|
|
1989
|
-
/**
|
|
1990
|
-
* Get a default power source rechargeable battery cluster server.
|
|
1991
|
-
*
|
|
1992
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
1993
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
1994
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
1995
|
-
*/
|
|
1996
1417
|
getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500) {
|
|
1997
1418
|
return ClusterServer(PowerSourceCluster.with(PowerSource.Feature.Battery, PowerSource.Feature.Rechargeable), {
|
|
1998
1419
|
status: PowerSource.PowerSourceStatus.Active,
|
|
@@ -2010,21 +1431,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2010
1431
|
endpointList: [],
|
|
2011
1432
|
}, {}, {});
|
|
2012
1433
|
}
|
|
2013
|
-
/**
|
|
2014
|
-
* Creates a default power source rechargeable battery cluster server.
|
|
2015
|
-
*
|
|
2016
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
2017
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
2018
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
2019
|
-
*/
|
|
2020
1434
|
createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500) {
|
|
2021
1435
|
this.addClusterServer(this.getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, batVoltage));
|
|
2022
1436
|
}
|
|
2023
|
-
/**
|
|
2024
|
-
* Get a default power source wired cluster server.
|
|
2025
|
-
*
|
|
2026
|
-
* @param wiredCurrentType - The type of wired current (default: PowerSource.WiredCurrentType.Ac)
|
|
2027
|
-
*/
|
|
2028
1437
|
getDefaultPowerSourceWiredClusterServer(wiredCurrentType = PowerSource.WiredCurrentType.Ac) {
|
|
2029
1438
|
return ClusterServer(PowerSourceCluster.with(PowerSource.Feature.Wired), {
|
|
2030
1439
|
wiredCurrentType,
|
|
@@ -2034,45 +1443,22 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2034
1443
|
endpointList: [],
|
|
2035
1444
|
}, {}, {});
|
|
2036
1445
|
}
|
|
2037
|
-
/**
|
|
2038
|
-
* Creates a default power source wired cluster server.
|
|
2039
|
-
*
|
|
2040
|
-
* @param wiredCurrentType - The type of wired current (default: PowerSource.WiredCurrentType.Ac)
|
|
2041
|
-
*/
|
|
2042
1446
|
createDefaultPowerSourceWiredClusterServer(wiredCurrentType = PowerSource.WiredCurrentType.Ac) {
|
|
2043
1447
|
this.addClusterServer(this.getDefaultPowerSourceWiredClusterServer(wiredCurrentType));
|
|
2044
1448
|
}
|
|
2045
|
-
/**
|
|
2046
|
-
* @deprecated This function is deprecated by Matter 1.3 spec and will be removed in a future version.
|
|
2047
|
-
*/
|
|
2048
1449
|
createDefaultPowerSourceConfigurationClusterServer(endpointNumber) {
|
|
2049
1450
|
this.addClusterServer(ClusterServer(PowerSourceConfigurationCluster, {
|
|
2050
1451
|
sources: endpointNumber ? [EndpointNumber(endpointNumber)] : [],
|
|
2051
1452
|
}, {}, {}));
|
|
2052
1453
|
}
|
|
2053
|
-
/**
|
|
2054
|
-
* Get a default air quality cluster server.
|
|
2055
|
-
*
|
|
2056
|
-
* @param airQuality The air quality type. Defaults to `AirQuality.AirQualityType.Unknown`.
|
|
2057
|
-
*/
|
|
2058
1454
|
getDefaultAirQualityClusterServer(airQuality = AirQuality.AirQualityEnum.Unknown) {
|
|
2059
1455
|
return ClusterServer(AirQualityCluster.with(AirQuality.Feature.Fair, AirQuality.Feature.Moderate, AirQuality.Feature.VeryPoor, AirQuality.Feature.ExtremelyPoor), {
|
|
2060
1456
|
airQuality,
|
|
2061
1457
|
}, {}, {});
|
|
2062
1458
|
}
|
|
2063
|
-
/**
|
|
2064
|
-
* Creates a default air quality cluster server.
|
|
2065
|
-
*
|
|
2066
|
-
* @param airQuality The air quality type. Defaults to `AirQuality.AirQualityType.Unknown`.
|
|
2067
|
-
*/
|
|
2068
1459
|
createDefaultAirQualityClusterServer(airQuality = AirQuality.AirQualityEnum.Unknown) {
|
|
2069
1460
|
this.addClusterServer(this.getDefaultAirQualityClusterServer(airQuality));
|
|
2070
1461
|
}
|
|
2071
|
-
/**
|
|
2072
|
-
* Get a default TVOC measurement cluster server.
|
|
2073
|
-
*
|
|
2074
|
-
* @param measuredValue - The measured value for TVOC.
|
|
2075
|
-
*/
|
|
2076
1462
|
getDefaultTvocMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2077
1463
|
return ClusterServer(TotalVolatileOrganicCompoundsConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2078
1464
|
measuredValue,
|
|
@@ -2083,28 +1469,14 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2083
1469
|
measurementMedium,
|
|
2084
1470
|
}, {}, {});
|
|
2085
1471
|
}
|
|
2086
|
-
/**
|
|
2087
|
-
* Creates a default TVOC measurement cluster server.
|
|
2088
|
-
*
|
|
2089
|
-
* @param measuredValue - The measured value for TVOC.
|
|
2090
|
-
*/
|
|
2091
1472
|
createDefaultTvocMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2092
1473
|
this.addClusterServer(this.getDefaultTvocMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2093
1474
|
}
|
|
2094
|
-
/**
|
|
2095
|
-
* Get a default heating thermostat cluster server with the specified parameters.
|
|
2096
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2097
|
-
* @param {number} [occupiedHeatingSetpoint] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2098
|
-
* @param {number} [minHeatSetpointLimit] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2099
|
-
* @param {number} [maxHeatSetpointLimit] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2100
|
-
* @returns {ThermostatClusterServer} A default thermostat cluster server configured with the specified parameters.
|
|
2101
|
-
*/
|
|
2102
1475
|
getDefaultHeatingThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 21, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50) {
|
|
2103
1476
|
return ClusterServer(ThermostatCluster.with(Thermostat.Feature.Heating), {
|
|
2104
1477
|
localTemperature: localTemperature * 100,
|
|
2105
1478
|
systemMode: Thermostat.SystemMode.Heat,
|
|
2106
1479
|
controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation.HeatingOnly,
|
|
2107
|
-
// Thermostat.Feature.Heating
|
|
2108
1480
|
occupiedHeatingSetpoint: occupiedHeatingSetpoint * 100,
|
|
2109
1481
|
minHeatSetpointLimit: minHeatSetpointLimit * 100,
|
|
2110
1482
|
maxHeatSetpointLimit: maxHeatSetpointLimit * 100,
|
|
@@ -2117,31 +1489,14 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2117
1489
|
},
|
|
2118
1490
|
}, {});
|
|
2119
1491
|
}
|
|
2120
|
-
/**
|
|
2121
|
-
* Creates and adds a default heating thermostat cluster server to the device.
|
|
2122
|
-
*
|
|
2123
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2124
|
-
* @param {number} [occupiedHeatingSetpoint] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2125
|
-
* @param {number} [minHeatSetpointLimit] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2126
|
-
* @param {number} [maxHeatSetpointLimit] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2127
|
-
*/
|
|
2128
1492
|
createDefaultHeatingThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 25, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50) {
|
|
2129
1493
|
this.addClusterServer(this.getDefaultHeatingThermostatClusterServer(localTemperature, occupiedHeatingSetpoint, minHeatSetpointLimit, maxHeatSetpointLimit));
|
|
2130
1494
|
}
|
|
2131
|
-
/**
|
|
2132
|
-
* Get a default cooling thermostat cluster server with the specified parameters.
|
|
2133
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2134
|
-
* @param {number} [occupiedCoolingSetpoint] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2135
|
-
* @param {number} [minCoolSetpointLimit] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2136
|
-
* @param {number} [maxCoolSetpointLimit] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2137
|
-
* @returns {ThermostatClusterServer} A default thermostat cluster server configured with the specified parameters.
|
|
2138
|
-
*/
|
|
2139
1495
|
getDefaultCoolingThermostatClusterServer(localTemperature = 23, occupiedCoolingSetpoint = 25, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2140
1496
|
return ClusterServer(ThermostatCluster.with(Thermostat.Feature.Cooling), {
|
|
2141
1497
|
localTemperature: localTemperature * 100,
|
|
2142
1498
|
systemMode: Thermostat.SystemMode.Cool,
|
|
2143
1499
|
controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation.CoolingOnly,
|
|
2144
|
-
// Thermostat.Feature.Cooling
|
|
2145
1500
|
occupiedCoolingSetpoint: occupiedCoolingSetpoint * 100,
|
|
2146
1501
|
minCoolSetpointLimit: minCoolSetpointLimit * 100,
|
|
2147
1502
|
maxCoolSetpointLimit: maxCoolSetpointLimit * 100,
|
|
@@ -2154,48 +1509,24 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2154
1509
|
},
|
|
2155
1510
|
}, {});
|
|
2156
1511
|
}
|
|
2157
|
-
/**
|
|
2158
|
-
* Creates and adds a default cooling thermostat cluster server to the device.
|
|
2159
|
-
*
|
|
2160
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2161
|
-
* @param {number} [occupiedCoolingSetpoint] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2162
|
-
* @param {number} [minCoolSetpointLimit] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2163
|
-
* @param {number} [maxCoolSetpointLimit] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2164
|
-
*/
|
|
2165
1512
|
createDefaultCoolingThermostatClusterServer(localTemperature = 23, occupiedCoolingSetpoint = 25, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2166
1513
|
this.addClusterServer(this.getDefaultCoolingThermostatClusterServer(localTemperature, occupiedCoolingSetpoint, minCoolSetpointLimit, maxCoolSetpointLimit));
|
|
2167
1514
|
}
|
|
2168
|
-
/**
|
|
2169
|
-
* Get a default thermostat cluster server with the specified parameters.
|
|
2170
|
-
*
|
|
2171
|
-
* @param {number} [localTemperature=23] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2172
|
-
* @param {number} [occupiedHeatingSetpoint=21] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2173
|
-
* @param {number} [occupiedCoolingSetpoint=25] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2174
|
-
* @param {number} [minSetpointDeadBand=1] - The minimum setpoint dead band value. Defaults to 1°.
|
|
2175
|
-
* @param {number} [minHeatSetpointLimit=0] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2176
|
-
* @param {number} [maxHeatSetpointLimit=50] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2177
|
-
* @param {number} [minCoolSetpointLimit=0] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2178
|
-
* @param {number} [maxCoolSetpointLimit=50] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2179
|
-
* @returns {ThermostatClusterServer} A default thermostat cluster server configured with the specified parameters.
|
|
2180
|
-
*/
|
|
2181
1515
|
getDefaultThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 21, occupiedCoolingSetpoint = 25, minSetpointDeadBand = 1, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2182
1516
|
return ClusterServer(ThermostatCluster.with(Thermostat.Feature.Heating, Thermostat.Feature.Cooling, Thermostat.Feature.AutoMode), {
|
|
2183
1517
|
localTemperature: localTemperature * 100,
|
|
2184
1518
|
systemMode: Thermostat.SystemMode.Auto,
|
|
2185
1519
|
controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation.CoolingAndHeating,
|
|
2186
|
-
// Thermostat.Feature.Heating
|
|
2187
1520
|
occupiedHeatingSetpoint: occupiedHeatingSetpoint * 100,
|
|
2188
1521
|
minHeatSetpointLimit: minHeatSetpointLimit * 100,
|
|
2189
1522
|
maxHeatSetpointLimit: maxHeatSetpointLimit * 100,
|
|
2190
1523
|
absMinHeatSetpointLimit: minHeatSetpointLimit * 100,
|
|
2191
1524
|
absMaxHeatSetpointLimit: maxHeatSetpointLimit * 100,
|
|
2192
|
-
// Thermostat.Feature.Cooling
|
|
2193
1525
|
occupiedCoolingSetpoint: occupiedCoolingSetpoint * 100,
|
|
2194
1526
|
minCoolSetpointLimit: minCoolSetpointLimit * 100,
|
|
2195
1527
|
maxCoolSetpointLimit: maxCoolSetpointLimit * 100,
|
|
2196
1528
|
absMinCoolSetpointLimit: minCoolSetpointLimit * 100,
|
|
2197
1529
|
absMaxCoolSetpointLimit: maxCoolSetpointLimit * 100,
|
|
2198
|
-
// Thermostat.Feature.AutoMode
|
|
2199
1530
|
minSetpointDeadBand: minSetpointDeadBand * 100,
|
|
2200
1531
|
thermostatRunningMode: Thermostat.ThermostatRunningMode.Off,
|
|
2201
1532
|
}, {
|
|
@@ -2205,28 +1536,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2205
1536
|
},
|
|
2206
1537
|
}, {});
|
|
2207
1538
|
}
|
|
2208
|
-
/**
|
|
2209
|
-
* Creates and adds a default thermostat cluster server to the device.
|
|
2210
|
-
*
|
|
2211
|
-
* @param {number} [localTemperature=23] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2212
|
-
* @param {number} [occupiedHeatingSetpoint=21] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2213
|
-
* @param {number} [occupiedCoolingSetpoint=25] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2214
|
-
* @param {number} [minSetpointDeadBand=1] - The minimum setpoint dead band value. Defaults to 1°.
|
|
2215
|
-
* @param {number} [minHeatSetpointLimit=0] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2216
|
-
* @param {number} [maxHeatSetpointLimit=50] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2217
|
-
* @param {number} [minCoolSetpointLimit=0] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2218
|
-
* @param {number} [maxCoolSetpointLimit=50] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2219
|
-
*/
|
|
2220
1539
|
createDefaultThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 21, occupiedCoolingSetpoint = 25, minSetpointDeadBand = 1, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2221
1540
|
this.addClusterServer(this.getDefaultThermostatClusterServer(localTemperature, occupiedHeatingSetpoint, occupiedCoolingSetpoint, minSetpointDeadBand, minHeatSetpointLimit, maxHeatSetpointLimit, minCoolSetpointLimit, maxCoolSetpointLimit));
|
|
2222
1541
|
}
|
|
2223
|
-
/**
|
|
2224
|
-
* Returns the default SmokeCOAlarm Cluster Server.
|
|
2225
|
-
*
|
|
2226
|
-
* @param smokeState - The state of the smoke alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2227
|
-
* @param coState - The state of the CO alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2228
|
-
* @returns The default SmokeCOAlarmClusterServer.
|
|
2229
|
-
*/
|
|
2230
1542
|
getDefaultSmokeCOAlarmClusterServer(smokeState = SmokeCoAlarm.AlarmState.Normal, coState = SmokeCoAlarm.AlarmState.Normal) {
|
|
2231
1543
|
return ClusterServer(SmokeCoAlarmCluster.with(SmokeCoAlarm.Feature.SmokeAlarm, SmokeCoAlarm.Feature.CoAlarm), {
|
|
2232
1544
|
smokeState,
|
|
@@ -2258,24 +1570,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2258
1570
|
allClear: true,
|
|
2259
1571
|
});
|
|
2260
1572
|
}
|
|
2261
|
-
/**
|
|
2262
|
-
* Create the default SmokeCOAlarm Cluster Server.
|
|
2263
|
-
*
|
|
2264
|
-
* @param smokeState - The state of the smoke alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2265
|
-
* @param coState - The state of the CO alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2266
|
-
* @returns The default SmokeCOAlarmClusterServer.
|
|
2267
|
-
*/
|
|
2268
1573
|
createDefaultSmokeCOAlarmClusterServer(smokeState = SmokeCoAlarm.AlarmState.Normal, coState = SmokeCoAlarm.AlarmState.Normal) {
|
|
2269
1574
|
this.addClusterServer(this.getDefaultSmokeCOAlarmClusterServer(smokeState, coState));
|
|
2270
1575
|
}
|
|
2271
|
-
/**
|
|
2272
|
-
* Returns the default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2273
|
-
*
|
|
2274
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2275
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2276
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2277
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2278
|
-
*/
|
|
2279
1576
|
getDefaultCarbonMonoxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2280
1577
|
return ClusterServer(CarbonMonoxideConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2281
1578
|
measuredValue,
|
|
@@ -2286,24 +1583,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2286
1583
|
measurementMedium,
|
|
2287
1584
|
}, {}, {});
|
|
2288
1585
|
}
|
|
2289
|
-
/**
|
|
2290
|
-
* Create the default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2291
|
-
*
|
|
2292
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2293
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2294
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2295
|
-
*/
|
|
2296
1586
|
createDefaultCarbonMonoxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2297
1587
|
this.addClusterServer(this.getDefaultCarbonMonoxideConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2298
1588
|
}
|
|
2299
|
-
/**
|
|
2300
|
-
* Returns the default Carbon Dioxide Concentration Measurement Cluster Server.
|
|
2301
|
-
*
|
|
2302
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2303
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2304
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2305
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2306
|
-
*/
|
|
2307
1589
|
getDefaultCarbonDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2308
1590
|
return ClusterServer(CarbonDioxideConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2309
1591
|
measuredValue,
|
|
@@ -2314,24 +1596,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2314
1596
|
measurementMedium,
|
|
2315
1597
|
}, {}, {});
|
|
2316
1598
|
}
|
|
2317
|
-
/**
|
|
2318
|
-
* Create the default Carbon Dioxide Concentration Measurement Cluster Server.
|
|
2319
|
-
*
|
|
2320
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2321
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2322
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2323
|
-
*/
|
|
2324
1599
|
createDefaultCarbonDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2325
1600
|
this.addClusterServer(this.getDefaultCarbonDioxideConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2326
1601
|
}
|
|
2327
|
-
/**
|
|
2328
|
-
* Returns the default Formaldehyde Concentration Measurement Cluster Server.
|
|
2329
|
-
*
|
|
2330
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2331
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2332
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2333
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2334
|
-
*/
|
|
2335
1602
|
getDefaultFormaldehydeConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2336
1603
|
return ClusterServer(FormaldehydeConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2337
1604
|
measuredValue,
|
|
@@ -2342,24 +1609,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2342
1609
|
measurementMedium,
|
|
2343
1610
|
}, {}, {});
|
|
2344
1611
|
}
|
|
2345
|
-
/**
|
|
2346
|
-
* Create the default Formaldehyde Concentration Measurement Cluster Server.
|
|
2347
|
-
*
|
|
2348
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2349
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2350
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2351
|
-
*/
|
|
2352
1612
|
createDefaultFormaldehydeConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2353
1613
|
this.addClusterServer(this.getDefaultFormaldehydeConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2354
1614
|
}
|
|
2355
|
-
/**
|
|
2356
|
-
* Returns the default Pm1 Concentration Measurement Cluster Server.
|
|
2357
|
-
*
|
|
2358
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2359
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2360
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2361
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2362
|
-
*/
|
|
2363
1615
|
getDefaultPm1ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2364
1616
|
return ClusterServer(Pm1ConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2365
1617
|
measuredValue,
|
|
@@ -2370,24 +1622,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2370
1622
|
measurementMedium,
|
|
2371
1623
|
}, {}, {});
|
|
2372
1624
|
}
|
|
2373
|
-
/**
|
|
2374
|
-
* Create the default Pm1 Concentration Measurement Cluster Server.
|
|
2375
|
-
*
|
|
2376
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2377
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2378
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2379
|
-
*/
|
|
2380
1625
|
createDefaulPm1ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2381
1626
|
this.addClusterServer(this.getDefaultPm1ConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2382
1627
|
}
|
|
2383
|
-
/**
|
|
2384
|
-
* Returns the default Pm25 Concentration Measurement Cluster Server.
|
|
2385
|
-
*
|
|
2386
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2387
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2388
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2389
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2390
|
-
*/
|
|
2391
1628
|
getDefaultPm25ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2392
1629
|
return ClusterServer(Pm25ConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2393
1630
|
measuredValue,
|
|
@@ -2398,24 +1635,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2398
1635
|
measurementMedium,
|
|
2399
1636
|
}, {}, {});
|
|
2400
1637
|
}
|
|
2401
|
-
/**
|
|
2402
|
-
* Create the default Pm25 Concentration Measurement Cluster Server.
|
|
2403
|
-
*
|
|
2404
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2405
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2406
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2407
|
-
*/
|
|
2408
1638
|
createDefaulPm25ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2409
1639
|
this.addClusterServer(this.getDefaultPm25ConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2410
1640
|
}
|
|
2411
|
-
/**
|
|
2412
|
-
* Returns the default Pm10 Concentration Measurement Cluster Server.
|
|
2413
|
-
*
|
|
2414
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2415
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2416
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2417
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2418
|
-
*/
|
|
2419
1641
|
getDefaultPm10ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2420
1642
|
return ClusterServer(Pm10ConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2421
1643
|
measuredValue,
|
|
@@ -2426,24 +1648,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2426
1648
|
measurementMedium,
|
|
2427
1649
|
}, {}, {});
|
|
2428
1650
|
}
|
|
2429
|
-
/**
|
|
2430
|
-
* Create the default Pm10 Concentration Measurement Cluster Server.
|
|
2431
|
-
*
|
|
2432
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2433
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2434
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2435
|
-
*/
|
|
2436
1651
|
createDefaulPm10ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2437
1652
|
this.addClusterServer(this.getDefaultPm10ConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2438
1653
|
}
|
|
2439
|
-
/**
|
|
2440
|
-
* Returns the default Ozone Concentration Measurement Cluster Server.
|
|
2441
|
-
*
|
|
2442
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2443
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2444
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2445
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2446
|
-
*/
|
|
2447
1654
|
getDefaultOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2448
1655
|
return ClusterServer(OzoneConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2449
1656
|
measuredValue,
|
|
@@ -2454,24 +1661,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2454
1661
|
measurementMedium,
|
|
2455
1662
|
}, {}, {});
|
|
2456
1663
|
}
|
|
2457
|
-
/**
|
|
2458
|
-
* Create the default Ozone Concentration Measurement Cluster Server.
|
|
2459
|
-
*
|
|
2460
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2461
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2462
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2463
|
-
*/
|
|
2464
1664
|
createDefaulOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2465
1665
|
this.addClusterServer(this.getDefaultOzoneConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2466
1666
|
}
|
|
2467
|
-
/**
|
|
2468
|
-
* Returns the default Radon Concentration Measurement Cluster Server.
|
|
2469
|
-
*
|
|
2470
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2471
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2472
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2473
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2474
|
-
*/
|
|
2475
1667
|
getDefaultRadonConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2476
1668
|
return ClusterServer(RadonConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2477
1669
|
measuredValue,
|
|
@@ -2482,24 +1674,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2482
1674
|
measurementMedium,
|
|
2483
1675
|
}, {}, {});
|
|
2484
1676
|
}
|
|
2485
|
-
/**
|
|
2486
|
-
* Create the default Radon Concentration Measurement Cluster Server.
|
|
2487
|
-
*
|
|
2488
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2489
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2490
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2491
|
-
*/
|
|
2492
1677
|
createDefaulRadonConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2493
1678
|
this.addClusterServer(this.getDefaultRadonConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2494
1679
|
}
|
|
2495
|
-
/**
|
|
2496
|
-
* Returns the default Nitrogen Dioxide Concentration Measurement Cluster Server.
|
|
2497
|
-
*
|
|
2498
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2499
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2500
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2501
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2502
|
-
*/
|
|
2503
1680
|
getDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2504
1681
|
return ClusterServer(NitrogenDioxideConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2505
1682
|
measuredValue,
|
|
@@ -2510,22 +1687,9 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2510
1687
|
measurementMedium,
|
|
2511
1688
|
}, {}, {});
|
|
2512
1689
|
}
|
|
2513
|
-
/**
|
|
2514
|
-
* Create the default Nitrogen Dioxide Concentration Measurement Cluster Server.
|
|
2515
|
-
*
|
|
2516
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2517
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2518
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2519
|
-
*/
|
|
2520
1690
|
createDefaulNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2521
1691
|
this.addClusterServer(this.getDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2522
1692
|
}
|
|
2523
|
-
/**
|
|
2524
|
-
* Returns the default fan control cluster server rev 2.
|
|
2525
|
-
*
|
|
2526
|
-
* @param fanMode The fan mode to set. Defaults to `FanControl.FanMode.Off`.
|
|
2527
|
-
* @returns The default fan control cluster server.
|
|
2528
|
-
*/
|
|
2529
1693
|
getDefaultFanControlClusterServer(fanMode = FanControl.FanMode.Off) {
|
|
2530
1694
|
return ClusterServer(FanControlCluster.with(FanControl.Feature.MultiSpeed, FanControl.Feature.Auto, FanControl.Feature.Step), {
|
|
2531
1695
|
fanMode,
|
|
@@ -2542,14 +1706,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
2542
1706
|
},
|
|
2543
1707
|
}, {});
|
|
2544
1708
|
}
|
|
2545
|
-
/**
|
|
2546
|
-
* Create the default fan control cluster server rev 2.
|
|
2547
|
-
*
|
|
2548
|
-
* @param fanMode The fan mode to set. Defaults to `FanControl.FanMode.Off`.
|
|
2549
|
-
* @returns The default fan control cluster server.
|
|
2550
|
-
*/
|
|
2551
1709
|
createDefaultFanControlClusterServer(fanMode = FanControl.FanMode.Off) {
|
|
2552
1710
|
this.addClusterServer(this.getDefaultFanControlClusterServer(fanMode));
|
|
2553
1711
|
}
|
|
2554
1712
|
}
|
|
2555
|
-
//# sourceMappingURL=matterbridgeEndpoint.js.map
|