matterbridge 1.6.8-dev.2 → 1.6.8-dev.5
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 +8 -7
- package/README.md +1 -1
- package/dist/cli.js +0 -26
- package/dist/cluster/export.js +0 -2
- package/dist/defaultConfigSchema.js +3 -24
- 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 +167 -660
- package/dist/matterbridgeAccessoryPlatform.js +0 -33
- package/dist/matterbridgeBehaviors.js +1 -29
- package/dist/matterbridgeDevice.js +9 -995
- package/dist/matterbridgeDeviceTypes.js +11 -82
- package/dist/matterbridgeDynamicPlatform.js +0 -33
- package/dist/matterbridgeEdge.js +2 -531
- package/dist/matterbridgeEndpoint.js +11 -1120
- package/dist/matterbridgePlatform.js +11 -91
- package/dist/matterbridgeTypes.js +0 -24
- package/dist/matterbridgeWebsocket.js +0 -45
- package/dist/pluginManager.js +3 -238
- package/dist/storage/export.js +0 -1
- package/dist/utils/colorUtils.js +2 -205
- package/dist/utils/export.js +0 -1
- package/dist/utils/utils.js +7 -252
- package/npm-shrinkwrap.json +6 -6
- package/package.json +1 -1
- 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 -116
- package/dist/matterbridgeBehaviors.d.ts.map +0 -1
- package/dist/matterbridgeBehaviors.js.map +0 -1
- package/dist/matterbridgeDevice.d.ts +0 -1142
- package/dist/matterbridgeDevice.d.ts.map +0 -1
- package/dist/matterbridgeDevice.js.map +0 -1
- package/dist/matterbridgeDeviceTypes.d.ts +0 -109
- 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 -90
- package/dist/matterbridgeEdge.d.ts.map +0 -1
- package/dist/matterbridgeEdge.js.map +0 -1
- package/dist/matterbridgeEndpoint.d.ts +0 -1134
- package/dist/matterbridgeEndpoint.d.ts.map +0 -1
- package/dist/matterbridgeEndpoint.js.map +0 -1
- package/dist/matterbridgePlatform.d.ts +0 -114
- 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
|
@@ -1,41 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class MatterbridgeDevice.
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgeDevice.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2023-12-29
|
|
7
|
-
* @version 2.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
|
-
// @matter
|
|
24
1
|
import { AirQuality, AirQualityCluster, BasicInformationCluster, BooleanState, BooleanStateCluster, BooleanStateConfiguration, BooleanStateConfigurationCluster, BridgedDeviceBasicInformationCluster, CarbonDioxideConcentrationMeasurement, CarbonDioxideConcentrationMeasurementCluster, CarbonMonoxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurementCluster, ColorControl, ColorControlCluster, ConcentrationMeasurement, Descriptor, DescriptorCluster, DeviceEnergyManagement, DeviceEnergyManagementCluster, DeviceEnergyManagementMode, DeviceEnergyManagementModeCluster, DoorLock, DoorLockCluster, ElectricalEnergyMeasurement, ElectricalEnergyMeasurementCluster, ElectricalPowerMeasurement, ElectricalPowerMeasurementCluster, FanControl, FanControlCluster, FlowMeasurement, FlowMeasurementCluster, FormaldehydeConcentrationMeasurement, FormaldehydeConcentrationMeasurementCluster, Groups, GroupsCluster, Identify, IdentifyCluster, IlluminanceMeasurement, IlluminanceMeasurementCluster, LevelControl, LevelControlCluster, ModeSelectCluster, NitrogenDioxideConcentrationMeasurement, NitrogenDioxideConcentrationMeasurementCluster, OccupancySensing, OccupancySensingCluster, OnOff, OnOffCluster, OzoneConcentrationMeasurement, OzoneConcentrationMeasurementCluster, Pm10ConcentrationMeasurement, Pm10ConcentrationMeasurementCluster, Pm1ConcentrationMeasurement, Pm1ConcentrationMeasurementCluster, Pm25ConcentrationMeasurement, Pm25ConcentrationMeasurementCluster, PowerSource, PowerSourceCluster, PowerSourceConfigurationCluster, PowerTopology, PowerTopologyCluster, PressureMeasurement, PressureMeasurementCluster, PumpConfigurationAndControl, PumpConfigurationAndControlCluster, RadonConcentrationMeasurement, RadonConcentrationMeasurementCluster, RelativeHumidityMeasurement, RelativeHumidityMeasurementCluster, SmokeCoAlarm, SmokeCoAlarmCluster, Switch, SwitchCluster, TemperatureMeasurement, TemperatureMeasurementCluster, Thermostat, ThermostatCluster, ThreadNetworkDiagnostics, ThreadNetworkDiagnosticsCluster, TimeSynchronization, TimeSynchronizationCluster, TotalVolatileOrganicCompoundsConcentrationMeasurement, TotalVolatileOrganicCompoundsConcentrationMeasurementCluster, ValveConfigurationAndControl, ValveConfigurationAndControlCluster, WindowCovering, WindowCoveringCluster, } from '@matter/main/clusters';
|
|
25
2
|
import { Specification } from '@matter/main/model';
|
|
26
3
|
import { EndpointNumber, extendPublicHandlerMethods, VendorId } from '@matter/main';
|
|
27
4
|
import { MeasurementType, getClusterNameById } from '@matter/main/types';
|
|
28
|
-
// @project-chip
|
|
29
5
|
import { Device } from '@project-chip/matter.js/device';
|
|
30
6
|
import { GroupsClusterHandler, ClusterServer } from '@project-chip/matter.js/cluster';
|
|
31
|
-
// AnsiLogger module
|
|
32
7
|
import { AnsiLogger, CYAN, YELLOW, db, hk, or, zb, debugStringify } from 'node-ansi-logger';
|
|
33
|
-
// Node.js modules
|
|
34
8
|
import { createHash } from 'crypto';
|
|
35
9
|
import { bridgedNode } from './matterbridgeDeviceTypes.js';
|
|
36
10
|
export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
37
11
|
static bridgeMode = '';
|
|
38
|
-
static logLevel = "info"
|
|
12
|
+
static logLevel = "info";
|
|
39
13
|
log;
|
|
40
14
|
plugin = undefined;
|
|
41
15
|
configUrl = undefined;
|
|
@@ -50,21 +24,15 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
50
24
|
softwareVersionString = undefined;
|
|
51
25
|
hardwareVersion = undefined;
|
|
52
26
|
hardwareVersionString = undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Create a Matterbridge device.
|
|
55
|
-
* @constructor
|
|
56
|
-
* @param {DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>} definition - The DeviceTypeDefinition of the device.
|
|
57
|
-
* @param {EndpointOptions} [options={}] - The options for the device.
|
|
58
|
-
* @param {boolean} [debug=false] - The debug level for the device.
|
|
59
|
-
*/
|
|
60
27
|
constructor(definition, options = {}, debug = false) {
|
|
61
28
|
let firstDefinition;
|
|
62
29
|
if (Array.isArray(definition))
|
|
63
30
|
firstDefinition = definition[0];
|
|
64
31
|
else
|
|
65
32
|
firstDefinition = definition;
|
|
33
|
+
options.uniqueStorageKey?.replace(/[ .]/g, '');
|
|
66
34
|
super(firstDefinition, options);
|
|
67
|
-
this.log = new AnsiLogger({ logName: 'MatterbridgeDevice', logTimestampFormat: 4
|
|
35
|
+
this.log = new AnsiLogger({ logName: 'MatterbridgeDevice', logTimestampFormat: 4, logLevel: debug === true ? "debug" : MatterbridgeDevice.logLevel });
|
|
68
36
|
this.log.debug(`new MatterbridgeDevice with deviceType: ${zb}${firstDefinition.code}${db}-${zb}${firstDefinition.name}${db}`);
|
|
69
37
|
if (Array.isArray(definition)) {
|
|
70
38
|
definition.forEach((deviceType) => {
|
|
@@ -74,28 +42,12 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
74
42
|
else
|
|
75
43
|
this.addDeviceType(firstDefinition);
|
|
76
44
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Loads asyncronously an instance of the MatterbridgeDevice class.
|
|
79
|
-
*
|
|
80
|
-
* @param {DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>} definition - The DeviceTypeDefinition of the device.
|
|
81
|
-
* @param {EndpointOptions} [options={}] - The options for the device.
|
|
82
|
-
* @param {boolean} [debug=false] - The debug level for the device.
|
|
83
|
-
* @returns {Promise<MatterbridgeDevice>} A Promise of MatterbridgeDevice instance.
|
|
84
|
-
*/
|
|
85
45
|
static async loadInstance(definition, options = {}, debug = false) {
|
|
86
46
|
return new MatterbridgeDevice(definition, options, debug);
|
|
87
47
|
}
|
|
88
|
-
// Present in new API but not here
|
|
89
48
|
get maybeNumber() {
|
|
90
49
|
return this.number;
|
|
91
50
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Adds a device type to the list of device types of the MatterbridgeDevice endpoint.
|
|
94
|
-
* If the device type is not already present in the list, it will be added.
|
|
95
|
-
*
|
|
96
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
97
|
-
* @returns {MatterbridgeDevice} The MatterbridgeDevice instance.
|
|
98
|
-
*/
|
|
99
51
|
addDeviceType(deviceType) {
|
|
100
52
|
const deviceTypes = this.getDeviceTypes();
|
|
101
53
|
if (!deviceTypes.includes(deviceType)) {
|
|
@@ -105,13 +57,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
105
57
|
}
|
|
106
58
|
return this;
|
|
107
59
|
}
|
|
108
|
-
/**
|
|
109
|
-
* Adds one or more device types with the required cluster servers and the specified cluster servers.
|
|
110
|
-
*
|
|
111
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
112
|
-
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
113
|
-
* @returns {MatterbridgeDevice} The MatterbridgeDevice instance.
|
|
114
|
-
*/
|
|
115
60
|
addDeviceTypeWithClusterServer(deviceTypes, includeServerList = []) {
|
|
116
61
|
this.log.debug('addDeviceTypeWithClusterServer:');
|
|
117
62
|
deviceTypes.forEach((deviceType) => {
|
|
@@ -133,22 +78,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
133
78
|
this.addClusterServerFromList(this, includeServerList);
|
|
134
79
|
return this;
|
|
135
80
|
}
|
|
136
|
-
/**
|
|
137
|
-
* Adds a child endpoint with the specified device types and options.
|
|
138
|
-
* If the child endpoint is not already present, it will be created and added.
|
|
139
|
-
* If the child endpoint is already present, the device types will be added to the existing child endpoint.
|
|
140
|
-
*
|
|
141
|
-
* @param {string} endpointName - The name of the new endpoint to add.
|
|
142
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
143
|
-
* @param {MatterbridgeEndpointOptions} [options={}] - The options for the endpoint.
|
|
144
|
-
* @param {boolean} [debug=false] - Whether to enable debug logging.
|
|
145
|
-
* @returns {MatterbridgeDevice} - The child endpoint that was found or added.
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```typescript
|
|
149
|
-
* const endpoint = device.addChildDeviceType('Temperature', [temperatureSensor], { tagList: [{ mfgCode: null, namespaceId: LocationTag.Indoor.namespaceId, tag: LocationTag.Indoor.tag, label: null }] }, true);
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
81
|
addChildDeviceType(endpointName, deviceTypes, options = {}, debug = false) {
|
|
153
82
|
this.log.debug(`addChildDeviceType: ${CYAN}${endpointName}${db}`);
|
|
154
83
|
let child = this.getChildEndpoints().find((endpoint) => endpoint.uniqueStorageKey === endpointName);
|
|
@@ -173,23 +102,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
173
102
|
child.setDeviceTypes(childDeviceTypes);
|
|
174
103
|
return child;
|
|
175
104
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Adds a child endpoint with one or more device types with the required cluster servers and the specified cluster servers.
|
|
178
|
-
* If the child endpoint is not already present in the childEndpoints, it will be added.
|
|
179
|
-
* If the child endpoint is already present in the childEndpoints, the device types and cluster servers will be added to the existing child endpoint.
|
|
180
|
-
*
|
|
181
|
-
* @param {string} endpointName - The name of the new enpoint to add.
|
|
182
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
183
|
-
* @param {ClusterId[]} [includeServerList=[]] - The list of cluster IDs to include.
|
|
184
|
-
* @param {EndpointOptions} [options={}] - The options for the device.
|
|
185
|
-
* @param {boolean} [debug=false] - Whether to enable debug logging.
|
|
186
|
-
* @returns {MatterbridgeDevice} - The child endpoint that was found or added.
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* ```typescript
|
|
190
|
-
* const endpoint = device.addChildDeviceTypeWithClusterServer('Temperature', [temperatureSensor], [], { tagList: [{ mfgCode: null, namespaceId: LocationTag.Indoor.namespaceId, tag: LocationTag.Indoor.tag, label: null }] }, true);
|
|
191
|
-
* ```
|
|
192
|
-
*/
|
|
193
105
|
addChildDeviceTypeWithClusterServer(endpointName, deviceTypes, includeServerList = [], options = {}, debug = false) {
|
|
194
106
|
this.log.debug(`addChildDeviceTypeWithClusterServer: ${CYAN}${endpointName}${db}`);
|
|
195
107
|
let child = this.getChildEndpoints().find((endpoint) => endpoint.uniqueStorageKey === endpointName);
|
|
@@ -222,12 +134,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
222
134
|
this.addClusterServerFromList(child, includeServerList);
|
|
223
135
|
return child;
|
|
224
136
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Adds the required cluster servers (only if they are not present) for the device types of the specified endpoint.
|
|
227
|
-
*
|
|
228
|
-
* @param {Endpoint} endpoint - The endpoint to add the required cluster servers to.
|
|
229
|
-
* @returns {Endpoint} The updated endpoint with the required cluster servers added.
|
|
230
|
-
*/
|
|
231
137
|
addRequiredClusterServers(endpoint) {
|
|
232
138
|
const requiredServerList = [];
|
|
233
139
|
this.log.debug(`addRequiredClusterServer for ${CYAN}${endpoint.name}${db}`);
|
|
@@ -244,12 +150,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
244
150
|
this.addClusterServerFromList(endpoint, requiredServerList);
|
|
245
151
|
return endpoint;
|
|
246
152
|
}
|
|
247
|
-
/**
|
|
248
|
-
* Adds the optional cluster servers (only if they are not present) for the device types of the specified endpoint.
|
|
249
|
-
*
|
|
250
|
-
* @param {Endpoint} endpoint - The endpoint to add the required cluster servers to.
|
|
251
|
-
* @returns {Endpoint} The updated endpoint with the required cluster servers added.
|
|
252
|
-
*/
|
|
253
153
|
addOptionalClusterServers(endpoint) {
|
|
254
154
|
const optionalServerList = [];
|
|
255
155
|
this.log.debug(`addRequiredClusterServer for ${CYAN}${endpoint.name}${db}`);
|
|
@@ -266,19 +166,11 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
266
166
|
this.addClusterServerFromList(endpoint, optionalServerList);
|
|
267
167
|
return endpoint;
|
|
268
168
|
}
|
|
269
|
-
/**
|
|
270
|
-
* Adds cluster servers to the specified endpoint based on the provided server list.
|
|
271
|
-
*
|
|
272
|
-
* @param {Endpoint} endpoint - The endpoint to add cluster servers to.
|
|
273
|
-
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
274
|
-
* @returns {Endpoint} The updated endpoint with the cluster servers added.
|
|
275
|
-
*/
|
|
276
169
|
addClusterServerFromList(endpoint, includeServerList) {
|
|
277
170
|
if (includeServerList.includes(Identify.Cluster.id))
|
|
278
171
|
endpoint.addClusterServer(this.getDefaultIdentifyClusterServer());
|
|
279
172
|
if (includeServerList.includes(Groups.Cluster.id))
|
|
280
173
|
endpoint.addClusterServer(this.getDefaultGroupsClusterServer());
|
|
281
|
-
// if (includeServerList.includes(ScenesManagement.Cluster.id)) endpoint.addClusterServer(this.getDefaultScenesClusterServer());
|
|
282
174
|
if (includeServerList.includes(OnOff.Cluster.id))
|
|
283
175
|
endpoint.addClusterServer(this.getDefaultOnOffClusterServer());
|
|
284
176
|
if (includeServerList.includes(LevelControl.Cluster.id))
|
|
@@ -351,25 +243,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
351
243
|
endpoint.addClusterServer(this.getDefaultDeviceEnergyManagementModeClusterServer());
|
|
352
244
|
return endpoint;
|
|
353
245
|
}
|
|
354
|
-
/**
|
|
355
|
-
* Retrieves a child endpoint by its name.
|
|
356
|
-
*
|
|
357
|
-
* @param {string} endpointName - The name of the endpoint to retrieve.
|
|
358
|
-
* @returns {Endpoint | undefined} The child endpoint with the specified name, or undefined if not found.
|
|
359
|
-
*/
|
|
360
246
|
getChildEndpointByName(endpointName) {
|
|
361
247
|
return this.getChildEndpoints().find((endpoint) => endpoint.uniqueStorageKey === endpointName);
|
|
362
248
|
}
|
|
363
|
-
/**
|
|
364
|
-
* Retrieves the value of the specified attribute from the given endpoint and cluster.
|
|
365
|
-
*
|
|
366
|
-
* @param {ClusterId} clusterId - The ID of the cluster to retrieve the attribute from.
|
|
367
|
-
* @param {string} attribute - The name of the attribute to retrieve.
|
|
368
|
-
* @param {AnsiLogger} [log] - Optional logger for error and info messages.
|
|
369
|
-
* @param {Endpoint} [endpoint] - Optional the child endpoint to retrieve the attribute from.
|
|
370
|
-
* @returns {any} The value of the attribute, or undefined if the attribute is not found.
|
|
371
|
-
*/
|
|
372
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
373
249
|
getAttribute(clusterId, attribute, log, endpoint) {
|
|
374
250
|
if (!endpoint)
|
|
375
251
|
endpoint = this;
|
|
@@ -383,28 +259,15 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
383
259
|
this.log.error(`getAttribute error: Attribute ${attribute} not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
384
260
|
return undefined;
|
|
385
261
|
}
|
|
386
|
-
// Find the getter method
|
|
387
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
388
262
|
if (!clusterServer[`get${capitalizedAttributeName}Attribute`]) {
|
|
389
263
|
this.log.error(`getAttribute error: Getter get${capitalizedAttributeName}Attribute not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
390
264
|
return undefined;
|
|
391
265
|
}
|
|
392
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type
|
|
393
266
|
const getter = clusterServer[`get${capitalizedAttributeName}Attribute`];
|
|
394
267
|
const value = getter();
|
|
395
268
|
log?.info(`${db}Get endpoint ${or}${endpoint.name}:${endpoint.number}${db} attribute ${hk}${clusterServer.name}.${capitalizedAttributeName}${db} value ${YELLOW}${typeof value === 'object' ? debugStringify(value) : value}${db}`);
|
|
396
269
|
return value;
|
|
397
270
|
}
|
|
398
|
-
/**
|
|
399
|
-
* Sets the value of an attribute on a cluster server endpoint.
|
|
400
|
-
*
|
|
401
|
-
* @param {ClusterId} clusterId - The ID of the cluster.
|
|
402
|
-
* @param {string} attribute - The name of the attribute.
|
|
403
|
-
* @param {any} value - The value to set for the attribute.
|
|
404
|
-
* @param {AnsiLogger} [log] - (Optional) The logger to use for logging errors and information.
|
|
405
|
-
* @param {Endpoint} [endpoint] - (Optional) The endpoint to set the attribute on. If not provided, the attribute will be set on the current endpoint.
|
|
406
|
-
*/
|
|
407
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
408
271
|
setAttribute(clusterId, attribute, value, log, endpoint) {
|
|
409
272
|
if (!endpoint)
|
|
410
273
|
endpoint = this;
|
|
@@ -418,21 +281,15 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
418
281
|
this.log.error(`setAttribute error: Attribute ${attribute} not found on Cluster ${clusterId} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
419
282
|
return false;
|
|
420
283
|
}
|
|
421
|
-
// Find the getter method
|
|
422
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
423
284
|
if (!clusterServer[`get${capitalizedAttributeName}Attribute`]) {
|
|
424
285
|
this.log.error(`setAttribute error: Getter get${capitalizedAttributeName}Attribute not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
425
286
|
return false;
|
|
426
287
|
}
|
|
427
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type
|
|
428
288
|
const getter = clusterServer[`get${capitalizedAttributeName}Attribute`];
|
|
429
|
-
// Find the setter method
|
|
430
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
431
289
|
if (!clusterServer[`set${capitalizedAttributeName}Attribute`]) {
|
|
432
290
|
this.log.error(`setAttribute error: Setter set${capitalizedAttributeName}Attribute not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
433
291
|
return false;
|
|
434
292
|
}
|
|
435
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type
|
|
436
293
|
const setter = clusterServer[`set${capitalizedAttributeName}Attribute`];
|
|
437
294
|
const oldValue = getter();
|
|
438
295
|
setter(value);
|
|
@@ -441,17 +298,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
441
298
|
`to ${YELLOW}${typeof value === 'object' ? debugStringify(value) : value}${db}`);
|
|
442
299
|
return true;
|
|
443
300
|
}
|
|
444
|
-
/**
|
|
445
|
-
* Subscribes to an attribute on a cluster.
|
|
446
|
-
*
|
|
447
|
-
* @param {ClusterId} clusterId - The ID of the cluster.
|
|
448
|
-
* @param {string} attribute - The name of the attribute to subscribe to.
|
|
449
|
-
* @param {(newValue: any, oldValue: any) => void} listener - A callback function that will be called when the attribute value changes.
|
|
450
|
-
* @param {AnsiLogger} log - (Optional) An AnsiLogger instance for logging errors and information.
|
|
451
|
-
* @param {Endpoint} endpoint - (Optional) The endpoint to subscribe the attribute on. If not provided, the current endpoint will be used.
|
|
452
|
-
* @returns A boolean indicating whether the subscription was successful.
|
|
453
|
-
*/
|
|
454
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
455
301
|
subscribeAttribute(clusterId, attribute, listener, log, endpoint) {
|
|
456
302
|
if (!endpoint)
|
|
457
303
|
endpoint = this;
|
|
@@ -465,28 +311,15 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
465
311
|
this.log.error(`subscribeAttribute error: Attribute ${attribute} not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
466
312
|
return false;
|
|
467
313
|
}
|
|
468
|
-
// Find the subscribe method
|
|
469
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
470
314
|
if (!clusterServer[`subscribe${capitalizedAttributeName}Attribute`]) {
|
|
471
315
|
this.log.error(`subscribeAttribute error: subscribe${capitalizedAttributeName}Attribute not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
472
316
|
return false;
|
|
473
317
|
}
|
|
474
|
-
// Subscribe to the attribute
|
|
475
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type
|
|
476
318
|
const subscribe = clusterServer[`subscribe${capitalizedAttributeName}Attribute`];
|
|
477
319
|
subscribe(listener);
|
|
478
320
|
log?.info(`${db}Subscribe endpoint ${or}${endpoint.name}:${endpoint.number}${db} attribute ${hk}${clusterServer.name}.${capitalizedAttributeName}${db}`);
|
|
479
321
|
return true;
|
|
480
322
|
}
|
|
481
|
-
/**
|
|
482
|
-
* Triggers the specified event of the specified cluster from the given endpoint and cluster.
|
|
483
|
-
*
|
|
484
|
-
* @param {ClusterId} clusterId - The ID of the cluster to retrieve the event from.
|
|
485
|
-
* @param {string} event - The name of the event to trigger.
|
|
486
|
-
* @param {Record<string, any>} payload - The payload of the event to trigger.
|
|
487
|
-
* @param {AnsiLogger} [log] - Optional logger for error and info messages.
|
|
488
|
-
* @param {Endpoint} [endpoint] - Optional the child endpoint to retrieve the event from.
|
|
489
|
-
*/
|
|
490
323
|
triggerEvent(clusterId, event, payload, log, endpoint) {
|
|
491
324
|
if (!endpoint)
|
|
492
325
|
endpoint = this;
|
|
@@ -502,43 +335,20 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
502
335
|
this.log.error(`triggerEvent error: Event ${event} not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
503
336
|
return;
|
|
504
337
|
}
|
|
505
|
-
// Find the getter method
|
|
506
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
507
338
|
if (!clusterServer[`trigger${capitalizedEventName}Event`]) {
|
|
508
339
|
this.log.error(`triggerEvent error: Trigger trigger${capitalizedEventName}Event not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
509
340
|
return;
|
|
510
341
|
}
|
|
511
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type
|
|
512
342
|
const trigger = clusterServer[`trigger${capitalizedEventName}Event`];
|
|
513
343
|
trigger(payload);
|
|
514
344
|
log?.info(`${db}Trigger event ${hk}${clusterServer.name}.${capitalizedEventName}${db} on endpoint ${or}${endpoint.name}:${endpoint.number}${db}`);
|
|
515
345
|
}
|
|
516
|
-
/**
|
|
517
|
-
* Adds a tag to the tag list of the specified endpoint.
|
|
518
|
-
*
|
|
519
|
-
* @param {Endpoint} endpoint - The endpoint to add the tag to.
|
|
520
|
-
* @param {VendorId | null} mfgCode - The manufacturer code.
|
|
521
|
-
* @param {number} namespaceId - The namespace ID of the tag.
|
|
522
|
-
* @param {number} tag - The tag number.
|
|
523
|
-
* @param {string | null} [label=null] - The label for the tag.
|
|
524
|
-
*
|
|
525
|
-
* @remarks
|
|
526
|
-
* This method is used to add a tag to the tag list of a given endpoint.
|
|
527
|
-
* If the tag list already exists, the new tag is added to the existing list. Otherwise, a new tag list is created with the provided tag.
|
|
528
|
-
*
|
|
529
|
-
* Example usage:
|
|
530
|
-
* ```typescript
|
|
531
|
-
* this.addTagList(endpoint, null, NumberTag.One.namespaceId, NumberTag.One.tag, 'Label');
|
|
532
|
-
* this.addTagList(endpoint, null, SwitchesTag.Custom.namespaceId, SwitchesTag.Custom.tag, 'Label');
|
|
533
|
-
* ```
|
|
534
|
-
*/
|
|
535
346
|
addTagList(endpoint, mfgCode, namespaceId, tag, label) {
|
|
536
347
|
const descriptor = endpoint.getClusterServer(DescriptorCluster.with(Descriptor.Feature.TagList));
|
|
537
348
|
if (!descriptor) {
|
|
538
349
|
this.log.error(`addTagList: descriptor cluster not found on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
539
350
|
return;
|
|
540
351
|
}
|
|
541
|
-
// tagList: { mfgCode: VendorId | null; namespaceId: number; tag: number; label?: string | null }[] = [];
|
|
542
352
|
if (descriptor.attributes.tagList) {
|
|
543
353
|
this.log.debug(`addTagList: adding ${CYAN}tagList${db} mfCode: ${mfgCode}, namespaceId: ${namespaceId}, tag: ${tag}, label: ${label} on endpoint ${endpoint.name}:${endpoint.number}`);
|
|
544
354
|
const tagList = descriptor.attributes.tagList.getLocal();
|
|
@@ -554,12 +364,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
554
364
|
partsList: [...descriptor.attributes.partsList.getLocal()],
|
|
555
365
|
}, {}, {}));
|
|
556
366
|
}
|
|
557
|
-
/**
|
|
558
|
-
* Serializes the Matterbridge device into a serialized object.
|
|
559
|
-
*
|
|
560
|
-
* @param pluginName - The name of the plugin.
|
|
561
|
-
* @returns The serialized Matterbridge device object.
|
|
562
|
-
*/
|
|
563
367
|
serialize() {
|
|
564
368
|
if (!this.serialNumber || !this.deviceName || !this.uniqueId)
|
|
565
369
|
return;
|
|
@@ -584,11 +388,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
584
388
|
});
|
|
585
389
|
return serialized;
|
|
586
390
|
}
|
|
587
|
-
/**
|
|
588
|
-
* Deserializes the device into a serialized object.
|
|
589
|
-
*
|
|
590
|
-
* @returns The deserialized MatterbridgeDevice.
|
|
591
|
-
*/
|
|
592
391
|
static deserialize(serializedDevice) {
|
|
593
392
|
const device = new MatterbridgeDevice(serializedDevice.deviceTypes);
|
|
594
393
|
device.serialNumber = serializedDevice.serialNumber;
|
|
@@ -604,9 +403,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
604
403
|
}
|
|
605
404
|
return device;
|
|
606
405
|
}
|
|
607
|
-
/**
|
|
608
|
-
* Get a default IdentifyCluster server.
|
|
609
|
-
*/
|
|
610
406
|
getDefaultIdentifyClusterServer(identifyTime = 0, identifyType = Identify.IdentifyType.None) {
|
|
611
407
|
return ClusterServer(IdentifyCluster, {
|
|
612
408
|
identifyTime,
|
|
@@ -622,91 +418,31 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
622
418
|
},
|
|
623
419
|
});
|
|
624
420
|
}
|
|
625
|
-
/**
|
|
626
|
-
* Creates a default IdentifyCluster server.
|
|
627
|
-
*/
|
|
628
421
|
createDefaultIdentifyClusterServer(identifyTime = 0, identifyType = Identify.IdentifyType.None) {
|
|
629
422
|
this.addClusterServer(this.getDefaultIdentifyClusterServer(identifyTime, identifyType));
|
|
630
423
|
return this;
|
|
631
424
|
}
|
|
632
|
-
/**
|
|
633
|
-
* Get a default IdentifyCluster server.
|
|
634
|
-
*/
|
|
635
425
|
getDefaultGroupsClusterServer() {
|
|
636
426
|
return ClusterServer(GroupsCluster, {
|
|
637
427
|
nameSupport: {
|
|
638
428
|
nameSupport: true,
|
|
639
429
|
},
|
|
640
430
|
}, GroupsClusterHandler());
|
|
641
|
-
// return createDefaultGroupsClusterServer();
|
|
642
431
|
}
|
|
643
|
-
/**
|
|
644
|
-
* Creates a default groups cluster server and adds it to the device.
|
|
645
|
-
*/
|
|
646
432
|
createDefaultGroupsClusterServer() {
|
|
647
433
|
this.addClusterServer(this.getDefaultGroupsClusterServer());
|
|
648
434
|
return this;
|
|
649
435
|
}
|
|
650
|
-
/**
|
|
651
|
-
* Get a default scenes cluster server and adds it to the current instance.
|
|
652
|
-
* @deprecated This method is deprecated.
|
|
653
|
-
*
|
|
654
|
-
*/
|
|
655
436
|
getDefaultScenesClusterServer() {
|
|
656
|
-
|
|
657
|
-
return ClusterServer(
|
|
658
|
-
ScenesCluster,
|
|
659
|
-
{
|
|
660
|
-
sceneCount: 0,
|
|
661
|
-
currentScene: 0,
|
|
662
|
-
currentGroup: GroupId(0),
|
|
663
|
-
sceneValid: false,
|
|
664
|
-
nameSupport: {
|
|
665
|
-
nameSupport: true,
|
|
666
|
-
},
|
|
667
|
-
lastConfiguredBy: null,
|
|
668
|
-
},
|
|
669
|
-
{},
|
|
670
|
-
);
|
|
671
|
-
*/
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* Creates a default scenes cluster server and adds it to the current instance.
|
|
675
|
-
* @deprecated This method is deprecated.
|
|
676
|
-
*/
|
|
437
|
+
}
|
|
677
438
|
createDefaultScenesClusterServer() {
|
|
678
|
-
/*
|
|
679
|
-
this.addClusterServer(this.getDefaultScenesClusterServer());
|
|
680
|
-
*/
|
|
681
439
|
return this;
|
|
682
440
|
}
|
|
683
|
-
/**
|
|
684
|
-
* Creates a unique identifier based on the provided parameters.
|
|
685
|
-
* @param param1 - The first parameter.
|
|
686
|
-
* @param param2 - The second parameter.
|
|
687
|
-
* @param param3 - The third parameter.
|
|
688
|
-
* @param param4 - The fourth parameter.
|
|
689
|
-
* @returns A unique identifier generated using the MD5 hash algorithm.
|
|
690
|
-
*/
|
|
691
441
|
createUniqueId(param1, param2, param3, param4) {
|
|
692
442
|
const hash = createHash('md5');
|
|
693
443
|
hash.update(param1 + param2 + param3 + param4);
|
|
694
444
|
return hash.digest('hex');
|
|
695
445
|
}
|
|
696
|
-
/**
|
|
697
|
-
* Get a default Basic Information Cluster Server.
|
|
698
|
-
*
|
|
699
|
-
* @param deviceName - The name of the device.
|
|
700
|
-
* @param serialNumber - The serial number of the device.
|
|
701
|
-
* @param vendorId - The vendor ID of the device.
|
|
702
|
-
* @param vendorName - The vendor name of the device.
|
|
703
|
-
* @param productId - The product ID of the device.
|
|
704
|
-
* @param productName - The product name of the device.
|
|
705
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
706
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
707
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
708
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
709
|
-
*/
|
|
710
446
|
getDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
711
447
|
this.log.logName = deviceName;
|
|
712
448
|
this.deviceName = deviceName;
|
|
@@ -747,20 +483,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
747
483
|
reachableChanged: true,
|
|
748
484
|
});
|
|
749
485
|
}
|
|
750
|
-
/**
|
|
751
|
-
* Creates a default Basic Information Cluster Server.
|
|
752
|
-
*
|
|
753
|
-
* @param deviceName - The name of the device.
|
|
754
|
-
* @param serialNumber - The serial number of the device.
|
|
755
|
-
* @param vendorId - The vendor ID of the device.
|
|
756
|
-
* @param vendorName - The vendor name of the device.
|
|
757
|
-
* @param productId - The product ID of the device.
|
|
758
|
-
* @param productName - The product name of the device.
|
|
759
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
760
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
761
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
762
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
763
|
-
*/
|
|
764
486
|
createDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
765
487
|
if (MatterbridgeDevice.bridgeMode === 'bridge') {
|
|
766
488
|
this.addDeviceType(bridgedNode);
|
|
@@ -770,19 +492,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
770
492
|
this.addClusterServer(this.getDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
771
493
|
return this;
|
|
772
494
|
}
|
|
773
|
-
/**
|
|
774
|
-
* Get a default BridgedDeviceBasicInformationClusterServer.
|
|
775
|
-
*
|
|
776
|
-
* @param deviceName - The name of the device.
|
|
777
|
-
* @param serialNumber - The serial number of the device.
|
|
778
|
-
* @param vendorId - The vendor ID of the device.
|
|
779
|
-
* @param vendorName - The name of the vendor.
|
|
780
|
-
* @param productName - The name of the product.
|
|
781
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
782
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
783
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
784
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
785
|
-
*/
|
|
786
495
|
getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
787
496
|
this.log.logName = deviceName;
|
|
788
497
|
this.deviceName = deviceName;
|
|
@@ -797,7 +506,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
797
506
|
this.hardwareVersion = hardwareVersion;
|
|
798
507
|
this.hardwareVersionString = hardwareVersionString;
|
|
799
508
|
return ClusterServer(BridgedDeviceBasicInformationCluster, {
|
|
800
|
-
vendorId: vendorId !== undefined ? VendorId(vendorId) : undefined,
|
|
509
|
+
vendorId: vendorId !== undefined ? VendorId(vendorId) : undefined,
|
|
801
510
|
vendorName: vendorName.slice(0, 32),
|
|
802
511
|
productName: productName.slice(0, 32),
|
|
803
512
|
productUrl: 'https://www.npmjs.com/package/matterbridge',
|
|
@@ -817,37 +526,13 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
817
526
|
reachableChanged: true,
|
|
818
527
|
});
|
|
819
528
|
}
|
|
820
|
-
/**
|
|
821
|
-
* Creates a default BridgedDeviceBasicInformationClusterServer.
|
|
822
|
-
*
|
|
823
|
-
* @param deviceName - The name of the device.
|
|
824
|
-
* @param serialNumber - The serial number of the device.
|
|
825
|
-
* @param vendorId - The vendor ID of the device.
|
|
826
|
-
* @param vendorName - The name of the vendor.
|
|
827
|
-
* @param productName - The name of the product.
|
|
828
|
-
* @param softwareVersion - The software version of the device. Default is 1.
|
|
829
|
-
* @param softwareVersionString - The software version string of the device. Default is 'v.1.0.0'.
|
|
830
|
-
* @param hardwareVersion - The hardware version of the device. Default is 1.
|
|
831
|
-
* @param hardwareVersionString - The hardware version string of the device. Default is 'v.1.0.0'.
|
|
832
|
-
*/
|
|
833
529
|
createDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
834
530
|
this.addClusterServer(this.getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
835
531
|
return this;
|
|
836
532
|
}
|
|
837
|
-
/**
|
|
838
|
-
* Get a default Power Topology Cluster Server.
|
|
839
|
-
*
|
|
840
|
-
* @returns {ClusterServer} - The configured Power Topology Cluster Server.
|
|
841
|
-
*/
|
|
842
533
|
getDefaultPowerTopologyClusterServer() {
|
|
843
534
|
return ClusterServer(PowerTopologyCluster.with(PowerTopology.Feature.TreeTopology), {}, {}, {});
|
|
844
535
|
}
|
|
845
|
-
/**
|
|
846
|
-
* Get a default Electrical Energy Measurement Cluster Server.
|
|
847
|
-
*
|
|
848
|
-
* @param {number} energy - The total consumption value in mW/h.
|
|
849
|
-
* @returns {ClusterServer} - The configured Electrical Energy Measurement Cluster Server.
|
|
850
|
-
*/
|
|
851
536
|
getDefaultElectricalEnergyMeasurementClusterServer(energy = null) {
|
|
852
537
|
return ClusterServer(ElectricalEnergyMeasurementCluster.with(ElectricalEnergyMeasurement.Feature.ImportedEnergy, ElectricalEnergyMeasurement.Feature.ExportedEnergy, ElectricalEnergyMeasurement.Feature.CumulativeEnergy), {
|
|
853
538
|
accuracy: {
|
|
@@ -864,15 +549,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
864
549
|
cumulativeEnergyMeasured: true,
|
|
865
550
|
});
|
|
866
551
|
}
|
|
867
|
-
/**
|
|
868
|
-
* Get a default Electrical Power Measurement Cluster Server.
|
|
869
|
-
*
|
|
870
|
-
* @param {number} voltage - The voltage value in millivolts.
|
|
871
|
-
* @param {number} current - The current value in milliamperes.
|
|
872
|
-
* @param {number} power - The power value in milliwatts.
|
|
873
|
-
* @param {number} frequency - The frequency value in millihertz.
|
|
874
|
-
* @returns {ClusterServer} - The configured Electrical Power Measurement Cluster Server.
|
|
875
|
-
*/
|
|
876
552
|
getDefaultElectricalPowerMeasurementClusterServer(voltage = null, current = null, power = null, frequency = null) {
|
|
877
553
|
return ClusterServer(ElectricalPowerMeasurementCluster.with(ElectricalPowerMeasurement.Feature.AlternatingCurrent), {
|
|
878
554
|
powerMode: ElectricalPowerMeasurement.PowerMode.Ac,
|
|
@@ -913,15 +589,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
913
589
|
frequency: frequency,
|
|
914
590
|
}, {}, {});
|
|
915
591
|
}
|
|
916
|
-
/**
|
|
917
|
-
* Creates a default Dummy Thread Network Diagnostics Cluster server.
|
|
918
|
-
* @deprecated This method is deprecated and is only used for testing.
|
|
919
|
-
*
|
|
920
|
-
* @remarks
|
|
921
|
-
* This method adds a cluster server used only to give the networkName to Eve app.
|
|
922
|
-
*
|
|
923
|
-
* @returns void
|
|
924
|
-
*/
|
|
925
592
|
createDefaultDummyThreadNetworkDiagnosticsClusterServer() {
|
|
926
593
|
this.addClusterServer(ClusterServer(ThreadNetworkDiagnosticsCluster.with(ThreadNetworkDiagnostics.Feature.PacketCounts, ThreadNetworkDiagnostics.Feature.ErrorCounts), {
|
|
927
594
|
channel: 1,
|
|
@@ -949,17 +616,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
949
616
|
},
|
|
950
617
|
}, {}));
|
|
951
618
|
}
|
|
952
|
-
/**
|
|
953
|
-
* Get a default OnOff cluster server for light devices.
|
|
954
|
-
*
|
|
955
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
956
|
-
* @param {boolean} [globalSceneControl=false] - The global scene control state.
|
|
957
|
-
* @param {number} [onTime=0] - The on time value.
|
|
958
|
-
* @param {number} [offWaitTime=0] - The off wait time value.
|
|
959
|
-
* @param {OnOff.StartUpOnOff | null} [startUpOnOff=null] - The start-up OnOff state. Null means previous state.
|
|
960
|
-
*
|
|
961
|
-
* @returns {ClusterServer} - The configured OnOff cluster server.
|
|
962
|
-
*/
|
|
963
619
|
getDefaultOnOffClusterServer(onOff = false, globalSceneControl = false, onTime = 0, offWaitTime = 0, startUpOnOff = null) {
|
|
964
620
|
return ClusterServer(OnOffCluster.with(OnOff.Feature.Lighting), {
|
|
965
621
|
onOff,
|
|
@@ -994,26 +650,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
994
650
|
},
|
|
995
651
|
}, {});
|
|
996
652
|
}
|
|
997
|
-
/**
|
|
998
|
-
* Creates a default OnOff cluster server for light devices.
|
|
999
|
-
*
|
|
1000
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
1001
|
-
* @param {boolean} [globalSceneControl=false] - The global scene control state.
|
|
1002
|
-
* @param {number} [onTime=0] - The on time value.
|
|
1003
|
-
* @param {number} [offWaitTime=0] - The off wait time value.
|
|
1004
|
-
* @param {OnOff.StartUpOnOff | null} [startUpOnOff=null] - The start-up OnOff state. Null means previous state.
|
|
1005
|
-
*/
|
|
1006
653
|
createDefaultOnOffClusterServer(onOff = false, globalSceneControl = false, onTime = 0, offWaitTime = 0, startUpOnOff = null) {
|
|
1007
654
|
this.addClusterServer(this.getDefaultOnOffClusterServer(onOff, globalSceneControl, onTime, offWaitTime, startUpOnOff));
|
|
1008
655
|
return this;
|
|
1009
656
|
}
|
|
1010
|
-
/**
|
|
1011
|
-
* Get a DeadFront OnOff cluster server.
|
|
1012
|
-
*
|
|
1013
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
1014
|
-
*
|
|
1015
|
-
* @returns {ClusterServer} - The configured OnOff cluster server.
|
|
1016
|
-
*/
|
|
1017
657
|
getDeadFrontOnOffClusterServer(onOff = false) {
|
|
1018
658
|
return ClusterServer(OnOffCluster.with(OnOff.Feature.DeadFrontBehavior), {
|
|
1019
659
|
onOff,
|
|
@@ -1032,22 +672,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1032
672
|
},
|
|
1033
673
|
}, {});
|
|
1034
674
|
}
|
|
1035
|
-
/**
|
|
1036
|
-
* Creates a DeadFront OnOff cluster server.
|
|
1037
|
-
*
|
|
1038
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
1039
|
-
*/
|
|
1040
675
|
createDeadFrontOnOffClusterServer(onOff = false) {
|
|
1041
676
|
this.addClusterServer(this.getDeadFrontOnOffClusterServer(onOff));
|
|
1042
677
|
return this;
|
|
1043
678
|
}
|
|
1044
|
-
/**
|
|
1045
|
-
* Get an OnOff cluster server without features.
|
|
1046
|
-
*
|
|
1047
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
1048
|
-
*
|
|
1049
|
-
* @returns {ClusterServer} - The configured OnOff cluster server.
|
|
1050
|
-
*/
|
|
1051
679
|
getOnOffClusterServer(onOff = false) {
|
|
1052
680
|
return ClusterServer(OnOffCluster, {
|
|
1053
681
|
onOff,
|
|
@@ -1066,24 +694,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1066
694
|
},
|
|
1067
695
|
}, {});
|
|
1068
696
|
}
|
|
1069
|
-
/**
|
|
1070
|
-
* Creates an OnOff cluster server without features.
|
|
1071
|
-
*
|
|
1072
|
-
* @param {boolean} [onOff=false] - The initial state of the OnOff cluster.
|
|
1073
|
-
*/
|
|
1074
697
|
createOnOffClusterServer(onOff = false) {
|
|
1075
698
|
this.addClusterServer(this.getOnOffClusterServer(onOff));
|
|
1076
699
|
return this;
|
|
1077
700
|
}
|
|
1078
|
-
/**
|
|
1079
|
-
* Get a default level control cluster server.
|
|
1080
|
-
*
|
|
1081
|
-
* @param currentLevel - The current level (default: 254).
|
|
1082
|
-
* @param minLevel - The minimum level (default: 1).
|
|
1083
|
-
* @param maxLevel - The maximum level (default: 254).
|
|
1084
|
-
* @param onLevel - The on level (default: null).
|
|
1085
|
-
* @param startUpCurrentLevel - The startUp on level (default: null).
|
|
1086
|
-
*/
|
|
1087
701
|
getDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 1, maxLevel = 254, onLevel = null, startUpCurrentLevel = null) {
|
|
1088
702
|
return ClusterServer(LevelControlCluster.with(LevelControl.Feature.OnOff, LevelControl.Feature.Lighting), {
|
|
1089
703
|
currentLevel,
|
|
@@ -1125,30 +739,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1125
739
|
},
|
|
1126
740
|
});
|
|
1127
741
|
}
|
|
1128
|
-
/**
|
|
1129
|
-
* Creates a default level control cluster server.
|
|
1130
|
-
*
|
|
1131
|
-
* @param currentLevel - The current level (default: 254).
|
|
1132
|
-
* @param minLevel - The minimum level (default: 1).
|
|
1133
|
-
* @param maxLevel - The maximum level (default: 254).
|
|
1134
|
-
* @param onLevel - The on level (default: null).
|
|
1135
|
-
* @param startUpCurrentLevel - The startUp on level (default: null).
|
|
1136
|
-
*/
|
|
1137
742
|
createDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 1, maxLevel = 254, onLevel = null, startUpCurrentLevel = null) {
|
|
1138
743
|
this.addClusterServer(this.getDefaultLevelControlClusterServer(currentLevel, minLevel, maxLevel, onLevel, startUpCurrentLevel));
|
|
1139
744
|
return this;
|
|
1140
745
|
}
|
|
1141
|
-
/**
|
|
1142
|
-
* Get a default color control cluster server with Xy, HueSaturation and ColorTemperature.
|
|
1143
|
-
*
|
|
1144
|
-
* @param currentX - The current X value.
|
|
1145
|
-
* @param currentY - The current Y value.
|
|
1146
|
-
* @param currentHue - The current hue value.
|
|
1147
|
-
* @param currentSaturation - The current saturation value.
|
|
1148
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1149
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1150
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1151
|
-
*/
|
|
1152
746
|
getDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1153
747
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
1154
748
|
colorMode: ColorControl.ColorMode.CurrentHueAndCurrentSaturation,
|
|
@@ -1218,30 +812,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1218
812
|
},
|
|
1219
813
|
}, {});
|
|
1220
814
|
}
|
|
1221
|
-
/**
|
|
1222
|
-
* Creates a default color control cluster server with Xy, HueSaturation and ColorTemperature.
|
|
1223
|
-
*
|
|
1224
|
-
* @param currentX - The current X value.
|
|
1225
|
-
* @param currentY - The current Y value.
|
|
1226
|
-
* @param currentHue - The current hue value.
|
|
1227
|
-
* @param currentSaturation - The current saturation value.
|
|
1228
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1229
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1230
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1231
|
-
*/
|
|
1232
815
|
createDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1233
816
|
this.addClusterServer(this.getDefaultColorControlClusterServer(currentX, currentY, currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1234
817
|
return this;
|
|
1235
818
|
}
|
|
1236
|
-
/**
|
|
1237
|
-
* Get a Xy color control cluster server with Xy and ColorTemperature.
|
|
1238
|
-
*
|
|
1239
|
-
* @param currentX - The current X value.
|
|
1240
|
-
* @param currentY - The current Y value.
|
|
1241
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1242
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1243
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1244
|
-
*/
|
|
1245
819
|
getXyColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1246
820
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.ColorTemperature), {
|
|
1247
821
|
colorMode: ColorControl.ColorMode.CurrentXAndCurrentY,
|
|
@@ -1285,28 +859,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1285
859
|
},
|
|
1286
860
|
}, {});
|
|
1287
861
|
}
|
|
1288
|
-
/**
|
|
1289
|
-
* Creates a Xy color control cluster server with Xy and ColorTemperature.
|
|
1290
|
-
*
|
|
1291
|
-
* @param currentX - The current X value.
|
|
1292
|
-
* @param currentY - The current Y value.
|
|
1293
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1294
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1295
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1296
|
-
*/
|
|
1297
862
|
createXyColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1298
863
|
this.addClusterServer(this.getXyColorControlClusterServer(currentX, currentY, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1299
864
|
return this;
|
|
1300
865
|
}
|
|
1301
|
-
/**
|
|
1302
|
-
* Get a default hue and saturation control cluster server with HueSaturation and ColorTemperature.
|
|
1303
|
-
*
|
|
1304
|
-
* @param currentHue - The current hue value.
|
|
1305
|
-
* @param currentSaturation - The current saturation value.
|
|
1306
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1307
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1308
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1309
|
-
*/
|
|
1310
866
|
getHsColorControlClusterServer(currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1311
867
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
1312
868
|
colorMode: ColorControl.ColorMode.CurrentHueAndCurrentSaturation,
|
|
@@ -1364,26 +920,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1364
920
|
},
|
|
1365
921
|
}, {});
|
|
1366
922
|
}
|
|
1367
|
-
/**
|
|
1368
|
-
* Creates a hue and saturation color control cluster server with HueSaturation and ColorTemperature.
|
|
1369
|
-
*
|
|
1370
|
-
* @param currentHue - The current hue value.
|
|
1371
|
-
* @param currentSaturation - The current saturation value.
|
|
1372
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1373
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1374
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1375
|
-
*/
|
|
1376
923
|
createHsColorControlClusterServer(currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1377
924
|
this.addClusterServer(this.getHsColorControlClusterServer(currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1378
925
|
return this;
|
|
1379
926
|
}
|
|
1380
|
-
/**
|
|
1381
|
-
* Get a color temperature color control cluster server.
|
|
1382
|
-
*
|
|
1383
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1384
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1385
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1386
|
-
*/
|
|
1387
927
|
getCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1388
928
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.ColorTemperature), {
|
|
1389
929
|
colorMode: ColorControl.ColorMode.ColorTemperatureMireds,
|
|
@@ -1415,31 +955,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1415
955
|
},
|
|
1416
956
|
}, {});
|
|
1417
957
|
}
|
|
1418
|
-
/**
|
|
1419
|
-
* Creates a color temperature color control cluster server.
|
|
1420
|
-
*
|
|
1421
|
-
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1422
|
-
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1423
|
-
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1424
|
-
*/
|
|
1425
958
|
createCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1426
959
|
this.addClusterServer(this.getCtColorControlClusterServer(colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1427
960
|
return this;
|
|
1428
961
|
}
|
|
1429
|
-
/**
|
|
1430
|
-
* Configures the color control cluster for a device.
|
|
1431
|
-
*
|
|
1432
|
-
* @remark This method must be called only after creating the cluster with getDefaultCompleteColorControlClusterServer or createDefaultCompleteColorControlClusterServer
|
|
1433
|
-
* and before starting the matter server.
|
|
1434
|
-
*
|
|
1435
|
-
* @deprecated Use configureColorControlMode instead.
|
|
1436
|
-
*
|
|
1437
|
-
* @param {boolean} hueSaturation - A boolean indicating whether the device supports hue and saturation control.
|
|
1438
|
-
* @param {boolean} xy - A boolean indicating whether the device supports XY control.
|
|
1439
|
-
* @param {boolean} colorTemperature - A boolean indicating whether the device supports color temperature control.
|
|
1440
|
-
* @param {ColorControl.ColorMode} colorMode - An optional parameter specifying the color mode of the device.
|
|
1441
|
-
* @param {Endpoint} endpoint - An optional parameter specifying the endpoint to configure. If not provided, the device endpoint will be used.
|
|
1442
|
-
*/
|
|
1443
962
|
configureColorControlCluster(hueSaturation, xy, colorTemperature, colorMode, endpoint) {
|
|
1444
963
|
if (!endpoint)
|
|
1445
964
|
endpoint = this;
|
|
@@ -1451,12 +970,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1451
970
|
}
|
|
1452
971
|
return this;
|
|
1453
972
|
}
|
|
1454
|
-
/**
|
|
1455
|
-
* Configures the color control mode for the device.
|
|
1456
|
-
*
|
|
1457
|
-
* @param {ColorControl.ColorMode} colorMode - The color mode to set.
|
|
1458
|
-
* @param {Endpoint} endpoint - The optional endpoint to configure. If not provided, the method will configure the current endpoint.
|
|
1459
|
-
*/
|
|
1460
973
|
configureColorControlMode(colorMode, endpoint) {
|
|
1461
974
|
if (!endpoint)
|
|
1462
975
|
endpoint = this;
|
|
@@ -1466,13 +979,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1466
979
|
}
|
|
1467
980
|
return this;
|
|
1468
981
|
}
|
|
1469
|
-
/**
|
|
1470
|
-
* Get a default window covering cluster server.
|
|
1471
|
-
*
|
|
1472
|
-
* @param positionPercent100ths - The position percentage in 100ths (0-10000). Defaults to 0.
|
|
1473
|
-
*/
|
|
1474
982
|
getDefaultWindowCoveringClusterServer(positionPercent100ths) {
|
|
1475
|
-
return ClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift
|
|
983
|
+
return ClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift), {
|
|
1476
984
|
type: WindowCovering.WindowCoveringType.Rollershade,
|
|
1477
985
|
configStatus: {
|
|
1478
986
|
operational: true,
|
|
@@ -1486,10 +994,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1486
994
|
operationalStatus: { global: WindowCovering.MovementStatus.Stopped, lift: WindowCovering.MovementStatus.Stopped, tilt: WindowCovering.MovementStatus.Stopped },
|
|
1487
995
|
endProductType: WindowCovering.EndProductType.RollerShade,
|
|
1488
996
|
mode: { motorDirectionReversed: false, calibrationMode: false, maintenanceMode: false, ledFeedback: false },
|
|
1489
|
-
targetPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
1490
|
-
currentPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
1491
|
-
// installedClosedLimitLift: 10000,
|
|
1492
|
-
// installedOpenLimitLift: 0,
|
|
997
|
+
targetPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
998
|
+
currentPositionLiftPercent100ths: positionPercent100ths ?? 0,
|
|
1493
999
|
}, {
|
|
1494
1000
|
upOrOpen: async (data) => {
|
|
1495
1001
|
this.log.debug('Matter command: upOrOpen');
|
|
@@ -1510,18 +1016,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1510
1016
|
},
|
|
1511
1017
|
}, {});
|
|
1512
1018
|
}
|
|
1513
|
-
/**
|
|
1514
|
-
* Creates a default window covering cluster server.
|
|
1515
|
-
*
|
|
1516
|
-
* @param positionPercent100ths - The position percentage in 100ths (0-10000). Defaults to 0.
|
|
1517
|
-
*/
|
|
1518
1019
|
createDefaultWindowCoveringClusterServer(positionPercent100ths) {
|
|
1519
1020
|
this.addClusterServer(this.getDefaultWindowCoveringClusterServer(positionPercent100ths));
|
|
1520
1021
|
}
|
|
1521
|
-
/**
|
|
1522
|
-
* Sets the window covering target position as the current position and stops the movement.
|
|
1523
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1524
|
-
*/
|
|
1525
1022
|
setWindowCoveringTargetAsCurrentAndStopped(endpoint) {
|
|
1526
1023
|
if (!endpoint)
|
|
1527
1024
|
endpoint = this;
|
|
@@ -1539,13 +1036,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1539
1036
|
this.log.debug(`Set WindowCovering currentPositionLiftPercent100ths and targetPositionLiftPercent100ths to ${position} and operationalStatus to Stopped.`);
|
|
1540
1037
|
}
|
|
1541
1038
|
}
|
|
1542
|
-
/**
|
|
1543
|
-
* Sets the current and target status of a window covering.
|
|
1544
|
-
* @param {number} current - The current position of the window covering.
|
|
1545
|
-
* @param {number} target - The target position of the window covering.
|
|
1546
|
-
* @param {WindowCovering.MovementStatus} status - The movement status of the window covering.
|
|
1547
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1548
|
-
*/
|
|
1549
1039
|
setWindowCoveringCurrentTargetStatus(current, target, status, endpoint) {
|
|
1550
1040
|
if (!endpoint)
|
|
1551
1041
|
endpoint = this;
|
|
@@ -1561,11 +1051,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1561
1051
|
}
|
|
1562
1052
|
this.log.debug(`Set WindowCovering currentPositionLiftPercent100ths: ${current}, targetPositionLiftPercent100ths: ${target} and operationalStatus: ${status}.`);
|
|
1563
1053
|
}
|
|
1564
|
-
/**
|
|
1565
|
-
* Sets the status of the window covering.
|
|
1566
|
-
* @param {WindowCovering.MovementStatus} status - The movement status to set.
|
|
1567
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1568
|
-
*/
|
|
1569
1054
|
setWindowCoveringStatus(status, endpoint) {
|
|
1570
1055
|
if (!endpoint)
|
|
1571
1056
|
endpoint = this;
|
|
@@ -1575,12 +1060,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1575
1060
|
windowCovering.setOperationalStatusAttribute({ global: status, lift: status, tilt: status });
|
|
1576
1061
|
this.log.debug(`Set WindowCovering operationalStatus: ${status}`);
|
|
1577
1062
|
}
|
|
1578
|
-
/**
|
|
1579
|
-
* Retrieves the status of the window covering.
|
|
1580
|
-
* @param {Endpoint} endpoint - The endpoint on which to get the window covering (default the device endpoint).
|
|
1581
|
-
*
|
|
1582
|
-
* @returns The global operational status of the window covering.
|
|
1583
|
-
*/
|
|
1584
1063
|
getWindowCoveringStatus(endpoint) {
|
|
1585
1064
|
if (!endpoint)
|
|
1586
1065
|
endpoint = this;
|
|
@@ -1591,12 +1070,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1591
1070
|
this.log.debug(`Get WindowCovering operationalStatus: ${status.global}`);
|
|
1592
1071
|
return status.global;
|
|
1593
1072
|
}
|
|
1594
|
-
/**
|
|
1595
|
-
* Sets the target and current position of the window covering.
|
|
1596
|
-
*
|
|
1597
|
-
* @param position - The position to set, specified as a number.
|
|
1598
|
-
* @param {Endpoint} endpoint - The endpoint on which to set the window covering (default the device endpoint).
|
|
1599
|
-
*/
|
|
1600
1073
|
setWindowCoveringTargetAndCurrentPosition(position, endpoint) {
|
|
1601
1074
|
if (!endpoint)
|
|
1602
1075
|
endpoint = this;
|
|
@@ -1607,13 +1080,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1607
1080
|
windowCovering.setTargetPositionLiftPercent100thsAttribute(position);
|
|
1608
1081
|
this.log.debug(`Set WindowCovering currentPositionLiftPercent100ths: ${position} and targetPositionLiftPercent100ths: ${position}.`);
|
|
1609
1082
|
}
|
|
1610
|
-
/**
|
|
1611
|
-
* Get a default door lock cluster server.
|
|
1612
|
-
*
|
|
1613
|
-
* @remarks
|
|
1614
|
-
* This method adds a cluster server for a door lock cluster with default settings.
|
|
1615
|
-
*
|
|
1616
|
-
*/
|
|
1617
1083
|
getDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.DeadBolt) {
|
|
1618
1084
|
return ClusterServer(DoorLockCluster, {
|
|
1619
1085
|
operatingMode: DoorLock.OperatingMode.Normal,
|
|
@@ -1636,22 +1102,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1636
1102
|
lockOperationError: true,
|
|
1637
1103
|
});
|
|
1638
1104
|
}
|
|
1639
|
-
/**
|
|
1640
|
-
* Creates a default door lock cluster server.
|
|
1641
|
-
*
|
|
1642
|
-
* @remarks
|
|
1643
|
-
* This method adds a cluster server for a door lock cluster with default settings.
|
|
1644
|
-
*
|
|
1645
|
-
*/
|
|
1646
1105
|
createDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.DeadBolt) {
|
|
1647
1106
|
this.addClusterServer(this.getDefaultDoorLockClusterServer(lockState, lockType));
|
|
1648
1107
|
}
|
|
1649
|
-
/**
|
|
1650
|
-
* Get a default momentary switch cluster server.
|
|
1651
|
-
*
|
|
1652
|
-
* @remarks
|
|
1653
|
-
* This method adds a cluster server with default momentary switch features and configurations suitable for (AppleHome) Single Double Long automations.
|
|
1654
|
-
*/
|
|
1655
1108
|
getDefaultSwitchClusterServer() {
|
|
1656
1109
|
return ClusterServer(SwitchCluster.with(Switch.Feature.MomentarySwitch, Switch.Feature.MomentarySwitchRelease, Switch.Feature.MomentarySwitchLongPress, Switch.Feature.MomentarySwitchMultiPress), {
|
|
1657
1110
|
numberOfPositions: 2,
|
|
@@ -1666,21 +1119,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1666
1119
|
multiPressComplete: true,
|
|
1667
1120
|
});
|
|
1668
1121
|
}
|
|
1669
|
-
/**
|
|
1670
|
-
* Creates a default momentary switch cluster server.
|
|
1671
|
-
*
|
|
1672
|
-
* @remarks
|
|
1673
|
-
* This method adds a cluster server with default momentary switch features and configurations.
|
|
1674
|
-
*/
|
|
1675
1122
|
createDefaultSwitchClusterServer() {
|
|
1676
1123
|
this.addClusterServer(this.getDefaultSwitchClusterServer());
|
|
1677
1124
|
}
|
|
1678
|
-
/**
|
|
1679
|
-
* Get a default latching switch cluster server.
|
|
1680
|
-
*
|
|
1681
|
-
* @remarks
|
|
1682
|
-
* This method adds a cluster server with default latching switch features and configuration.
|
|
1683
|
-
*/
|
|
1684
1125
|
getDefaultLatchingSwitchClusterServer() {
|
|
1685
1126
|
return ClusterServer(SwitchCluster.with(Switch.Feature.LatchingSwitch), {
|
|
1686
1127
|
numberOfPositions: 2,
|
|
@@ -1689,22 +1130,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1689
1130
|
switchLatched: true,
|
|
1690
1131
|
});
|
|
1691
1132
|
}
|
|
1692
|
-
/**
|
|
1693
|
-
* Creates a default latching switch cluster server.
|
|
1694
|
-
*
|
|
1695
|
-
* @remarks
|
|
1696
|
-
* This method adds a cluster server with default latching switch features and configuration.
|
|
1697
|
-
*/
|
|
1698
1133
|
createDefaultLatchingSwitchClusterServer() {
|
|
1699
1134
|
this.addClusterServer(this.getDefaultLatchingSwitchClusterServer());
|
|
1700
1135
|
}
|
|
1701
|
-
/**
|
|
1702
|
-
* Triggers a switch event on the specified endpoint.
|
|
1703
|
-
*
|
|
1704
|
-
* @param {string} event - The type of event to trigger. Possible values are 'Single', 'Double', 'Long' for momentarySwitch and 'Press', 'Release' for latchingSwitch.
|
|
1705
|
-
* @param {Endpoint} endpoint - The endpoint on which to trigger the event (default the device endpoint).
|
|
1706
|
-
* @returns {void}
|
|
1707
|
-
*/
|
|
1708
1136
|
triggerSwitchEvent(event, log, endpoint) {
|
|
1709
1137
|
if (!endpoint)
|
|
1710
1138
|
endpoint = this;
|
|
@@ -1776,15 +1204,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1776
1204
|
}
|
|
1777
1205
|
return true;
|
|
1778
1206
|
}
|
|
1779
|
-
/**
|
|
1780
|
-
* Retrieves the default mode select cluster server.
|
|
1781
|
-
*
|
|
1782
|
-
* @param description - The description of the cluster server.
|
|
1783
|
-
* @param supportedModes - The supported modes for the cluster server.
|
|
1784
|
-
* @param currentMode - The current mode of the cluster server. Defaults to 0.
|
|
1785
|
-
* @param startUpMode - The startup mode of the cluster server. Defaults to 0.
|
|
1786
|
-
* @returns The default mode select cluster server.
|
|
1787
|
-
*/
|
|
1788
1207
|
getDefaultModeSelectClusterServer(description, supportedModes, currentMode = 0, startUpMode = 0) {
|
|
1789
1208
|
return ClusterServer(ModeSelectCluster, {
|
|
1790
1209
|
description: description,
|
|
@@ -1799,24 +1218,11 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1799
1218
|
},
|
|
1800
1219
|
});
|
|
1801
1220
|
}
|
|
1802
|
-
/**
|
|
1803
|
-
* Creates a default mode select cluster server.
|
|
1804
|
-
*
|
|
1805
|
-
* @remarks
|
|
1806
|
-
* This method adds a cluster server for a mode select cluster with default settings.
|
|
1807
|
-
*
|
|
1808
|
-
* @param endpoint - The endpoint to add the cluster server to. Defaults to `this` if not provided.
|
|
1809
|
-
*/
|
|
1810
1221
|
createDefaultModeSelectClusterServer(description, supportedModes, currentMode = 0, startUpMode = 0, endpoint) {
|
|
1811
1222
|
if (!endpoint)
|
|
1812
1223
|
endpoint = this;
|
|
1813
1224
|
endpoint.addClusterServer(this.getDefaultModeSelectClusterServer(description, supportedModes, currentMode, startUpMode));
|
|
1814
1225
|
}
|
|
1815
|
-
/**
|
|
1816
|
-
* Get a default occupancy sensing cluster server.
|
|
1817
|
-
*
|
|
1818
|
-
* @param occupied - A boolean indicating whether the occupancy is occupied or not. Default is false.
|
|
1819
|
-
*/
|
|
1820
1226
|
getDefaultOccupancySensingClusterServer(occupied = false) {
|
|
1821
1227
|
return ClusterServer(OccupancySensingCluster, {
|
|
1822
1228
|
occupancy: { occupied },
|
|
@@ -1825,19 +1231,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1825
1231
|
pirOccupiedToUnoccupiedDelay: 30,
|
|
1826
1232
|
}, {});
|
|
1827
1233
|
}
|
|
1828
|
-
/**
|
|
1829
|
-
* Creates a default occupancy sensing cluster server.
|
|
1830
|
-
*
|
|
1831
|
-
* @param occupied - A boolean indicating whether the occupancy is occupied or not. Default is false.
|
|
1832
|
-
*/
|
|
1833
1234
|
createDefaultOccupancySensingClusterServer(occupied = false) {
|
|
1834
1235
|
this.addClusterServer(this.getDefaultOccupancySensingClusterServer(occupied));
|
|
1835
1236
|
}
|
|
1836
|
-
/**
|
|
1837
|
-
* Get a default Illuminance Measurement Cluster Server.
|
|
1838
|
-
*
|
|
1839
|
-
* @param measuredValue - The measured value of illuminance.
|
|
1840
|
-
*/
|
|
1841
1237
|
getDefaultIlluminanceMeasurementClusterServer(measuredValue = 0) {
|
|
1842
1238
|
return ClusterServer(IlluminanceMeasurementCluster, {
|
|
1843
1239
|
measuredValue,
|
|
@@ -1846,19 +1242,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1846
1242
|
tolerance: 0,
|
|
1847
1243
|
}, {}, {});
|
|
1848
1244
|
}
|
|
1849
|
-
/**
|
|
1850
|
-
* Creates a default Illuminance Measurement Cluster Server.
|
|
1851
|
-
*
|
|
1852
|
-
* @param measuredValue - The measured value of illuminance.
|
|
1853
|
-
*/
|
|
1854
1245
|
createDefaultIlluminanceMeasurementClusterServer(measuredValue = 0) {
|
|
1855
1246
|
this.addClusterServer(this.getDefaultIlluminanceMeasurementClusterServer(measuredValue));
|
|
1856
1247
|
}
|
|
1857
|
-
/**
|
|
1858
|
-
* Get a default flow measurement cluster server.
|
|
1859
|
-
*
|
|
1860
|
-
* @param measuredValue - The measured value of the flow in 10 x m/h.
|
|
1861
|
-
*/
|
|
1862
1248
|
getDefaultFlowMeasurementClusterServer(measuredValue = 0) {
|
|
1863
1249
|
return ClusterServer(FlowMeasurementCluster, {
|
|
1864
1250
|
measuredValue,
|
|
@@ -1867,19 +1253,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1867
1253
|
tolerance: 0,
|
|
1868
1254
|
}, {}, {});
|
|
1869
1255
|
}
|
|
1870
|
-
/**
|
|
1871
|
-
* Creates a default flow measurement cluster server.
|
|
1872
|
-
*
|
|
1873
|
-
* @param measuredValue - The measured value of the of the flow in 10 x m/h.
|
|
1874
|
-
*/
|
|
1875
1256
|
createDefaultFlowMeasurementClusterServer(measuredValue = 0) {
|
|
1876
1257
|
this.addClusterServer(this.getDefaultFlowMeasurementClusterServer(measuredValue));
|
|
1877
1258
|
}
|
|
1878
|
-
/**
|
|
1879
|
-
* Get a default temperature measurement cluster server.
|
|
1880
|
-
*
|
|
1881
|
-
* @param measuredValue - The measured value of the temperature x 100.
|
|
1882
|
-
*/
|
|
1883
1259
|
getDefaultTemperatureMeasurementClusterServer(measuredValue = 0) {
|
|
1884
1260
|
return ClusterServer(TemperatureMeasurementCluster, {
|
|
1885
1261
|
measuredValue,
|
|
@@ -1888,19 +1264,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1888
1264
|
tolerance: 0,
|
|
1889
1265
|
}, {}, {});
|
|
1890
1266
|
}
|
|
1891
|
-
/**
|
|
1892
|
-
* Creates a default temperature measurement cluster server.
|
|
1893
|
-
*
|
|
1894
|
-
* @param measuredValue - The measured value of the temperature x 100.
|
|
1895
|
-
*/
|
|
1896
1267
|
createDefaultTemperatureMeasurementClusterServer(measuredValue = 0) {
|
|
1897
1268
|
this.addClusterServer(this.getDefaultTemperatureMeasurementClusterServer(measuredValue));
|
|
1898
1269
|
}
|
|
1899
|
-
/**
|
|
1900
|
-
* Get a default RelativeHumidityMeasurementCluster server.
|
|
1901
|
-
*
|
|
1902
|
-
* @param measuredValue - The measured value of the relative humidity x 100.
|
|
1903
|
-
*/
|
|
1904
1270
|
getDefaultRelativeHumidityMeasurementClusterServer(measuredValue = 0) {
|
|
1905
1271
|
return ClusterServer(RelativeHumidityMeasurementCluster, {
|
|
1906
1272
|
measuredValue,
|
|
@@ -1909,19 +1275,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1909
1275
|
tolerance: 0,
|
|
1910
1276
|
}, {}, {});
|
|
1911
1277
|
}
|
|
1912
|
-
/**
|
|
1913
|
-
* Creates a default RelativeHumidityMeasurementCluster server.
|
|
1914
|
-
*
|
|
1915
|
-
* @param measuredValue - The measured value of the relative humidity x 100.
|
|
1916
|
-
*/
|
|
1917
1278
|
createDefaultRelativeHumidityMeasurementClusterServer(measuredValue = 0) {
|
|
1918
1279
|
this.addClusterServer(this.getDefaultRelativeHumidityMeasurementClusterServer(measuredValue));
|
|
1919
1280
|
}
|
|
1920
|
-
/**
|
|
1921
|
-
* Get a default Pressure Measurement Cluster Server.
|
|
1922
|
-
*
|
|
1923
|
-
* @param measuredValue - The measured value for the pressure.
|
|
1924
|
-
*/
|
|
1925
1281
|
getDefaultPressureMeasurementClusterServer(measuredValue = 1000) {
|
|
1926
1282
|
return ClusterServer(PressureMeasurementCluster, {
|
|
1927
1283
|
measuredValue,
|
|
@@ -1930,39 +1286,19 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1930
1286
|
tolerance: 0,
|
|
1931
1287
|
}, {}, {});
|
|
1932
1288
|
}
|
|
1933
|
-
/**
|
|
1934
|
-
* Creates a default Pressure Measurement Cluster Server.
|
|
1935
|
-
*
|
|
1936
|
-
* @param measuredValue - The measured value for the pressure.
|
|
1937
|
-
*/
|
|
1938
1289
|
createDefaultPressureMeasurementClusterServer(measuredValue = 1000) {
|
|
1939
1290
|
this.addClusterServer(this.getDefaultPressureMeasurementClusterServer(measuredValue));
|
|
1940
1291
|
}
|
|
1941
|
-
/**
|
|
1942
|
-
* Get a default boolean state cluster server.
|
|
1943
|
-
*
|
|
1944
|
-
* @param contact - Optional boolean value indicating the contact state. Defaults to `true` if not provided.
|
|
1945
|
-
*/
|
|
1946
1292
|
getDefaultBooleanStateClusterServer(contact) {
|
|
1947
1293
|
return ClusterServer(BooleanStateCluster, {
|
|
1948
|
-
stateValue: contact ?? true,
|
|
1294
|
+
stateValue: contact ?? true,
|
|
1949
1295
|
}, {}, {
|
|
1950
1296
|
stateChange: true,
|
|
1951
1297
|
});
|
|
1952
1298
|
}
|
|
1953
|
-
/**
|
|
1954
|
-
* Creates a default boolean state configuration cluster server.
|
|
1955
|
-
*
|
|
1956
|
-
* @param contact - Optional boolean value indicating the contact state. Defaults to `true` if not provided.
|
|
1957
|
-
*/
|
|
1958
1299
|
createDefaultBooleanStateClusterServer(contact) {
|
|
1959
1300
|
this.addClusterServer(this.getDefaultBooleanStateClusterServer(contact));
|
|
1960
1301
|
}
|
|
1961
|
-
/**
|
|
1962
|
-
* Get a default boolean state configuration cluster server.
|
|
1963
|
-
*
|
|
1964
|
-
* @param contact - Optional boolean value indicating the sensor fault state. Defaults to `false` if not provided.
|
|
1965
|
-
*/
|
|
1966
1302
|
getDefaultBooleanStateConfigurationClusterServer(sensorFault = false) {
|
|
1967
1303
|
return ClusterServer(BooleanStateConfigurationCluster.with(BooleanStateConfiguration.Feature.Visual, BooleanStateConfiguration.Feature.Audible, BooleanStateConfiguration.Feature.SensitivityLevel), {
|
|
1968
1304
|
currentSensitivityLevel: 0,
|
|
@@ -1971,7 +1307,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1971
1307
|
alarmsActive: { visual: false, audible: false },
|
|
1972
1308
|
alarmsEnabled: { visual: false, audible: false },
|
|
1973
1309
|
alarmsSupported: { visual: true, audible: true },
|
|
1974
|
-
// alarmsSuppressed: { visual: false, audible: false },
|
|
1975
1310
|
sensorFault: { generalFault: sensorFault },
|
|
1976
1311
|
}, {
|
|
1977
1312
|
enableDisableAlarm: async ({ request, attributes }) => {
|
|
@@ -1983,23 +1318,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1983
1318
|
sensorFault: true,
|
|
1984
1319
|
});
|
|
1985
1320
|
}
|
|
1986
|
-
/**
|
|
1987
|
-
* Creates a default boolean state configuration cluster server.
|
|
1988
|
-
*
|
|
1989
|
-
* @param contact - Optional boolean value indicating the sensor fault state. Defaults to `false` if not provided.
|
|
1990
|
-
*/
|
|
1991
1321
|
createDefaultBooleanStateConfigurationClusterServer(sensorFault = false) {
|
|
1992
1322
|
this.addClusterServer(this.getDefaultBooleanStateConfigurationClusterServer(sensorFault));
|
|
1993
1323
|
}
|
|
1994
|
-
/**
|
|
1995
|
-
* Get a default power source replaceable battery cluster server.
|
|
1996
|
-
*
|
|
1997
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
1998
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
1999
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
2000
|
-
* @param batReplacementDescription - The battery replacement description (default: 'Battery type').
|
|
2001
|
-
* @param batQuantity - The battery quantity (default: 1).
|
|
2002
|
-
*/
|
|
2003
1324
|
getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplacementDescription = 'Battery type', batQuantity = 1) {
|
|
2004
1325
|
return ClusterServer(PowerSourceCluster.with(PowerSource.Feature.Battery, PowerSource.Feature.Replaceable), {
|
|
2005
1326
|
status: PowerSource.PowerSourceStatus.Active,
|
|
@@ -2016,25 +1337,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2016
1337
|
endpointList: [],
|
|
2017
1338
|
}, {}, {});
|
|
2018
1339
|
}
|
|
2019
|
-
/**
|
|
2020
|
-
* Creates a default power source replaceable battery cluster server.
|
|
2021
|
-
*
|
|
2022
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
2023
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
2024
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
2025
|
-
* @param batReplacementDescription - The battery replacement description (default: 'Battery type').
|
|
2026
|
-
* @param batQuantity - The battery quantity (default: 1).
|
|
2027
|
-
*/
|
|
2028
1340
|
createDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500, batReplacementDescription = 'Battery type', batQuantity = 1) {
|
|
2029
1341
|
this.addClusterServer(this.getDefaultPowerSourceReplaceableBatteryClusterServer(batPercentRemaining, batChargeLevel, batVoltage, batReplacementDescription, batQuantity));
|
|
2030
1342
|
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Get a default power source rechargeable battery cluster server.
|
|
2033
|
-
*
|
|
2034
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
2035
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
2036
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
2037
|
-
*/
|
|
2038
1343
|
getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500) {
|
|
2039
1344
|
return ClusterServer(PowerSourceCluster.with(PowerSource.Feature.Battery, PowerSource.Feature.Rechargeable), {
|
|
2040
1345
|
status: PowerSource.PowerSourceStatus.Active,
|
|
@@ -2052,21 +1357,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2052
1357
|
endpointList: [],
|
|
2053
1358
|
}, {}, {});
|
|
2054
1359
|
}
|
|
2055
|
-
/**
|
|
2056
|
-
* Creates a default power source rechargeable battery cluster server.
|
|
2057
|
-
*
|
|
2058
|
-
* @param batPercentRemaining - The remaining battery percentage (default: 100).
|
|
2059
|
-
* @param batChargeLevel - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
|
|
2060
|
-
* @param batVoltage - The battery voltage (default: 1500).
|
|
2061
|
-
*/
|
|
2062
1360
|
createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, batVoltage = 1500) {
|
|
2063
1361
|
this.addClusterServer(this.getDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, batVoltage));
|
|
2064
1362
|
}
|
|
2065
|
-
/**
|
|
2066
|
-
* Get a default power source wired cluster server.
|
|
2067
|
-
*
|
|
2068
|
-
* @param wiredCurrentType - The type of wired current (default: PowerSource.WiredCurrentType.Ac)
|
|
2069
|
-
*/
|
|
2070
1363
|
getDefaultPowerSourceWiredClusterServer(wiredCurrentType = PowerSource.WiredCurrentType.Ac) {
|
|
2071
1364
|
return ClusterServer(PowerSourceCluster.with(PowerSource.Feature.Wired), {
|
|
2072
1365
|
wiredCurrentType,
|
|
@@ -2076,45 +1369,22 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2076
1369
|
endpointList: [],
|
|
2077
1370
|
}, {}, {});
|
|
2078
1371
|
}
|
|
2079
|
-
/**
|
|
2080
|
-
* Creates a default power source wired cluster server.
|
|
2081
|
-
*
|
|
2082
|
-
* @param wiredCurrentType - The type of wired current (default: PowerSource.WiredCurrentType.Ac)
|
|
2083
|
-
*/
|
|
2084
1372
|
createDefaultPowerSourceWiredClusterServer(wiredCurrentType = PowerSource.WiredCurrentType.Ac) {
|
|
2085
1373
|
this.addClusterServer(this.getDefaultPowerSourceWiredClusterServer(wiredCurrentType));
|
|
2086
1374
|
}
|
|
2087
|
-
/**
|
|
2088
|
-
* @deprecated This function is deprecated by Matter 1.3 spec and will be removed in a future version.
|
|
2089
|
-
*/
|
|
2090
1375
|
createDefaultPowerSourceConfigurationClusterServer(endpointNumber) {
|
|
2091
1376
|
this.addClusterServer(ClusterServer(PowerSourceConfigurationCluster, {
|
|
2092
1377
|
sources: endpointNumber ? [EndpointNumber(endpointNumber)] : [],
|
|
2093
1378
|
}, {}, {}));
|
|
2094
1379
|
}
|
|
2095
|
-
/**
|
|
2096
|
-
* Get a default air quality cluster server.
|
|
2097
|
-
*
|
|
2098
|
-
* @param airQuality The air quality type. Defaults to `AirQuality.AirQualityType.Unknown`.
|
|
2099
|
-
*/
|
|
2100
1380
|
getDefaultAirQualityClusterServer(airQuality = AirQuality.AirQualityEnum.Unknown) {
|
|
2101
1381
|
return ClusterServer(AirQualityCluster.with(AirQuality.Feature.Fair, AirQuality.Feature.Moderate, AirQuality.Feature.VeryPoor, AirQuality.Feature.ExtremelyPoor), {
|
|
2102
1382
|
airQuality,
|
|
2103
1383
|
}, {}, {});
|
|
2104
1384
|
}
|
|
2105
|
-
/**
|
|
2106
|
-
* Creates a default air quality cluster server.
|
|
2107
|
-
*
|
|
2108
|
-
* @param airQuality The air quality type. Defaults to `AirQuality.AirQualityType.Unknown`.
|
|
2109
|
-
*/
|
|
2110
1385
|
createDefaultAirQualityClusterServer(airQuality = AirQuality.AirQualityEnum.Unknown) {
|
|
2111
1386
|
this.addClusterServer(this.getDefaultAirQualityClusterServer(airQuality));
|
|
2112
1387
|
}
|
|
2113
|
-
/**
|
|
2114
|
-
* Get a default TVOC measurement cluster server.
|
|
2115
|
-
*
|
|
2116
|
-
* @param measuredValue - The measured value for TVOC.
|
|
2117
|
-
*/
|
|
2118
1388
|
getDefaultTvocMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2119
1389
|
return ClusterServer(TotalVolatileOrganicCompoundsConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2120
1390
|
measuredValue,
|
|
@@ -2125,28 +1395,14 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2125
1395
|
measurementMedium,
|
|
2126
1396
|
}, {}, {});
|
|
2127
1397
|
}
|
|
2128
|
-
/**
|
|
2129
|
-
* Creates a default TVOC measurement cluster server.
|
|
2130
|
-
*
|
|
2131
|
-
* @param measuredValue - The measured value for TVOC.
|
|
2132
|
-
*/
|
|
2133
1398
|
createDefaultTvocMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2134
1399
|
this.addClusterServer(this.getDefaultTvocMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2135
1400
|
}
|
|
2136
|
-
/**
|
|
2137
|
-
* Get a default heating thermostat cluster server with the specified parameters.
|
|
2138
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2139
|
-
* @param {number} [occupiedHeatingSetpoint] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2140
|
-
* @param {number} [minHeatSetpointLimit] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2141
|
-
* @param {number} [maxHeatSetpointLimit] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2142
|
-
* @returns {ThermostatClusterServer} A default thermostat cluster server configured with the specified parameters.
|
|
2143
|
-
*/
|
|
2144
1401
|
getDefaultHeatingThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 21, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50) {
|
|
2145
1402
|
return ClusterServer(ThermostatCluster.with(Thermostat.Feature.Heating), {
|
|
2146
1403
|
localTemperature: localTemperature * 100,
|
|
2147
1404
|
systemMode: Thermostat.SystemMode.Heat,
|
|
2148
1405
|
controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation.HeatingOnly,
|
|
2149
|
-
// Thermostat.Feature.Heating
|
|
2150
1406
|
occupiedHeatingSetpoint: occupiedHeatingSetpoint * 100,
|
|
2151
1407
|
minHeatSetpointLimit: minHeatSetpointLimit * 100,
|
|
2152
1408
|
maxHeatSetpointLimit: maxHeatSetpointLimit * 100,
|
|
@@ -2159,31 +1415,14 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2159
1415
|
},
|
|
2160
1416
|
}, {});
|
|
2161
1417
|
}
|
|
2162
|
-
/**
|
|
2163
|
-
* Creates and adds a default heating thermostat cluster server to the device.
|
|
2164
|
-
*
|
|
2165
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2166
|
-
* @param {number} [occupiedHeatingSetpoint] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2167
|
-
* @param {number} [minHeatSetpointLimit] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2168
|
-
* @param {number} [maxHeatSetpointLimit] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2169
|
-
*/
|
|
2170
1418
|
createDefaultHeatingThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 25, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50) {
|
|
2171
1419
|
this.addClusterServer(this.getDefaultHeatingThermostatClusterServer(localTemperature, occupiedHeatingSetpoint, minHeatSetpointLimit, maxHeatSetpointLimit));
|
|
2172
1420
|
}
|
|
2173
|
-
/**
|
|
2174
|
-
* Get a default cooling thermostat cluster server with the specified parameters.
|
|
2175
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2176
|
-
* @param {number} [occupiedCoolingSetpoint] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2177
|
-
* @param {number} [minCoolSetpointLimit] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2178
|
-
* @param {number} [maxCoolSetpointLimit] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2179
|
-
* @returns {ThermostatClusterServer} A default thermostat cluster server configured with the specified parameters.
|
|
2180
|
-
*/
|
|
2181
1421
|
getDefaultCoolingThermostatClusterServer(localTemperature = 23, occupiedCoolingSetpoint = 25, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2182
1422
|
return ClusterServer(ThermostatCluster.with(Thermostat.Feature.Cooling), {
|
|
2183
1423
|
localTemperature: localTemperature * 100,
|
|
2184
1424
|
systemMode: Thermostat.SystemMode.Cool,
|
|
2185
1425
|
controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation.CoolingOnly,
|
|
2186
|
-
// Thermostat.Feature.Cooling
|
|
2187
1426
|
occupiedCoolingSetpoint: occupiedCoolingSetpoint * 100,
|
|
2188
1427
|
minCoolSetpointLimit: minCoolSetpointLimit * 100,
|
|
2189
1428
|
maxCoolSetpointLimit: maxCoolSetpointLimit * 100,
|
|
@@ -2196,48 +1435,24 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2196
1435
|
},
|
|
2197
1436
|
}, {});
|
|
2198
1437
|
}
|
|
2199
|
-
/**
|
|
2200
|
-
* Creates and adds a default cooling thermostat cluster server to the device.
|
|
2201
|
-
*
|
|
2202
|
-
* @param {number} [localTemperature] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2203
|
-
* @param {number} [occupiedCoolingSetpoint] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2204
|
-
* @param {number} [minCoolSetpointLimit] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2205
|
-
* @param {number} [maxCoolSetpointLimit] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2206
|
-
*/
|
|
2207
1438
|
createDefaultCoolingThermostatClusterServer(localTemperature = 23, occupiedCoolingSetpoint = 25, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2208
1439
|
this.addClusterServer(this.getDefaultCoolingThermostatClusterServer(localTemperature, occupiedCoolingSetpoint, minCoolSetpointLimit, maxCoolSetpointLimit));
|
|
2209
1440
|
}
|
|
2210
|
-
/**
|
|
2211
|
-
* Get a default thermostat cluster server with the specified parameters.
|
|
2212
|
-
*
|
|
2213
|
-
* @param {number} [localTemperature=23] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2214
|
-
* @param {number} [occupiedHeatingSetpoint=21] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2215
|
-
* @param {number} [occupiedCoolingSetpoint=25] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2216
|
-
* @param {number} [minSetpointDeadBand=1] - The minimum setpoint dead band value. Defaults to 1°.
|
|
2217
|
-
* @param {number} [minHeatSetpointLimit=0] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2218
|
-
* @param {number} [maxHeatSetpointLimit=50] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2219
|
-
* @param {number} [minCoolSetpointLimit=0] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2220
|
-
* @param {number} [maxCoolSetpointLimit=50] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2221
|
-
* @returns {ThermostatClusterServer} A default thermostat cluster server configured with the specified parameters.
|
|
2222
|
-
*/
|
|
2223
1441
|
getDefaultThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 21, occupiedCoolingSetpoint = 25, minSetpointDeadBand = 1, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2224
1442
|
return ClusterServer(ThermostatCluster.with(Thermostat.Feature.Heating, Thermostat.Feature.Cooling, Thermostat.Feature.AutoMode), {
|
|
2225
1443
|
localTemperature: localTemperature * 100,
|
|
2226
1444
|
systemMode: Thermostat.SystemMode.Auto,
|
|
2227
1445
|
controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation.CoolingAndHeating,
|
|
2228
|
-
// Thermostat.Feature.Heating
|
|
2229
1446
|
occupiedHeatingSetpoint: occupiedHeatingSetpoint * 100,
|
|
2230
1447
|
minHeatSetpointLimit: minHeatSetpointLimit * 100,
|
|
2231
1448
|
maxHeatSetpointLimit: maxHeatSetpointLimit * 100,
|
|
2232
1449
|
absMinHeatSetpointLimit: minHeatSetpointLimit * 100,
|
|
2233
1450
|
absMaxHeatSetpointLimit: maxHeatSetpointLimit * 100,
|
|
2234
|
-
// Thermostat.Feature.Cooling
|
|
2235
1451
|
occupiedCoolingSetpoint: occupiedCoolingSetpoint * 100,
|
|
2236
1452
|
minCoolSetpointLimit: minCoolSetpointLimit * 100,
|
|
2237
1453
|
maxCoolSetpointLimit: maxCoolSetpointLimit * 100,
|
|
2238
1454
|
absMinCoolSetpointLimit: minCoolSetpointLimit * 100,
|
|
2239
1455
|
absMaxCoolSetpointLimit: maxCoolSetpointLimit * 100,
|
|
2240
|
-
// Thermostat.Feature.AutoMode
|
|
2241
1456
|
minSetpointDeadBand: minSetpointDeadBand * 100,
|
|
2242
1457
|
thermostatRunningMode: Thermostat.ThermostatRunningMode.Off,
|
|
2243
1458
|
}, {
|
|
@@ -2247,24 +1462,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2247
1462
|
},
|
|
2248
1463
|
}, {});
|
|
2249
1464
|
}
|
|
2250
|
-
/**
|
|
2251
|
-
* Creates and adds a default thermostat cluster server to the device.
|
|
2252
|
-
*
|
|
2253
|
-
* @param {number} [localTemperature=23] - The local temperature value in degrees Celsius. Defaults to 23°.
|
|
2254
|
-
* @param {number} [occupiedHeatingSetpoint=21] - The occupied heating setpoint value in degrees Celsius. Defaults to 21°.
|
|
2255
|
-
* @param {number} [occupiedCoolingSetpoint=25] - The occupied cooling setpoint value in degrees Celsius. Defaults to 25°.
|
|
2256
|
-
* @param {number} [minSetpointDeadBand=1] - The minimum setpoint dead band value. Defaults to 1°.
|
|
2257
|
-
* @param {number} [minHeatSetpointLimit=0] - The minimum heat setpoint limit value. Defaults to 0°.
|
|
2258
|
-
* @param {number} [maxHeatSetpointLimit=50] - The maximum heat setpoint limit value. Defaults to 50°.
|
|
2259
|
-
* @param {number} [minCoolSetpointLimit=0] - The minimum cool setpoint limit value. Defaults to 0°.
|
|
2260
|
-
* @param {number} [maxCoolSetpointLimit=50] - The maximum cool setpoint limit value. Defaults to 50°.
|
|
2261
|
-
*/
|
|
2262
1465
|
createDefaultThermostatClusterServer(localTemperature = 23, occupiedHeatingSetpoint = 21, occupiedCoolingSetpoint = 25, minSetpointDeadBand = 1, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50) {
|
|
2263
1466
|
this.addClusterServer(this.getDefaultThermostatClusterServer(localTemperature, occupiedHeatingSetpoint, occupiedCoolingSetpoint, minSetpointDeadBand, minHeatSetpointLimit, maxHeatSetpointLimit, minCoolSetpointLimit, maxCoolSetpointLimit));
|
|
2264
1467
|
}
|
|
2265
|
-
/**
|
|
2266
|
-
* Get a default dummy time sync cluster server. Only needed to create a thermostat.
|
|
2267
|
-
*/
|
|
2268
1468
|
getDefaultTimeSyncClusterServer() {
|
|
2269
1469
|
return ClusterServer(TimeSynchronizationCluster.with(TimeSynchronization.Feature.TimeZone), {
|
|
2270
1470
|
utcTime: null,
|
|
@@ -2296,19 +1496,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2296
1496
|
timeFailure: true,
|
|
2297
1497
|
});
|
|
2298
1498
|
}
|
|
2299
|
-
/**
|
|
2300
|
-
* Creates a default dummy time sync cluster server. Only needed to create a thermostat.
|
|
2301
|
-
*/
|
|
2302
1499
|
createDefaultTimeSyncClusterServer() {
|
|
2303
1500
|
this.addClusterServer(this.getDefaultTimeSyncClusterServer());
|
|
2304
1501
|
}
|
|
2305
|
-
/**
|
|
2306
|
-
* Returns the default SmokeCOAlarm Cluster Server.
|
|
2307
|
-
*
|
|
2308
|
-
* @param smokeState - The state of the smoke alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2309
|
-
* @param coState - The state of the CO alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2310
|
-
* @returns The default SmokeCOAlarmClusterServer.
|
|
2311
|
-
*/
|
|
2312
1502
|
getDefaultSmokeCOAlarmClusterServer(smokeState = SmokeCoAlarm.AlarmState.Normal, coState = SmokeCoAlarm.AlarmState.Normal) {
|
|
2313
1503
|
return ClusterServer(SmokeCoAlarmCluster.with(SmokeCoAlarm.Feature.SmokeAlarm, SmokeCoAlarm.Feature.CoAlarm), {
|
|
2314
1504
|
smokeState,
|
|
@@ -2340,24 +1530,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2340
1530
|
allClear: true,
|
|
2341
1531
|
});
|
|
2342
1532
|
}
|
|
2343
|
-
/**
|
|
2344
|
-
* Create the default SmokeCOAlarm Cluster Server.
|
|
2345
|
-
*
|
|
2346
|
-
* @param smokeState - The state of the smoke alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2347
|
-
* @param coState - The state of the CO alarm. Defaults to SmokeCoAlarm.AlarmState.Normal.
|
|
2348
|
-
* @returns The default SmokeCOAlarmClusterServer.
|
|
2349
|
-
*/
|
|
2350
1533
|
createDefaultSmokeCOAlarmClusterServer(smokeState = SmokeCoAlarm.AlarmState.Normal, coState = SmokeCoAlarm.AlarmState.Normal) {
|
|
2351
1534
|
this.addClusterServer(this.getDefaultSmokeCOAlarmClusterServer(smokeState, coState));
|
|
2352
1535
|
}
|
|
2353
|
-
/**
|
|
2354
|
-
* Returns the default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2355
|
-
*
|
|
2356
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2357
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2358
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2359
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2360
|
-
*/
|
|
2361
1536
|
getDefaultCarbonMonoxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2362
1537
|
return ClusterServer(CarbonMonoxideConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2363
1538
|
measuredValue,
|
|
@@ -2368,24 +1543,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2368
1543
|
measurementMedium,
|
|
2369
1544
|
}, {}, {});
|
|
2370
1545
|
}
|
|
2371
|
-
/**
|
|
2372
|
-
* Create the default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2373
|
-
*
|
|
2374
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2375
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2376
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2377
|
-
*/
|
|
2378
1546
|
createDefaultCarbonMonoxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2379
1547
|
this.addClusterServer(this.getDefaultCarbonMonoxideConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2380
1548
|
}
|
|
2381
|
-
/**
|
|
2382
|
-
* Returns the default Carbon Dioxide Concentration Measurement Cluster Server.
|
|
2383
|
-
*
|
|
2384
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2385
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2386
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2387
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2388
|
-
*/
|
|
2389
1549
|
getDefaultCarbonDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2390
1550
|
return ClusterServer(CarbonDioxideConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2391
1551
|
measuredValue,
|
|
@@ -2396,24 +1556,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2396
1556
|
measurementMedium,
|
|
2397
1557
|
}, {}, {});
|
|
2398
1558
|
}
|
|
2399
|
-
/**
|
|
2400
|
-
* Create the default Carbon Dioxide Concentration Measurement Cluster Server.
|
|
2401
|
-
*
|
|
2402
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2403
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2404
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2405
|
-
*/
|
|
2406
1559
|
createDefaultCarbonDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2407
1560
|
this.addClusterServer(this.getDefaultCarbonDioxideConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2408
1561
|
}
|
|
2409
|
-
/**
|
|
2410
|
-
* Returns the default Formaldehyde Concentration Measurement Cluster Server.
|
|
2411
|
-
*
|
|
2412
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2413
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2414
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2415
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2416
|
-
*/
|
|
2417
1562
|
getDefaultFormaldehydeConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2418
1563
|
return ClusterServer(FormaldehydeConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2419
1564
|
measuredValue,
|
|
@@ -2424,24 +1569,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2424
1569
|
measurementMedium,
|
|
2425
1570
|
}, {}, {});
|
|
2426
1571
|
}
|
|
2427
|
-
/**
|
|
2428
|
-
* Create the default Formaldehyde Concentration Measurement Cluster Server.
|
|
2429
|
-
*
|
|
2430
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2431
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2432
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2433
|
-
*/
|
|
2434
1572
|
createDefaultFormaldehydeConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2435
1573
|
this.addClusterServer(this.getDefaultFormaldehydeConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2436
1574
|
}
|
|
2437
|
-
/**
|
|
2438
|
-
* Returns the default Pm1 Concentration Measurement Cluster Server.
|
|
2439
|
-
*
|
|
2440
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2441
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2442
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2443
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2444
|
-
*/
|
|
2445
1575
|
getDefaultPm1ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2446
1576
|
return ClusterServer(Pm1ConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2447
1577
|
measuredValue,
|
|
@@ -2452,24 +1582,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2452
1582
|
measurementMedium,
|
|
2453
1583
|
}, {}, {});
|
|
2454
1584
|
}
|
|
2455
|
-
/**
|
|
2456
|
-
* Create the default Pm1 Concentration Measurement Cluster Server.
|
|
2457
|
-
*
|
|
2458
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2459
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2460
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2461
|
-
*/
|
|
2462
1585
|
createDefaultPm1ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2463
1586
|
this.addClusterServer(this.getDefaultPm1ConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2464
1587
|
}
|
|
2465
|
-
/**
|
|
2466
|
-
* Returns the default Pm25 Concentration Measurement Cluster Server.
|
|
2467
|
-
*
|
|
2468
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2469
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2470
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2471
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2472
|
-
*/
|
|
2473
1588
|
getDefaultPm25ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2474
1589
|
return ClusterServer(Pm25ConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2475
1590
|
measuredValue,
|
|
@@ -2480,24 +1595,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2480
1595
|
measurementMedium,
|
|
2481
1596
|
}, {}, {});
|
|
2482
1597
|
}
|
|
2483
|
-
/**
|
|
2484
|
-
* Create the default Pm25 Concentration Measurement Cluster Server.
|
|
2485
|
-
*
|
|
2486
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2487
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2488
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2489
|
-
*/
|
|
2490
1598
|
createDefaultPm25ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2491
1599
|
this.addClusterServer(this.getDefaultPm25ConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2492
1600
|
}
|
|
2493
|
-
/**
|
|
2494
|
-
* Returns the default Pm10 Concentration Measurement Cluster Server.
|
|
2495
|
-
*
|
|
2496
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2497
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2498
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2499
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2500
|
-
*/
|
|
2501
1601
|
getDefaultPm10ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2502
1602
|
return ClusterServer(Pm10ConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2503
1603
|
measuredValue,
|
|
@@ -2508,24 +1608,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2508
1608
|
measurementMedium,
|
|
2509
1609
|
}, {}, {});
|
|
2510
1610
|
}
|
|
2511
|
-
/**
|
|
2512
|
-
* Create the default Pm10 Concentration Measurement Cluster Server.
|
|
2513
|
-
*
|
|
2514
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2515
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2516
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2517
|
-
*/
|
|
2518
1611
|
createDefaultPm10ConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2519
1612
|
this.addClusterServer(this.getDefaultPm10ConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2520
1613
|
}
|
|
2521
|
-
/**
|
|
2522
|
-
* Returns the default Ozone Concentration Measurement Cluster Server.
|
|
2523
|
-
*
|
|
2524
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2525
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2526
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2527
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2528
|
-
*/
|
|
2529
1614
|
getDefaultOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2530
1615
|
return ClusterServer(OzoneConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2531
1616
|
measuredValue,
|
|
@@ -2536,24 +1621,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2536
1621
|
measurementMedium,
|
|
2537
1622
|
}, {}, {});
|
|
2538
1623
|
}
|
|
2539
|
-
/**
|
|
2540
|
-
* Create the default Ozone Concentration Measurement Cluster Server.
|
|
2541
|
-
*
|
|
2542
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2543
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2544
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2545
|
-
*/
|
|
2546
1624
|
createDefaultOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2547
1625
|
this.addClusterServer(this.getDefaultOzoneConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2548
1626
|
}
|
|
2549
|
-
/**
|
|
2550
|
-
* Returns the default Radon Concentration Measurement Cluster Server.
|
|
2551
|
-
*
|
|
2552
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2553
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2554
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2555
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2556
|
-
*/
|
|
2557
1627
|
getDefaultRadonConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2558
1628
|
return ClusterServer(RadonConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2559
1629
|
measuredValue,
|
|
@@ -2564,24 +1634,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2564
1634
|
measurementMedium,
|
|
2565
1635
|
}, {}, {});
|
|
2566
1636
|
}
|
|
2567
|
-
/**
|
|
2568
|
-
* Create the default Radon Concentration Measurement Cluster Server.
|
|
2569
|
-
*
|
|
2570
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2571
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2572
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2573
|
-
*/
|
|
2574
1637
|
createDefaultRadonConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ppm, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2575
1638
|
this.addClusterServer(this.getDefaultRadonConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2576
1639
|
}
|
|
2577
|
-
/**
|
|
2578
|
-
* Returns the default Nitrogen Dioxide Concentration Measurement Cluster Server.
|
|
2579
|
-
*
|
|
2580
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2581
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2582
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2583
|
-
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2584
|
-
*/
|
|
2585
1640
|
getDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2586
1641
|
return ClusterServer(NitrogenDioxideConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2587
1642
|
measuredValue,
|
|
@@ -2592,22 +1647,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2592
1647
|
measurementMedium,
|
|
2593
1648
|
}, {}, {});
|
|
2594
1649
|
}
|
|
2595
|
-
/**
|
|
2596
|
-
* Create the default Nitrogen Dioxide Concentration Measurement Cluster Server.
|
|
2597
|
-
*
|
|
2598
|
-
* @param {number} measuredValue - The measured value of the concentration.
|
|
2599
|
-
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2600
|
-
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2601
|
-
*/
|
|
2602
1650
|
createDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2603
1651
|
this.addClusterServer(this.getDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2604
1652
|
}
|
|
2605
|
-
/**
|
|
2606
|
-
* Returns the default fan control cluster server rev 2.
|
|
2607
|
-
*
|
|
2608
|
-
* @param fanMode The fan mode to set. Defaults to `FanControl.FanMode.Off`.
|
|
2609
|
-
* @returns The default fan control cluster server.
|
|
2610
|
-
*/
|
|
2611
1653
|
getDefaultFanControlClusterServer(fanMode = FanControl.FanMode.Off) {
|
|
2612
1654
|
return ClusterServer(FanControlCluster.with(FanControl.Feature.MultiSpeed, FanControl.Feature.Auto, FanControl.Feature.Step), {
|
|
2613
1655
|
fanMode,
|
|
@@ -2624,21 +1666,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2624
1666
|
},
|
|
2625
1667
|
}, {});
|
|
2626
1668
|
}
|
|
2627
|
-
/**
|
|
2628
|
-
* Create the default fan control cluster server rev 2.
|
|
2629
|
-
*
|
|
2630
|
-
* @param fanMode The fan mode to set. Defaults to `FanControl.FanMode.Off`.
|
|
2631
|
-
* @returns The default fan control cluster server.
|
|
2632
|
-
*/
|
|
2633
1669
|
createDefaultFanControlClusterServer(fanMode = FanControl.FanMode.Off) {
|
|
2634
1670
|
this.addClusterServer(this.getDefaultFanControlClusterServer(fanMode));
|
|
2635
1671
|
}
|
|
2636
|
-
/**
|
|
2637
|
-
* Returns the default Pump Configuration And Control cluster server.
|
|
2638
|
-
*
|
|
2639
|
-
* @param {PumpConfigurationAndControl.OperationMode} [pumpMode=PumpConfigurationAndControl.OperationMode.Normal] - The pump mode to set. Defaults to `PumpConfigurationAndControl.OperationMode.Normal`.
|
|
2640
|
-
* @returns {ClusterServer} - The default Pump Configuration And Control cluster server.
|
|
2641
|
-
*/
|
|
2642
1672
|
getDefaultPumpConfigurationAndControlClusterServer(pumpMode = PumpConfigurationAndControl.OperationMode.Normal) {
|
|
2643
1673
|
return ClusterServer(PumpConfigurationAndControlCluster.with(PumpConfigurationAndControl.Feature.ConstantSpeed), {
|
|
2644
1674
|
minConstSpeed: null,
|
|
@@ -2652,12 +1682,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2652
1682
|
operationMode: pumpMode,
|
|
2653
1683
|
}, {}, {});
|
|
2654
1684
|
}
|
|
2655
|
-
/**
|
|
2656
|
-
* Creates the default Pump Configuration And Control cluster server.
|
|
2657
|
-
*
|
|
2658
|
-
* @param {PumpConfigurationAndControl.OperationMode} [pumpMode=PumpConfigurationAndControl.OperationMode.Normal] - The pump mode to set. Defaults to `PumpConfigurationAndControl.OperationMode.Normal`.
|
|
2659
|
-
* @returns {void}
|
|
2660
|
-
*/
|
|
2661
1685
|
createDefaultPumpConfigurationAndControlClusterServer(pumpMode = PumpConfigurationAndControl.OperationMode.Normal) {
|
|
2662
1686
|
this.addClusterServer(this.getDefaultPumpConfigurationAndControlClusterServer(pumpMode));
|
|
2663
1687
|
}
|
|
@@ -2681,17 +1705,9 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2681
1705
|
},
|
|
2682
1706
|
}, {});
|
|
2683
1707
|
}
|
|
2684
|
-
/**
|
|
2685
|
-
* Create the default Valve Configuration And Control cluster server rev 2.
|
|
2686
|
-
*
|
|
2687
|
-
* @param {ValveConfigurationAndControl.ValveState} [valveState=ValveConfigurationAndControl.ValveState.Closed] - The valve state to set. Defaults to `ValveConfigurationAndControl.ValveState.Closed`.
|
|
2688
|
-
* @param {number} [valveLevel=0] - The valve level to set. Defaults to 0.
|
|
2689
|
-
* @returns {void}
|
|
2690
|
-
*/
|
|
2691
1708
|
createDefaultValveConfigurationAndControlClusterServer(valveState = ValveConfigurationAndControl.ValveState.Closed, valveLevel = 0) {
|
|
2692
1709
|
this.addClusterServer(this.getDefaultValveConfigurationAndControlClusterServer(valveState, valveLevel));
|
|
2693
1710
|
}
|
|
2694
|
-
// NOTE Support of Device Energy Management Cluster is provisional.
|
|
2695
1711
|
getDefaultDeviceEnergyManagementClusterServer() {
|
|
2696
1712
|
return ClusterServer(DeviceEnergyManagementCluster.with(DeviceEnergyManagement.Feature.Pausable, DeviceEnergyManagement.Feature.PowerForecastReporting, DeviceEnergyManagement.Feature.StateForecastReporting), {
|
|
2697
1713
|
esaType: DeviceEnergyManagement.EsaType.Other,
|
|
@@ -2715,7 +1731,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2715
1731
|
resumed: true,
|
|
2716
1732
|
});
|
|
2717
1733
|
}
|
|
2718
|
-
// NOTE Support of Device Energy Management Mode Cluster is provisional.
|
|
2719
1734
|
getDefaultDeviceEnergyManagementModeClusterServer() {
|
|
2720
1735
|
return ClusterServer(DeviceEnergyManagementModeCluster, {
|
|
2721
1736
|
supportedModes: [
|
|
@@ -2732,4 +1747,3 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2732
1747
|
}, {});
|
|
2733
1748
|
}
|
|
2734
1749
|
}
|
|
2735
|
-
//# sourceMappingURL=matterbridgeDevice.js.map
|