matterbridge 1.2.16 → 1.2.17
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 +21 -0
- package/dist/AirQualityCluster.d.ts.map +1 -1
- package/dist/AirQualityCluster.js.map +1 -1
- package/dist/BridgedDeviceBasicInformationCluster.d.ts +1 -1
- package/dist/BridgedDeviceBasicInformationCluster.d.ts.map +1 -1
- package/dist/BridgedDeviceBasicInformationCluster.js +1 -1
- package/dist/BridgedDeviceBasicInformationCluster.js.map +1 -1
- package/dist/TvocCluster.d.ts.map +1 -1
- package/dist/TvocCluster.js.map +1 -1
- package/dist/cli.js +8 -5
- package/dist/cli.js.map +1 -1
- package/dist/defaultConfigSchema.d.ts +2 -0
- package/dist/defaultConfigSchema.d.ts.map +1 -1
- package/dist/defaultConfigSchema.js +74 -0
- package/dist/defaultConfigSchema.js.map +1 -1
- package/dist/matterbridge.d.ts +3 -6
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +85 -148
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeController.js +1 -1
- package/dist/matterbridgeController.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +35 -45
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +102 -66
- package/dist/matterbridgeDevice.js.map +1 -1
- package/dist/utils.d.ts +19 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +104 -35
- package/dist/utils.js.map +1 -1
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.b08bfdf4.js → main.eab44937.js} +3 -3
- package/frontend/build/static/js/main.eab44937.js.map +1 -0
- package/package.json +3 -4
- package/frontend/build/static/js/main.b08bfdf4.js.map +0 -1
- /package/frontend/build/static/js/{main.b08bfdf4.js.LICENSE.txt → main.eab44937.js.LICENSE.txt} +0 -0
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License. *
|
|
22
22
|
*/
|
|
23
|
-
import { ClusterServerHandlers, ColorControl, DoorLock, Identify, LevelControl, OccupancySensing, OnOff, PowerSource, Thermostat, TimeSync, WindowCovering } from '@project-chip/matter-node.js/cluster';
|
|
23
|
+
import { ClusterServerHandlers, ColorControl, DoorLock, Identify, LevelControl, ModeSelect, OccupancySensing, OnOff, PowerSource, Thermostat, TimeSync, WindowCovering } from '@project-chip/matter-node.js/cluster';
|
|
24
24
|
import { ClusterId, EndpointNumber, VendorId } from '@project-chip/matter-node.js/datatype';
|
|
25
25
|
import { Device, DeviceTypeDefinition, Endpoint, EndpointOptions } from '@project-chip/matter-node.js/device';
|
|
26
26
|
import { AtLeastOne } from '@project-chip/matter-node.js/util';
|
|
@@ -29,7 +29,7 @@ import { AirQuality } from './AirQualityCluster.js';
|
|
|
29
29
|
import { AnsiLogger } from 'node-ansi-logger';
|
|
30
30
|
import { TvocMeasurement } from './TvocCluster.js';
|
|
31
31
|
type MakeMandatory<T> = Exclude<T, undefined>;
|
|
32
|
-
|
|
32
|
+
interface MatterbridgeDeviceCommands {
|
|
33
33
|
identify: MakeMandatory<ClusterServerHandlers<typeof Identify.Complete>['identify']>;
|
|
34
34
|
on: MakeMandatory<ClusterServerHandlers<typeof OnOff.Complete>['on']>;
|
|
35
35
|
off: MakeMandatory<ClusterServerHandlers<typeof OnOff.Complete>['off']>;
|
|
@@ -52,7 +52,7 @@ type MatterbridgeDeviceCommands = {
|
|
|
52
52
|
lockDoor: MakeMandatory<ClusterServerHandlers<typeof DoorLock.Complete>['lockDoor']>;
|
|
53
53
|
unlockDoor: MakeMandatory<ClusterServerHandlers<typeof DoorLock.Complete>['unlockDoor']>;
|
|
54
54
|
setpointRaiseLower: MakeMandatory<ClusterServerHandlers<typeof Thermostat.Complete>['setpointRaiseLower']>;
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
export declare const onOffSwitch: DeviceTypeDefinition;
|
|
57
57
|
export declare const dimmableSwitch: DeviceTypeDefinition;
|
|
58
58
|
export declare const colorTemperatureSwitch: DeviceTypeDefinition;
|
|
@@ -114,6 +114,14 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
114
114
|
* @returns {Endpoint} - The child endpoint that was added.
|
|
115
115
|
*/
|
|
116
116
|
addChildDeviceTypeWithClusterServer(endpointName: string, deviceTypes: AtLeastOne<DeviceTypeDefinition>, includeServerList: ClusterId[]): Endpoint;
|
|
117
|
+
/**
|
|
118
|
+
* Adds cluster servers to the specified endpoint based on the provided server list.
|
|
119
|
+
*
|
|
120
|
+
* @param {Endpoint} endpoint - The endpoint to add cluster servers to.
|
|
121
|
+
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
122
|
+
* @returns void
|
|
123
|
+
*/
|
|
124
|
+
addClusterServerFromList(endpoint: Endpoint, includeServerList: ClusterId[]): void;
|
|
117
125
|
/**
|
|
118
126
|
* Retrieves a child endpoint by its name.
|
|
119
127
|
*
|
|
@@ -141,7 +149,7 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
141
149
|
* @param pluginName - The name of the plugin.
|
|
142
150
|
* @returns The serialized Matterbridge device object.
|
|
143
151
|
*/
|
|
144
|
-
serialize(pluginName: string): SerializedMatterbridgeDevice;
|
|
152
|
+
serialize(pluginName: string): SerializedMatterbridgeDevice | undefined;
|
|
145
153
|
/**
|
|
146
154
|
* Returns a default static EveHistoryClusterServer object with the specified voltage, current, power, and consumption values.
|
|
147
155
|
* This shows up in HA as a static sensor!
|
|
@@ -536,12 +544,7 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
536
544
|
readonly acVoltageDivisor: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
537
545
|
readonly acCurrentMultiplier: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
538
546
|
readonly acCurrentDivisor: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
539
|
-
readonly acPowerMultiplier: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
540
|
-
* Represents a Matterbridge device.
|
|
541
|
-
* @constructor
|
|
542
|
-
* @param {DeviceTypeDefinition} definition - The definition of the device.
|
|
543
|
-
* @param {EndpointOptions} [options={}] - The options for the device.
|
|
544
|
-
*/
|
|
547
|
+
readonly acPowerMultiplier: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
545
548
|
readonly acPowerDivisor: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
546
549
|
readonly dcOverloadAlarmsMask: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
547
550
|
readonly dcVoltageOverload: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number, any>;
|
|
@@ -963,30 +966,30 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
963
966
|
/**
|
|
964
967
|
* Sets the window covering target position as the current position and stops the movement.
|
|
965
968
|
*/
|
|
966
|
-
setWindowCoveringTargetAsCurrentAndStopped(): void;
|
|
969
|
+
setWindowCoveringTargetAsCurrentAndStopped(endpoint?: Endpoint): void;
|
|
967
970
|
/**
|
|
968
971
|
* Sets the current and target status of a window covering.
|
|
969
972
|
* @param current - The current position of the window covering.
|
|
970
973
|
* @param target - The target position of the window covering.
|
|
971
974
|
* @param status - The movement status of the window covering.
|
|
972
975
|
*/
|
|
973
|
-
setWindowCoveringCurrentTargetStatus(current: number, target: number, status: WindowCovering.MovementStatus): void;
|
|
976
|
+
setWindowCoveringCurrentTargetStatus(current: number, target: number, status: WindowCovering.MovementStatus, endpoint?: Endpoint): void;
|
|
974
977
|
/**
|
|
975
978
|
* Sets the status of the window covering.
|
|
976
979
|
* @param {WindowCovering.MovementStatus} status - The movement status to set.
|
|
977
980
|
*/
|
|
978
|
-
setWindowCoveringStatus(status: WindowCovering.MovementStatus): void;
|
|
981
|
+
setWindowCoveringStatus(status: WindowCovering.MovementStatus, endpoint?: Endpoint): void;
|
|
979
982
|
/**
|
|
980
983
|
* Retrieves the status of the window covering.
|
|
981
984
|
* @returns The global operational status of the window covering.
|
|
982
985
|
*/
|
|
983
|
-
getWindowCoveringStatus(): WindowCovering.MovementStatus | undefined;
|
|
986
|
+
getWindowCoveringStatus(endpoint?: Endpoint): WindowCovering.MovementStatus | undefined;
|
|
984
987
|
/**
|
|
985
988
|
* Sets the target and current position of the window covering.
|
|
986
989
|
*
|
|
987
990
|
* @param position - The position to set, specified as a number.
|
|
988
991
|
*/
|
|
989
|
-
setWindowCoveringTargetAndCurrentPosition(position: number): void;
|
|
992
|
+
setWindowCoveringTargetAndCurrentPosition(position: number, endpoint?: Endpoint): void;
|
|
990
993
|
/**
|
|
991
994
|
* Get a default door lock cluster server.
|
|
992
995
|
*
|
|
@@ -1156,6 +1159,23 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
1156
1159
|
* This method adds a cluster server with default switch features and configurations.
|
|
1157
1160
|
*/
|
|
1158
1161
|
createDefaultSwitchClusterServer(): void;
|
|
1162
|
+
getDefaultModeSelectClusterServer(description: string, supportedModes: ModeSelect.ModeOptionStruct[], currentMode?: number, startUpMode?: number): import("@project-chip/matter-node.js/cluster").ClusterServerObj<import("@project-chip/matter-node.js/util").Merge<{
|
|
1163
|
+
readonly description: import("@project-chip/matter-node.js/cluster").FixedAttribute<string, any>;
|
|
1164
|
+
readonly standardNamespace: import("@project-chip/matter-node.js/cluster").FixedAttribute<number | null, any>;
|
|
1165
|
+
readonly supportedModes: import("@project-chip/matter-node.js/cluster").FixedAttribute<import("@project-chip/matter.js/tlv").TypeFromFields<{
|
|
1166
|
+
label: import("@project-chip/matter.js/tlv").FieldType<string>;
|
|
1167
|
+
mode: import("@project-chip/matter.js/tlv").FieldType<number>;
|
|
1168
|
+
semanticTags: import("@project-chip/matter.js/tlv").FieldType<import("@project-chip/matter.js/tlv").TypeFromFields<{
|
|
1169
|
+
mfgCode: import("@project-chip/matter.js/tlv").FieldType<VendorId | null>;
|
|
1170
|
+
value: import("@project-chip/matter.js/tlv").FieldType<number>;
|
|
1171
|
+
}>[]>;
|
|
1172
|
+
}>[], any>;
|
|
1173
|
+
readonly currentMode: import("@project-chip/matter-node.js/cluster").Attribute<number, any>;
|
|
1174
|
+
readonly startUpMode: import("@project-chip/matter-node.js/cluster").OptionalWritableAttribute<number | null, any>;
|
|
1175
|
+
}, import("@project-chip/matter-node.js/cluster").GlobalAttributes<{
|
|
1176
|
+
readonly onOff: import("@project-chip/matter.js/schema").BitFlag;
|
|
1177
|
+
}>>, {}>;
|
|
1178
|
+
createDefaultModeSelectClusterServer(endpoint?: Endpoint): void;
|
|
1159
1179
|
/**
|
|
1160
1180
|
* Get a default occupancy sensing cluster server.
|
|
1161
1181
|
*
|
|
@@ -1389,12 +1409,6 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
1389
1409
|
readonly measurementMedium: import("@project-chip/matter-node.js/cluster").OptionalAttribute<TvocMeasurement.MeasurementMediumType, any>;
|
|
1390
1410
|
readonly levelValue: import("@project-chip/matter-node.js/cluster").OptionalAttribute<TvocMeasurement.LevelValueType, any>;
|
|
1391
1411
|
}, import("@project-chip/matter-node.js/cluster").GlobalAttributes<{
|
|
1392
|
-
/**
|
|
1393
|
-
* Adds a device type to the list of device types.
|
|
1394
|
-
* If the device type is not already present in the list, it will be added.
|
|
1395
|
-
*
|
|
1396
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
1397
|
-
*/
|
|
1398
1412
|
readonly numericMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1399
1413
|
readonly levelIndication: import("@project-chip/matter.js/schema").BitFlag;
|
|
1400
1414
|
readonly mediumLevel: import("@project-chip/matter.js/schema").BitFlag;
|
|
@@ -1402,12 +1416,6 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
1402
1416
|
readonly peakMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1403
1417
|
readonly averageMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1404
1418
|
}>>, "measuredValue" | "minMeasuredValue" | "maxMeasuredValue" | "peakMeasuredValue" | "peakMeasuredValueWindow" | "averageMeasuredValue" | "averageMeasuredValueWindow" | "uncertainty" | "measurementUnit" | "measurementMedium" | "levelValue" | keyof import("@project-chip/matter-node.js/cluster").GlobalAttributes<{
|
|
1405
|
-
/**
|
|
1406
|
-
* Adds a device type to the list of device types.
|
|
1407
|
-
* If the device type is not already present in the list, it will be added.
|
|
1408
|
-
*
|
|
1409
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
1410
|
-
*/
|
|
1411
1419
|
readonly numericMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1412
1420
|
readonly levelIndication: import("@project-chip/matter.js/schema").BitFlag;
|
|
1413
1421
|
readonly mediumLevel: import("@project-chip/matter.js/schema").BitFlag;
|
|
@@ -1427,12 +1435,6 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
1427
1435
|
readonly measurementMedium: import("@project-chip/matter-node.js/cluster").OptionalAttribute<TvocMeasurement.MeasurementMediumType, any>;
|
|
1428
1436
|
readonly levelValue: import("@project-chip/matter-node.js/cluster").OptionalAttribute<TvocMeasurement.LevelValueType, any>;
|
|
1429
1437
|
}, "measuredValue" | "minMeasuredValue" | "maxMeasuredValue" | "peakMeasuredValue" | "peakMeasuredValueWindow" | "averageMeasuredValue" | "averageMeasuredValueWindow" | "uncertainty" | "measurementUnit" | "measurementMedium" | "levelValue" | keyof import("@project-chip/matter-node.js/cluster").GlobalAttributes<{
|
|
1430
|
-
/**
|
|
1431
|
-
* Adds a device type to the list of device types.
|
|
1432
|
-
* If the device type is not already present in the list, it will be added.
|
|
1433
|
-
*
|
|
1434
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
1435
|
-
*/
|
|
1436
1438
|
readonly numericMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1437
1439
|
readonly levelIndication: import("@project-chip/matter.js/schema").BitFlag;
|
|
1438
1440
|
readonly mediumLevel: import("@project-chip/matter.js/schema").BitFlag;
|
|
@@ -1452,12 +1454,6 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
1452
1454
|
readonly measurementMedium: import("@project-chip/matter-node.js/cluster").OptionalAttribute<TvocMeasurement.MeasurementMediumType, any>;
|
|
1453
1455
|
readonly levelValue: import("@project-chip/matter-node.js/cluster").OptionalAttribute<TvocMeasurement.LevelValueType, any>;
|
|
1454
1456
|
}, import("@project-chip/matter-node.js/cluster").GlobalAttributes<{
|
|
1455
|
-
/**
|
|
1456
|
-
* Adds a device type to the list of device types.
|
|
1457
|
-
* If the device type is not already present in the list, it will be added.
|
|
1458
|
-
*
|
|
1459
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
1460
|
-
*/
|
|
1461
1457
|
readonly numericMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1462
1458
|
readonly levelIndication: import("@project-chip/matter.js/schema").BitFlag;
|
|
1463
1459
|
readonly mediumLevel: import("@project-chip/matter.js/schema").BitFlag;
|
|
@@ -1465,12 +1461,6 @@ export declare class MatterbridgeDevice extends MatterbridgeDevice_base {
|
|
|
1465
1461
|
readonly peakMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1466
1462
|
readonly averageMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1467
1463
|
}>>, "measuredValue" | "minMeasuredValue" | "maxMeasuredValue" | "peakMeasuredValue" | "peakMeasuredValueWindow" | "averageMeasuredValue" | "averageMeasuredValueWindow" | "uncertainty" | "measurementUnit" | "measurementMedium" | "levelValue" | keyof import("@project-chip/matter-node.js/cluster").GlobalAttributes<{
|
|
1468
|
-
/**
|
|
1469
|
-
* Adds a device type to the list of device types.
|
|
1470
|
-
* If the device type is not already present in the list, it will be added.
|
|
1471
|
-
*
|
|
1472
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
1473
|
-
*/
|
|
1474
1464
|
readonly numericMeasurement: import("@project-chip/matter.js/schema").BitFlag;
|
|
1475
1465
|
readonly levelIndication: import("@project-chip/matter.js/schema").BitFlag;
|
|
1476
1466
|
readonly mediumLevel: import("@project-chip/matter.js/schema").BitFlag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridgeDevice.d.ts","sourceRoot":"","sources":["../src/matterbridgeDevice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"matterbridgeDevice.d.ts","sourceRoot":"","sources":["../src/matterbridgeDevice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAKL,qBAAqB,EACrB,YAAY,EAEZ,QAAQ,EAQR,QAAQ,EAIR,YAAY,EAEZ,UAAU,EAEV,gBAAgB,EAEhB,KAAK,EAEL,WAAW,EAYX,UAAU,EAIV,QAAQ,EAER,cAAc,EAKf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAiB,oBAAoB,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC7H,OAAO,EAAE,UAAU,EAA8B,MAAM,mCAAmC,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAsD,MAAM,gBAAgB,CAAC;AAGnG,OAAO,EAAE,UAAU,EAAqB,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,eAAe,EAA0B,MAAM,kBAAkB,CAAC;AAG3E,KAAK,aAAa,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,CAA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,uBAAuB,SAAK,EAAE,mBAAmB,SAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+B5I;;;;;;;OAOG;IACH,oCAAoC,CAAC,gBAAgB,SAAK,EAAE,uBAAuB,SAAK,EAAE,uBAAuB,SAAK,EAAE,mBAAmB,SAAI;IAI/I;;OAEG;IACH,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0B/B;;OAEG;IACH,kCAAkC;CAGnC"}
|
|
@@ -20,9 +20,7 @@
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License. *
|
|
22
22
|
*/
|
|
23
|
-
import { BasicInformationCluster, BooleanState, BooleanStateCluster,
|
|
24
|
-
// BridgedDeviceBasicInformationCluster,
|
|
25
|
-
ClusterServer, ColorControl, ColorControlCluster, DoorLock, DoorLockCluster, ElectricalMeasurement, ElectricalMeasurementCluster, FixedLabelCluster, FlowMeasurement, FlowMeasurementCluster, Groups, Identify, IdentifyCluster, IlluminanceMeasurement, IlluminanceMeasurementCluster, LevelControl, LevelControlCluster, OccupancySensing, OccupancySensingCluster, OnOff, OnOffCluster, PowerSource, PowerSourceCluster, PowerSourceConfigurationCluster, PressureMeasurement, PressureMeasurementCluster, RelativeHumidityMeasurement, RelativeHumidityMeasurementCluster, Scenes, Switch, SwitchCluster, TemperatureMeasurement, TemperatureMeasurementCluster, Thermostat, ThermostatCluster, ThreadNetworkDiagnostics, ThreadNetworkDiagnosticsCluster, TimeSync, TimeSyncCluster, WindowCovering, WindowCoveringCluster, createDefaultGroupsClusterServer, createDefaultScenesClusterServer, getClusterNameById, } from '@project-chip/matter-node.js/cluster';
|
|
23
|
+
import { BasicInformationCluster, BooleanState, BooleanStateCluster, ClusterServer, ColorControl, ColorControlCluster, DoorLock, DoorLockCluster, ElectricalMeasurement, ElectricalMeasurementCluster, FixedLabelCluster, FlowMeasurement, FlowMeasurementCluster, Groups, Identify, IdentifyCluster, IlluminanceMeasurement, IlluminanceMeasurementCluster, LevelControl, LevelControlCluster, ModeSelectCluster, OccupancySensing, OccupancySensingCluster, OnOff, OnOffCluster, PowerSource, PowerSourceCluster, PowerSourceConfigurationCluster, PressureMeasurement, PressureMeasurementCluster, RelativeHumidityMeasurement, RelativeHumidityMeasurementCluster, Scenes, Switch, SwitchCluster, TemperatureMeasurement, TemperatureMeasurementCluster, Thermostat, ThermostatCluster, ThreadNetworkDiagnostics, ThreadNetworkDiagnosticsCluster, TimeSync, TimeSyncCluster, WindowCovering, WindowCoveringCluster, createDefaultGroupsClusterServer, createDefaultScenesClusterServer, getClusterNameById, } from '@project-chip/matter-node.js/cluster';
|
|
26
24
|
import { EndpointNumber, VendorId } from '@project-chip/matter-node.js/datatype';
|
|
27
25
|
import { Device, DeviceClasses, DeviceTypeDefinition, Endpoint } from '@project-chip/matter-node.js/device';
|
|
28
26
|
import { extendPublicHandlerMethods } from '@project-chip/matter-node.js/util';
|
|
@@ -122,32 +120,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
122
120
|
includeServerList.forEach((clusterId) => {
|
|
123
121
|
this.log.debug(`- with cluster: ${hk}${clusterId}${db}-${hk}${getClusterNameById(clusterId)}${db}`);
|
|
124
122
|
});
|
|
125
|
-
|
|
126
|
-
this.addClusterServer(this.getDefaultIdentifyClusterServer());
|
|
127
|
-
if (includeServerList.includes(Groups.Cluster.id))
|
|
128
|
-
this.addClusterServer(this.getDefaultGroupsClusterServer());
|
|
129
|
-
if (includeServerList.includes(Scenes.Cluster.id))
|
|
130
|
-
this.addClusterServer(this.getDefaultScenesClusterServer());
|
|
131
|
-
if (includeServerList.includes(OnOff.Cluster.id))
|
|
132
|
-
this.addClusterServer(this.getDefaultOnOffClusterServer());
|
|
133
|
-
if (includeServerList.includes(TemperatureMeasurement.Cluster.id))
|
|
134
|
-
this.addClusterServer(this.getDefaultTemperatureMeasurementClusterServer());
|
|
135
|
-
if (includeServerList.includes(RelativeHumidityMeasurement.Cluster.id))
|
|
136
|
-
this.addClusterServer(this.getDefaultRelativeHumidityMeasurementClusterServer());
|
|
137
|
-
if (includeServerList.includes(PressureMeasurement.Cluster.id))
|
|
138
|
-
this.addClusterServer(this.getDefaultPressureMeasurementClusterServer());
|
|
139
|
-
if (includeServerList.includes(FlowMeasurement.Cluster.id))
|
|
140
|
-
this.addClusterServer(this.getDefaultFlowMeasurementClusterServer());
|
|
141
|
-
if (includeServerList.includes(BooleanState.Cluster.id))
|
|
142
|
-
this.addClusterServer(this.getDefaultBooleanStateClusterServer());
|
|
143
|
-
if (includeServerList.includes(OccupancySensing.Cluster.id))
|
|
144
|
-
this.addClusterServer(this.getDefaultOccupancySensingClusterServer());
|
|
145
|
-
if (includeServerList.includes(IlluminanceMeasurement.Cluster.id))
|
|
146
|
-
this.addClusterServer(this.getDefaultIlluminanceMeasurementClusterServer());
|
|
147
|
-
if (includeServerList.includes(EveHistory.Cluster.id))
|
|
148
|
-
this.addClusterServer(this.getDefaultStaticEveHistoryClusterServer());
|
|
149
|
-
if (includeServerList.includes(ElectricalMeasurement.Cluster.id))
|
|
150
|
-
this.addClusterServer(this.getDefaultElectricalMeasurementClusterServer());
|
|
123
|
+
this.addClusterServerFromList(this, includeServerList);
|
|
151
124
|
}
|
|
152
125
|
/**
|
|
153
126
|
* Adds a child device type with cluster server.
|
|
@@ -170,34 +143,62 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
170
143
|
includeServerList.forEach((clusterId) => {
|
|
171
144
|
this.log.debug(`- with cluster: ${hk}${clusterId}${db}-${hk}${getClusterNameById(clusterId)}${db}`);
|
|
172
145
|
});
|
|
146
|
+
this.addClusterServerFromList(child, includeServerList);
|
|
147
|
+
this.addChildEndpoint(child);
|
|
148
|
+
return child;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Adds cluster servers to the specified endpoint based on the provided server list.
|
|
152
|
+
*
|
|
153
|
+
* @param {Endpoint} endpoint - The endpoint to add cluster servers to.
|
|
154
|
+
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
155
|
+
* @returns void
|
|
156
|
+
*/
|
|
157
|
+
addClusterServerFromList(endpoint, includeServerList) {
|
|
173
158
|
if (includeServerList.includes(Identify.Cluster.id))
|
|
174
|
-
|
|
159
|
+
endpoint.addClusterServer(this.getDefaultIdentifyClusterServer());
|
|
175
160
|
if (includeServerList.includes(Groups.Cluster.id))
|
|
176
|
-
|
|
161
|
+
endpoint.addClusterServer(this.getDefaultGroupsClusterServer());
|
|
177
162
|
if (includeServerList.includes(Scenes.Cluster.id))
|
|
178
|
-
|
|
163
|
+
endpoint.addClusterServer(this.getDefaultScenesClusterServer());
|
|
179
164
|
if (includeServerList.includes(OnOff.Cluster.id))
|
|
180
|
-
|
|
165
|
+
endpoint.addClusterServer(this.getDefaultOnOffClusterServer());
|
|
166
|
+
if (includeServerList.includes(LevelControl.Cluster.id))
|
|
167
|
+
endpoint.addClusterServer(this.getDefaultLevelControlClusterServer());
|
|
168
|
+
if (includeServerList.includes(ColorControl.Cluster.id))
|
|
169
|
+
endpoint.addClusterServer(this.getDefaultColorControlClusterServer());
|
|
170
|
+
if (includeServerList.includes(Switch.Cluster.id))
|
|
171
|
+
endpoint.addClusterServer(this.getDefaultSwitchClusterServer());
|
|
172
|
+
if (includeServerList.includes(DoorLock.Cluster.id))
|
|
173
|
+
endpoint.addClusterServer(this.getDefaultDoorLockClusterServer());
|
|
174
|
+
if (includeServerList.includes(Thermostat.Cluster.id))
|
|
175
|
+
endpoint.addClusterServer(this.getDefaultThermostatClusterServer());
|
|
176
|
+
if (includeServerList.includes(TimeSync.Cluster.id))
|
|
177
|
+
endpoint.addClusterServer(this.getDefaultTimeSyncClusterServer());
|
|
178
|
+
if (includeServerList.includes(WindowCovering.Cluster.id))
|
|
179
|
+
endpoint.addClusterServer(this.getDefaultWindowCoveringClusterServer());
|
|
181
180
|
if (includeServerList.includes(TemperatureMeasurement.Cluster.id))
|
|
182
|
-
|
|
181
|
+
endpoint.addClusterServer(this.getDefaultTemperatureMeasurementClusterServer());
|
|
183
182
|
if (includeServerList.includes(RelativeHumidityMeasurement.Cluster.id))
|
|
184
|
-
|
|
183
|
+
endpoint.addClusterServer(this.getDefaultRelativeHumidityMeasurementClusterServer());
|
|
185
184
|
if (includeServerList.includes(PressureMeasurement.Cluster.id))
|
|
186
|
-
|
|
185
|
+
endpoint.addClusterServer(this.getDefaultPressureMeasurementClusterServer());
|
|
187
186
|
if (includeServerList.includes(FlowMeasurement.Cluster.id))
|
|
188
|
-
|
|
187
|
+
endpoint.addClusterServer(this.getDefaultFlowMeasurementClusterServer());
|
|
189
188
|
if (includeServerList.includes(BooleanState.Cluster.id))
|
|
190
|
-
|
|
189
|
+
endpoint.addClusterServer(this.getDefaultBooleanStateClusterServer());
|
|
191
190
|
if (includeServerList.includes(OccupancySensing.Cluster.id))
|
|
192
|
-
|
|
191
|
+
endpoint.addClusterServer(this.getDefaultOccupancySensingClusterServer());
|
|
193
192
|
if (includeServerList.includes(IlluminanceMeasurement.Cluster.id))
|
|
194
|
-
|
|
193
|
+
endpoint.addClusterServer(this.getDefaultIlluminanceMeasurementClusterServer());
|
|
195
194
|
if (includeServerList.includes(EveHistory.Cluster.id))
|
|
196
|
-
|
|
195
|
+
endpoint.addClusterServer(this.getDefaultStaticEveHistoryClusterServer());
|
|
197
196
|
if (includeServerList.includes(ElectricalMeasurement.Cluster.id))
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
endpoint.addClusterServer(this.getDefaultElectricalMeasurementClusterServer());
|
|
198
|
+
if (includeServerList.includes(AirQuality.Cluster.id))
|
|
199
|
+
endpoint.addClusterServer(this.getDefaultAirQualityClusterServer());
|
|
200
|
+
if (includeServerList.includes(TvocMeasurement.Cluster.id))
|
|
201
|
+
endpoint.addClusterServer(this.getDefaultTvocMeasurementClusterServer());
|
|
201
202
|
}
|
|
202
203
|
/**
|
|
203
204
|
* Retrieves a child endpoint by its name.
|
|
@@ -249,6 +250,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
249
250
|
* @returns The serialized Matterbridge device object.
|
|
250
251
|
*/
|
|
251
252
|
serialize(pluginName) {
|
|
253
|
+
if (!this.serialNumber || !this.deviceName || !this.uniqueId)
|
|
254
|
+
return;
|
|
252
255
|
const serialized = {
|
|
253
256
|
pluginName,
|
|
254
257
|
serialNumber: this.serialNumber,
|
|
@@ -915,7 +918,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
915
918
|
moveToLevel: async ({ request, attributes }) => {
|
|
916
919
|
// eslint-disable-next-line no-console
|
|
917
920
|
console.log('moveToLevel request:', request, 'attributes.currentLevel:', attributes.currentLevel.getLocal());
|
|
918
|
-
//attributes.currentLevel.setLocal(request.level);
|
|
921
|
+
// attributes.currentLevel.setLocal(request.level);
|
|
919
922
|
await this.commandHandler.executeHandler('moveToLevel', { request: request, attributes: attributes });
|
|
920
923
|
},
|
|
921
924
|
move: async () => {
|
|
@@ -933,7 +936,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
933
936
|
moveToLevelWithOnOff: async ({ request, attributes }) => {
|
|
934
937
|
// eslint-disable-next-line no-console
|
|
935
938
|
console.log('moveToLevelWithOnOff request:', request, 'attributes.currentLevel:', attributes.currentLevel.getLocal());
|
|
936
|
-
//attributes.currentLevel.setLocal(request.level);
|
|
939
|
+
// attributes.currentLevel.setLocal(request.level);
|
|
937
940
|
await this.commandHandler.executeHandler('moveToLevelWithOnOff', { request: request, attributes: attributes });
|
|
938
941
|
},
|
|
939
942
|
moveWithOnOff: async () => {
|
|
@@ -985,7 +988,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
985
988
|
moveToHue: async ({ request: request, attributes: attributes }) => {
|
|
986
989
|
// eslint-disable-next-line no-console
|
|
987
990
|
console.log('Command moveToHue request:', request, 'attributes.currentHue:', attributes.currentHue.getLocal());
|
|
988
|
-
//attributes.currentHue.setLocal(request.hue);
|
|
991
|
+
// attributes.currentHue.setLocal(request.hue);
|
|
989
992
|
this.commandHandler.executeHandler('moveToHue', { request: request, attributes: attributes });
|
|
990
993
|
},
|
|
991
994
|
moveHue: async () => {
|
|
@@ -999,7 +1002,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
999
1002
|
moveToSaturation: async ({ request: request, attributes: attributes }) => {
|
|
1000
1003
|
// eslint-disable-next-line no-console
|
|
1001
1004
|
console.log('Command moveToSaturation request:', request, 'attributes.currentSaturation:', attributes.currentSaturation.getLocal());
|
|
1002
|
-
//attributes.currentSaturation.setLocal(request.saturation);
|
|
1005
|
+
// attributes.currentSaturation.setLocal(request.saturation);
|
|
1003
1006
|
this.commandHandler.executeHandler('moveToSaturation', { request: request, attributes: attributes });
|
|
1004
1007
|
},
|
|
1005
1008
|
moveSaturation: async () => {
|
|
@@ -1013,8 +1016,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1013
1016
|
moveToHueAndSaturation: async ({ request: request, attributes: attributes }) => {
|
|
1014
1017
|
// eslint-disable-next-line no-console
|
|
1015
1018
|
console.log('Command moveToHueAndSaturation request:', request, 'attributes.currentHue:', attributes.currentHue.getLocal(), 'attributes.currentSaturation:', attributes.currentSaturation.getLocal());
|
|
1016
|
-
//attributes.currentHue.setLocal(request.hue);
|
|
1017
|
-
//attributes.currentSaturation.setLocal(request.saturation);
|
|
1019
|
+
// attributes.currentHue.setLocal(request.hue);
|
|
1020
|
+
// attributes.currentSaturation.setLocal(request.saturation);
|
|
1018
1021
|
this.commandHandler.executeHandler('moveToHueAndSaturation', { request: request, attributes: attributes });
|
|
1019
1022
|
},
|
|
1020
1023
|
stopMoveStep: async () => {
|
|
@@ -1024,7 +1027,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1024
1027
|
moveToColorTemperature: async ({ request: request, attributes: attributes }) => {
|
|
1025
1028
|
// eslint-disable-next-line no-console
|
|
1026
1029
|
console.log('Command moveToColorTemperature request:', request, 'attributes.colorTemperatureMireds:', attributes.colorTemperatureMireds.getLocal());
|
|
1027
|
-
//attributes.colorTemperatureMireds.setLocal(request.colorTemperatureMireds);
|
|
1030
|
+
// attributes.colorTemperatureMireds.setLocal(request.colorTemperatureMireds);
|
|
1028
1031
|
this.commandHandler.executeHandler('moveToColorTemperature', { request: request, attributes: attributes });
|
|
1029
1032
|
},
|
|
1030
1033
|
moveColorTemperature: async () => {
|
|
@@ -1108,8 +1111,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1108
1111
|
/**
|
|
1109
1112
|
* Sets the window covering target position as the current position and stops the movement.
|
|
1110
1113
|
*/
|
|
1111
|
-
setWindowCoveringTargetAsCurrentAndStopped() {
|
|
1112
|
-
|
|
1114
|
+
setWindowCoveringTargetAsCurrentAndStopped(endpoint) {
|
|
1115
|
+
if (!endpoint)
|
|
1116
|
+
endpoint = this;
|
|
1117
|
+
const windowCoveringCluster = endpoint.getClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift, WindowCovering.Feature.AbsolutePosition));
|
|
1113
1118
|
if (windowCoveringCluster) {
|
|
1114
1119
|
const position = windowCoveringCluster.getCurrentPositionLiftPercent100thsAttribute();
|
|
1115
1120
|
if (position !== null) {
|
|
@@ -1121,7 +1126,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1121
1126
|
});
|
|
1122
1127
|
}
|
|
1123
1128
|
// eslint-disable-next-line no-console
|
|
1124
|
-
|
|
1129
|
+
console.log(`Set WindowCovering initial currentPositionLiftPercent100ths and targetPositionLiftPercent100ths to ${position} and operationalStatus to Stopped.`);
|
|
1125
1130
|
}
|
|
1126
1131
|
}
|
|
1127
1132
|
/**
|
|
@@ -1130,8 +1135,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1130
1135
|
* @param target - The target position of the window covering.
|
|
1131
1136
|
* @param status - The movement status of the window covering.
|
|
1132
1137
|
*/
|
|
1133
|
-
setWindowCoveringCurrentTargetStatus(current, target, status) {
|
|
1134
|
-
|
|
1138
|
+
setWindowCoveringCurrentTargetStatus(current, target, status, endpoint) {
|
|
1139
|
+
if (!endpoint)
|
|
1140
|
+
endpoint = this;
|
|
1141
|
+
const windowCoveringCluster = endpoint.getClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift, WindowCovering.Feature.AbsolutePosition));
|
|
1135
1142
|
if (windowCoveringCluster) {
|
|
1136
1143
|
windowCoveringCluster.setCurrentPositionLiftPercent100thsAttribute(current);
|
|
1137
1144
|
windowCoveringCluster.setTargetPositionLiftPercent100thsAttribute(target);
|
|
@@ -1142,31 +1149,35 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1142
1149
|
});
|
|
1143
1150
|
}
|
|
1144
1151
|
// eslint-disable-next-line no-console
|
|
1145
|
-
|
|
1152
|
+
console.log(`Set WindowCovering currentPositionLiftPercent100ths: ${current}, targetPositionLiftPercent100ths: ${target} and operationalStatus: ${status}.`);
|
|
1146
1153
|
}
|
|
1147
1154
|
/**
|
|
1148
1155
|
* Sets the status of the window covering.
|
|
1149
1156
|
* @param {WindowCovering.MovementStatus} status - The movement status to set.
|
|
1150
1157
|
*/
|
|
1151
|
-
setWindowCoveringStatus(status) {
|
|
1152
|
-
|
|
1158
|
+
setWindowCoveringStatus(status, endpoint) {
|
|
1159
|
+
if (!endpoint)
|
|
1160
|
+
endpoint = this;
|
|
1161
|
+
const windowCovering = endpoint.getClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift, WindowCovering.Feature.AbsolutePosition));
|
|
1153
1162
|
if (!windowCovering)
|
|
1154
1163
|
return;
|
|
1155
1164
|
windowCovering.setOperationalStatusAttribute({ global: status, lift: status, tilt: 0 });
|
|
1156
1165
|
// eslint-disable-next-line no-console
|
|
1157
|
-
|
|
1166
|
+
console.log(`Set WindowCovering operationalStatus: ${status}`);
|
|
1158
1167
|
}
|
|
1159
1168
|
/**
|
|
1160
1169
|
* Retrieves the status of the window covering.
|
|
1161
1170
|
* @returns The global operational status of the window covering.
|
|
1162
1171
|
*/
|
|
1163
|
-
getWindowCoveringStatus() {
|
|
1164
|
-
|
|
1172
|
+
getWindowCoveringStatus(endpoint) {
|
|
1173
|
+
if (!endpoint)
|
|
1174
|
+
endpoint = this;
|
|
1175
|
+
const windowCovering = endpoint.getClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift, WindowCovering.Feature.AbsolutePosition));
|
|
1165
1176
|
if (!windowCovering)
|
|
1166
1177
|
return undefined;
|
|
1167
1178
|
const status = windowCovering.getOperationalStatusAttribute();
|
|
1168
1179
|
// eslint-disable-next-line no-console
|
|
1169
|
-
|
|
1180
|
+
console.log(`Get WindowCovering operationalStatus: ${status.global}`);
|
|
1170
1181
|
return status.global;
|
|
1171
1182
|
}
|
|
1172
1183
|
/**
|
|
@@ -1174,14 +1185,16 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1174
1185
|
*
|
|
1175
1186
|
* @param position - The position to set, specified as a number.
|
|
1176
1187
|
*/
|
|
1177
|
-
setWindowCoveringTargetAndCurrentPosition(position) {
|
|
1178
|
-
|
|
1188
|
+
setWindowCoveringTargetAndCurrentPosition(position, endpoint) {
|
|
1189
|
+
if (!endpoint)
|
|
1190
|
+
endpoint = this;
|
|
1191
|
+
const windowCovering = endpoint.getClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift));
|
|
1179
1192
|
if (!windowCovering)
|
|
1180
1193
|
return;
|
|
1181
1194
|
windowCovering.setCurrentPositionLiftPercent100thsAttribute(position);
|
|
1182
1195
|
windowCovering.setTargetPositionLiftPercent100thsAttribute(position);
|
|
1183
1196
|
// eslint-disable-next-line no-console
|
|
1184
|
-
|
|
1197
|
+
console.log(`Set WindowCovering currentPositionLiftPercent100ths: ${position} and targetPositionLiftPercent100ths: ${position}.`);
|
|
1185
1198
|
}
|
|
1186
1199
|
/**
|
|
1187
1200
|
* Get a default door lock cluster server.
|
|
@@ -1255,6 +1268,29 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1255
1268
|
this.addFixedLabel('orientation', 'Switch');
|
|
1256
1269
|
this.addFixedLabel('label', 'Switch');
|
|
1257
1270
|
}
|
|
1271
|
+
getDefaultModeSelectClusterServer(description, supportedModes, currentMode = 0, startUpMode = 0) {
|
|
1272
|
+
return ClusterServer(ModeSelectCluster, {
|
|
1273
|
+
description: description,
|
|
1274
|
+
standardNamespace: null,
|
|
1275
|
+
supportedModes: supportedModes,
|
|
1276
|
+
currentMode: currentMode,
|
|
1277
|
+
startUpMode: startUpMode,
|
|
1278
|
+
}, {
|
|
1279
|
+
changeToMode: async (data) => {
|
|
1280
|
+
// eslint-disable-next-line no-console
|
|
1281
|
+
console.log('changeToMode', data.request);
|
|
1282
|
+
await this.commandHandler.executeHandler('changeToMode', data);
|
|
1283
|
+
},
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
createDefaultModeSelectClusterServer(endpoint) {
|
|
1287
|
+
if (!endpoint)
|
|
1288
|
+
endpoint = this;
|
|
1289
|
+
endpoint.addClusterServer(this.getDefaultModeSelectClusterServer('Mode select', [
|
|
1290
|
+
{ label: 'Mode 0', mode: 0, semanticTags: [{ mfgCode: VendorId(0xfff1), value: 0 }] },
|
|
1291
|
+
{ label: 'Mode 1', mode: 1, semanticTags: [{ mfgCode: VendorId(0xfff1), value: 1 }] },
|
|
1292
|
+
]));
|
|
1293
|
+
}
|
|
1258
1294
|
/**
|
|
1259
1295
|
* Get a default occupancy sensing cluster server.
|
|
1260
1296
|
*
|