matterbridge-example-dynamic-platform 1.2.0-edge.7 → 1.2.0-edge.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appliances.js +3 -25
- package/dist/robot.js +35 -36
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/implementations/carbonMonoxideConcentrationMeasurement.js +0 -113
- package/dist/implementations/ovenCavityOperationalStateCluster.js +0 -30
- package/dist/implementations/roboticVacuumCleanerClusters.js +0 -71
package/dist/appliances.js
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import { ClusterBehavior
|
3
|
-
import { OperationalState, TemperatureControl, DishwasherMode, LaundryWasherControls, LaundryWasherMode, LaundryDryerControls, OvenMode, RefrigeratorAndTemperatureControlledCabinetMode, MicrowaveOvenMode, MicrowaveOvenControl, } from 'matterbridge/matter/clusters';
|
1
|
+
import { MatterbridgeEndpoint, MatterbridgeServer, MatterbridgeOnOffServer, Status, RefrigeratorTag, PositionTag, laundryWasher, laundryDryer, dishwasher, refrigerator, temperatureControlledCabinetCooler, oven, temperatureControlledCabinetHeater, microwaveOven, extractorHood, cooktop, cookSurface, } from 'matterbridge';
|
2
|
+
import { ClusterBehavior } from 'matterbridge/matter';
|
3
|
+
import { OperationalState, TemperatureControl, DishwasherMode, LaundryWasherControls, LaundryWasherMode, LaundryDryerControls, OvenMode, RefrigeratorAndTemperatureControlledCabinetMode, MicrowaveOvenMode, MicrowaveOvenControl, OvenCavityOperationalState, } from 'matterbridge/matter/clusters';
|
4
4
|
import { DishwasherAlarmServer, LaundryDryerControlsServer, LaundryWasherControlsServer, MicrowaveOvenControlBehavior, MicrowaveOvenModeServer, OperationalStateBehavior, TemperatureControlBehavior, } from 'matterbridge/matter/behaviors';
|
5
|
-
import { OvenCavityOperationalState } from './implementations/ovenCavityOperationalStateCluster.js';
|
6
|
-
import { AnsiLogger } from 'matterbridge/logger';
|
7
|
-
import { Robot } from './robot.js';
|
8
5
|
export class Appliances extends MatterbridgeEndpoint {
|
9
6
|
constructor(deviceType, name, serial) {
|
10
7
|
super(deviceType, { uniqueStorageKey: `${name}-${serial}` }, true);
|
@@ -514,22 +511,3 @@ class LaundryWasherModeServer extends LaundryWasherModeBehavior {
|
|
514
511
|
}
|
515
512
|
}
|
516
513
|
}
|
517
|
-
if (process.argv.includes('-testRobot')) {
|
518
|
-
const matterbridge = await Matterbridge.loadInstance(false);
|
519
|
-
matterbridge.log = new AnsiLogger({ logName: 'Matterbridge', logTimestampFormat: 4, logLevel: "debug" });
|
520
|
-
matterbridge.environment.vars.set('log.level', MatterLogLevel.DEBUG);
|
521
|
-
matterbridge.environment.vars.set('log.format', MatterLogFormat.ANSI);
|
522
|
-
matterbridge.environment.vars.set('path.root', 'matterstorage');
|
523
|
-
matterbridge.environment.vars.set('runtime.signals', true);
|
524
|
-
matterbridge.environment.vars.set('runtime.exitcode', true);
|
525
|
-
matterbridge.environment.vars.set('mdns.networkInterface', 'Wi-Fi');
|
526
|
-
await matterbridge.startMatterStorage();
|
527
|
-
const deviceType = smokeCoAlarm;
|
528
|
-
const context = await matterbridge.createServerNodeContext('Jest', deviceType.name, DeviceTypeId(deviceType.code), VendorId(0xfff1), 'Matterbridge', 0x8000, 'Matterbridge device');
|
529
|
-
const server = await matterbridge.createServerNode(context);
|
530
|
-
const device = new Robot('Robot Vacuum', '99914248654');
|
531
|
-
await server.add(device);
|
532
|
-
logEndpoint(EndpointServer.forEndpoint(device));
|
533
|
-
await matterbridge.startServerNode(server);
|
534
|
-
logEndpoint(EndpointServer.forEndpoint(server));
|
535
|
-
}
|
package/dist/robot.js
CHANGED
@@ -1,41 +1,40 @@
|
|
1
|
-
import { MatterbridgeServer, MatterbridgeEndpoint, roboticVacuumCleaner } from 'matterbridge';
|
2
|
-
import {
|
3
|
-
import { ClusterBehavior } from 'matterbridge/matter';
|
1
|
+
import { Matterbridge, MatterbridgeServer, MatterbridgeEndpoint, roboticVacuumCleaner } from 'matterbridge';
|
2
|
+
import { LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, EndpointServer, logEndpoint, DeviceTypeId, VendorId } from 'matterbridge/matter';
|
4
3
|
import { Status } from 'matterbridge/matter/types';
|
5
|
-
import { OperationalState, PowerSource, RvcRunMode, RvcCleanMode, ServiceArea } from 'matterbridge/matter/clusters';
|
6
|
-
import {
|
4
|
+
import { OperationalState, PowerSource, RvcRunMode, RvcCleanMode, RvcOperationalState, ServiceArea } from 'matterbridge/matter/clusters';
|
5
|
+
import { RvcCleanModeBehavior, RvcOperationalStateBehavior, RvcRunModeBehavior, ServiceAreaBehavior } from 'matterbridge/matter/behaviors';
|
6
|
+
import { AnsiLogger } from 'matterbridge/logger';
|
7
7
|
export class Robot extends MatterbridgeEndpoint {
|
8
8
|
constructor(name, serial) {
|
9
9
|
super(roboticVacuumCleaner, { uniqueStorageKey: `${name}-${serial}` }, true);
|
10
10
|
this.createDefaultIdentifyClusterServer()
|
11
11
|
.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Matterbridge Robot Vacuum Cleaner')
|
12
|
-
.createDefaultOnOffClusterServer()
|
13
12
|
.createDefaultRvcRunModeClusterServer()
|
14
13
|
.createDefaultRvcOperationalStateClusterServer()
|
15
14
|
.createDefaultRvcCleanModeClusterServer()
|
16
15
|
.createDefaultServiceAreaClusterServer()
|
17
16
|
.createDefaultPowerSourceRechargeableBatteryClusterServer(80, PowerSource.BatChargeLevel.Ok, 5900);
|
18
17
|
}
|
19
|
-
createDefaultRvcRunModeClusterServer() {
|
18
|
+
createDefaultRvcRunModeClusterServer(currentMode, supportedModes) {
|
20
19
|
this.behaviors.require(MatterbridgeRvcRunModeServer, {
|
21
|
-
supportedModes: [
|
20
|
+
supportedModes: supportedModes ?? [
|
22
21
|
{ label: 'Idle', mode: 1, modeTags: [{ value: RvcRunMode.ModeTag.Idle }] },
|
23
22
|
{ label: 'Cleaning', mode: 2, modeTags: [{ value: RvcRunMode.ModeTag.Cleaning }] },
|
24
23
|
{ label: 'Mapping', mode: 3, modeTags: [{ value: RvcRunMode.ModeTag.Mapping }] },
|
25
24
|
{ label: 'SpotCleaning', mode: 4, modeTags: [{ value: RvcRunMode.ModeTag.Cleaning }, { value: RvcRunMode.ModeTag.Max }] },
|
26
25
|
],
|
27
|
-
currentMode: 1,
|
26
|
+
currentMode: currentMode ?? 1,
|
28
27
|
});
|
29
28
|
return this;
|
30
29
|
}
|
31
|
-
createDefaultRvcCleanModeClusterServer() {
|
30
|
+
createDefaultRvcCleanModeClusterServer(currentMode, supportedModes) {
|
32
31
|
this.behaviors.require(MatterbridgeRvcCleanModeServer, {
|
33
|
-
supportedModes: [
|
32
|
+
supportedModes: supportedModes ?? [
|
34
33
|
{ label: 'Vacuum', mode: 1, modeTags: [{ value: RvcCleanMode.ModeTag.Vacuum }] },
|
35
34
|
{ label: 'Mop', mode: 2, modeTags: [{ value: RvcCleanMode.ModeTag.Mop }] },
|
36
35
|
{ label: 'Clean', mode: 3, modeTags: [{ value: RvcCleanMode.ModeTag.DeepClean }] },
|
37
36
|
],
|
38
|
-
currentMode: 1,
|
37
|
+
currentMode: currentMode ?? 1,
|
39
38
|
});
|
40
39
|
return this;
|
41
40
|
}
|
@@ -104,36 +103,34 @@ export class MatterbridgeServiceAreaServer extends ServiceAreaBehavior {
|
|
104
103
|
return { status: ServiceArea.SelectAreasStatus.Success, statusText: 'Succesfully selected new areas' };
|
105
104
|
}
|
106
105
|
}
|
107
|
-
export const RvcRunModeBehavior = ClusterBehavior.withInterface().for(RvcRunMode.Cluster);
|
108
106
|
export class MatterbridgeRvcRunModeServer extends RvcRunModeBehavior {
|
109
107
|
initialize() {
|
110
108
|
this.state.currentMode = 1;
|
111
109
|
}
|
112
110
|
changeToMode({ newMode }) {
|
113
111
|
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
114
|
-
const
|
115
|
-
if (!
|
112
|
+
const changedMode = this.state.supportedModes.find((mode) => mode.mode === newMode);
|
113
|
+
if (!changedMode) {
|
116
114
|
device.log.error('MatterbridgeRvcRunModeServer changeToMode called with unsupported newMode:', newMode);
|
117
115
|
return { status: Status.InvalidCommand, statusText: 'Invalid command' };
|
118
116
|
}
|
119
117
|
device.changeToMode({ newMode });
|
120
118
|
this.state.currentMode = newMode;
|
121
|
-
if (
|
119
|
+
if (changedMode.modeTags.find((tag) => tag.value === RvcRunMode.ModeTag.Cleaning)) {
|
122
120
|
device.log.info('***MatterbridgeRvcRunModeServer changeToMode called with newMode Cleaning => Running');
|
123
121
|
this.agent.get(MatterbridgeRvcOperationalStateServer).state.operationalState = RvcOperationalState.OperationalState.Running;
|
124
122
|
return { status: Status.Success, statusText: 'Running' };
|
125
123
|
}
|
126
|
-
else if (
|
124
|
+
else if (changedMode.modeTags.find((tag) => tag.value === RvcRunMode.ModeTag.Idle)) {
|
127
125
|
device.log.info('***MatterbridgeRvcRunModeServer changeToMode called with newMode Idle => Docked');
|
128
126
|
this.agent.get(MatterbridgeRvcOperationalStateServer).state.operationalState = RvcOperationalState.OperationalState.Docked;
|
129
127
|
return { status: Status.Success, statusText: 'Docked' };
|
130
128
|
}
|
131
|
-
device.log.info(`***MatterbridgeRvcRunModeServer changeToMode called with newMode ${newMode} => ${
|
129
|
+
device.log.info(`***MatterbridgeRvcRunModeServer changeToMode called with newMode ${newMode} => ${changedMode.label}`);
|
132
130
|
this.agent.get(MatterbridgeRvcOperationalStateServer).state.operationalState = RvcOperationalState.OperationalState.Running;
|
133
131
|
return { status: Status.Success, statusText: 'Success' };
|
134
132
|
}
|
135
133
|
}
|
136
|
-
export const RvcCleanModeBehavior = ClusterBehavior.withInterface().for(RvcCleanMode.Cluster);
|
137
134
|
export class MatterbridgeRvcCleanModeServer extends RvcCleanModeBehavior {
|
138
135
|
initialize() {
|
139
136
|
this.state.currentMode = 1;
|
@@ -151,29 +148,12 @@ export class MatterbridgeRvcCleanModeServer extends RvcCleanModeBehavior {
|
|
151
148
|
return { status: Status.Success, statusText: 'Success' };
|
152
149
|
}
|
153
150
|
}
|
154
|
-
export const RvcOperationalStateBehavior = ClusterBehavior.withInterface().for(RvcOperationalState.Cluster);
|
155
151
|
export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateBehavior {
|
156
152
|
initialize() {
|
157
153
|
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
158
154
|
device.log.info('***MatterbridgeRvcOperationalStateServer initialized: setting operational state to Docked');
|
159
155
|
this.state.operationalState = RvcOperationalState.OperationalState.Docked;
|
160
156
|
this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
|
161
|
-
this.reactTo(this.agent.get(OnOffServer).events.onOff$Changed, this.handleOnOffChange);
|
162
|
-
}
|
163
|
-
handleOnOffChange(onOff) {
|
164
|
-
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
165
|
-
if (onOff) {
|
166
|
-
device.log.info('***OnOffServer changed to ON: setting operational state to Running');
|
167
|
-
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2;
|
168
|
-
this.state.operationalState = RvcOperationalState.OperationalState.Running;
|
169
|
-
this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
|
170
|
-
}
|
171
|
-
else {
|
172
|
-
device.log.info('***OnOffServer changed to OFF: setting operational state to Docked');
|
173
|
-
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
|
174
|
-
this.state.operationalState = RvcOperationalState.OperationalState.Docked;
|
175
|
-
this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
|
176
|
-
}
|
177
157
|
}
|
178
158
|
pause() {
|
179
159
|
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
@@ -206,3 +186,22 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateBe
|
|
206
186
|
};
|
207
187
|
}
|
208
188
|
}
|
189
|
+
if (process.argv.includes('-testRobot')) {
|
190
|
+
const matterbridge = await Matterbridge.loadInstance(false);
|
191
|
+
matterbridge.log = new AnsiLogger({ logName: 'Matterbridge', logTimestampFormat: 4, logLevel: "debug" });
|
192
|
+
matterbridge.environment.vars.set('log.level', MatterLogLevel.DEBUG);
|
193
|
+
matterbridge.environment.vars.set('log.format', MatterLogFormat.ANSI);
|
194
|
+
matterbridge.environment.vars.set('path.root', 'matterstorage');
|
195
|
+
matterbridge.environment.vars.set('runtime.signals', true);
|
196
|
+
matterbridge.environment.vars.set('runtime.exitcode', true);
|
197
|
+
matterbridge.environment.vars.set('mdns.networkInterface', 'Wi-Fi');
|
198
|
+
await matterbridge.startMatterStorage();
|
199
|
+
const deviceType = roboticVacuumCleaner;
|
200
|
+
const context = await matterbridge.createServerNodeContext('Jest', deviceType.name, DeviceTypeId(deviceType.code), VendorId(0xfff1), 'Matterbridge', 0x8000, 'Matterbridge device');
|
201
|
+
const server = await matterbridge.createServerNode(context);
|
202
|
+
const device = new Robot('Robot Vacuum', '99914248654');
|
203
|
+
await server.add(device);
|
204
|
+
logEndpoint(EndpointServer.forEndpoint(device));
|
205
|
+
await matterbridge.startServerNode(server);
|
206
|
+
logEndpoint(EndpointServer.forEndpoint(server));
|
207
|
+
}
|
package/npm-shrinkwrap.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
3
|
-
"version": "1.2.0-edge.
|
3
|
+
"version": "1.2.0-edge.8",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
9
|
-
"version": "1.2.0-edge.
|
9
|
+
"version": "1.2.0-edge.8",
|
10
10
|
"license": "MIT",
|
11
11
|
"dependencies": {
|
12
12
|
"node-ansi-logger": "3.0.1",
|
package/package.json
CHANGED
@@ -1,113 +0,0 @@
|
|
1
|
-
import { ClusterBehavior } from 'matterbridge/matter';
|
2
|
-
import { Attribute, MutableCluster, OptionalAttribute, TlvEnum, TlvNullable, TlvUInt32, TlvFloat, FixedAttribute, BitFlag, ClusterType, ClusterRegistry, } from 'matterbridge/matter/types';
|
3
|
-
export var CarbonMonoxideConcentrationMeasurement;
|
4
|
-
(function (CarbonMonoxideConcentrationMeasurement) {
|
5
|
-
let Feature;
|
6
|
-
(function (Feature) {
|
7
|
-
Feature["NumericMeasurement"] = "NumericMeasurement";
|
8
|
-
Feature["LevelIndication"] = "LevelIndication";
|
9
|
-
Feature["MediumLevel"] = "MediumLevel";
|
10
|
-
Feature["CriticalLevel"] = "CriticalLevel";
|
11
|
-
Feature["PeakMeasurement"] = "PeakMeasurement";
|
12
|
-
Feature["AverageMeasurement"] = "AverageMeasurement";
|
13
|
-
})(Feature = CarbonMonoxideConcentrationMeasurement.Feature || (CarbonMonoxideConcentrationMeasurement.Feature = {}));
|
14
|
-
let MeasurementUnit;
|
15
|
-
(function (MeasurementUnit) {
|
16
|
-
MeasurementUnit[MeasurementUnit["Ppm"] = 0] = "Ppm";
|
17
|
-
MeasurementUnit[MeasurementUnit["Ppb"] = 1] = "Ppb";
|
18
|
-
MeasurementUnit[MeasurementUnit["Ppt"] = 2] = "Ppt";
|
19
|
-
MeasurementUnit[MeasurementUnit["Mgm3"] = 3] = "Mgm3";
|
20
|
-
MeasurementUnit[MeasurementUnit["Ugm3"] = 4] = "Ugm3";
|
21
|
-
MeasurementUnit[MeasurementUnit["Ngm3"] = 5] = "Ngm3";
|
22
|
-
MeasurementUnit[MeasurementUnit["Pm3"] = 6] = "Pm3";
|
23
|
-
MeasurementUnit[MeasurementUnit["Bqm3"] = 7] = "Bqm3";
|
24
|
-
})(MeasurementUnit = CarbonMonoxideConcentrationMeasurement.MeasurementUnit || (CarbonMonoxideConcentrationMeasurement.MeasurementUnit = {}));
|
25
|
-
let LevelValue;
|
26
|
-
(function (LevelValue) {
|
27
|
-
LevelValue[LevelValue["Unknown"] = 0] = "Unknown";
|
28
|
-
LevelValue[LevelValue["Low"] = 1] = "Low";
|
29
|
-
LevelValue[LevelValue["Medium"] = 2] = "Medium";
|
30
|
-
LevelValue[LevelValue["High"] = 3] = "High";
|
31
|
-
LevelValue[LevelValue["Critical"] = 4] = "Critical";
|
32
|
-
})(LevelValue = CarbonMonoxideConcentrationMeasurement.LevelValue || (CarbonMonoxideConcentrationMeasurement.LevelValue = {}));
|
33
|
-
let MeasurementMedium;
|
34
|
-
(function (MeasurementMedium) {
|
35
|
-
MeasurementMedium[MeasurementMedium["Air"] = 0] = "Air";
|
36
|
-
MeasurementMedium[MeasurementMedium["Water"] = 1] = "Water";
|
37
|
-
MeasurementMedium[MeasurementMedium["Soil"] = 2] = "Soil";
|
38
|
-
})(MeasurementMedium = CarbonMonoxideConcentrationMeasurement.MeasurementMedium || (CarbonMonoxideConcentrationMeasurement.MeasurementMedium = {}));
|
39
|
-
CarbonMonoxideConcentrationMeasurement.NumericMeasurementComponent = MutableCluster.Component({
|
40
|
-
attributes: {
|
41
|
-
measuredValue: Attribute(0x0, TlvNullable(TlvFloat), { default: null }),
|
42
|
-
minMeasuredValue: Attribute(0x1, TlvNullable(TlvFloat), { default: null }),
|
43
|
-
maxMeasuredValue: Attribute(0x2, TlvNullable(TlvFloat), { default: null }),
|
44
|
-
uncertainty: OptionalAttribute(0x7, TlvFloat),
|
45
|
-
measurementUnit: FixedAttribute(0x8, TlvEnum()),
|
46
|
-
},
|
47
|
-
});
|
48
|
-
CarbonMonoxideConcentrationMeasurement.PeakMeasurementComponent = MutableCluster.Component({
|
49
|
-
attributes: {
|
50
|
-
peakMeasuredValue: Attribute(0x3, TlvNullable(TlvFloat), { default: null }),
|
51
|
-
peakMeasuredValueWindow: Attribute(0x4, TlvUInt32.bound({ max: 604800 }), { default: 1 }),
|
52
|
-
},
|
53
|
-
});
|
54
|
-
CarbonMonoxideConcentrationMeasurement.AverageMeasurementComponent = MutableCluster.Component({
|
55
|
-
attributes: {
|
56
|
-
averageMeasuredValue: Attribute(0x5, TlvNullable(TlvFloat), { default: null }),
|
57
|
-
averageMeasuredValueWindow: Attribute(0x6, TlvUInt32.bound({ max: 604800 }), { default: 1 }),
|
58
|
-
},
|
59
|
-
});
|
60
|
-
CarbonMonoxideConcentrationMeasurement.LevelIndicationComponent = MutableCluster.Component({
|
61
|
-
attributes: {
|
62
|
-
levelValue: Attribute(0xa, TlvEnum(), { default: LevelValue.Unknown }),
|
63
|
-
},
|
64
|
-
});
|
65
|
-
CarbonMonoxideConcentrationMeasurement.Base = MutableCluster.Component({
|
66
|
-
id: 0x40c,
|
67
|
-
name: 'CarbonMonoxideConcentrationMeasurement',
|
68
|
-
revision: 3,
|
69
|
-
features: {
|
70
|
-
numericMeasurement: BitFlag(0),
|
71
|
-
levelIndication: BitFlag(1),
|
72
|
-
mediumLevel: BitFlag(2),
|
73
|
-
criticalLevel: BitFlag(3),
|
74
|
-
peakMeasurement: BitFlag(4),
|
75
|
-
averageMeasurement: BitFlag(5),
|
76
|
-
},
|
77
|
-
attributes: {
|
78
|
-
measurementMedium: FixedAttribute(0x9, TlvEnum()),
|
79
|
-
},
|
80
|
-
extensions: MutableCluster.Extensions({ flags: { numericMeasurement: true }, component: CarbonMonoxideConcentrationMeasurement.NumericMeasurementComponent }, { flags: { peakMeasurement: true }, component: CarbonMonoxideConcentrationMeasurement.PeakMeasurementComponent }, { flags: { averageMeasurement: true }, component: CarbonMonoxideConcentrationMeasurement.AverageMeasurementComponent }, { flags: { levelIndication: true }, component: CarbonMonoxideConcentrationMeasurement.LevelIndicationComponent }, { flags: { mediumLevel: true, levelIndication: false }, component: false }, { flags: { criticalLevel: true, levelIndication: false }, component: false }, { flags: { peakMeasurement: true, numericMeasurement: false }, component: false }, { flags: { averageMeasurement: true, numericMeasurement: false }, component: false }, { flags: { numericMeasurement: false, levelIndication: false }, component: false }),
|
81
|
-
});
|
82
|
-
CarbonMonoxideConcentrationMeasurement.ClusterInstance = MutableCluster.ExtensibleOnly(CarbonMonoxideConcentrationMeasurement.Base);
|
83
|
-
CarbonMonoxideConcentrationMeasurement.Cluster = CarbonMonoxideConcentrationMeasurement.ClusterInstance;
|
84
|
-
const MEA = { numericMeasurement: true };
|
85
|
-
const PEA = { peakMeasurement: true };
|
86
|
-
const AVG = { averageMeasurement: true };
|
87
|
-
const LEV = { levelIndication: true };
|
88
|
-
CarbonMonoxideConcentrationMeasurement.CompleteInstance = MutableCluster({
|
89
|
-
id: CarbonMonoxideConcentrationMeasurement.Base.id,
|
90
|
-
name: CarbonMonoxideConcentrationMeasurement.Base.name,
|
91
|
-
revision: CarbonMonoxideConcentrationMeasurement.Base.revision,
|
92
|
-
features: CarbonMonoxideConcentrationMeasurement.Base.features,
|
93
|
-
attributes: {
|
94
|
-
...CarbonMonoxideConcentrationMeasurement.Base.attributes,
|
95
|
-
measuredValue: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.NumericMeasurementComponent.attributes.measuredValue, { mandatoryIf: [MEA] }),
|
96
|
-
minMeasuredValue: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.NumericMeasurementComponent.attributes.minMeasuredValue, { mandatoryIf: [MEA] }),
|
97
|
-
maxMeasuredValue: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.NumericMeasurementComponent.attributes.maxMeasuredValue, { mandatoryIf: [MEA] }),
|
98
|
-
peakMeasuredValue: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.PeakMeasurementComponent.attributes.peakMeasuredValue, { mandatoryIf: [PEA] }),
|
99
|
-
peakMeasuredValueWindow: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.PeakMeasurementComponent.attributes.peakMeasuredValueWindow, { mandatoryIf: [PEA] }),
|
100
|
-
averageMeasuredValue: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.AverageMeasurementComponent.attributes.averageMeasuredValue, { mandatoryIf: [AVG] }),
|
101
|
-
averageMeasuredValueWindow: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.AverageMeasurementComponent.attributes.averageMeasuredValueWindow, { mandatoryIf: [AVG] }),
|
102
|
-
uncertainty: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.NumericMeasurementComponent.attributes.uncertainty, { optionalIf: [MEA] }),
|
103
|
-
measurementUnit: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.NumericMeasurementComponent.attributes.measurementUnit, { mandatoryIf: [MEA] }),
|
104
|
-
levelValue: MutableCluster.AsConditional(CarbonMonoxideConcentrationMeasurement.LevelIndicationComponent.attributes.levelValue, { mandatoryIf: [LEV] }),
|
105
|
-
},
|
106
|
-
});
|
107
|
-
CarbonMonoxideConcentrationMeasurement.Complete = CarbonMonoxideConcentrationMeasurement.CompleteInstance;
|
108
|
-
})(CarbonMonoxideConcentrationMeasurement || (CarbonMonoxideConcentrationMeasurement = {}));
|
109
|
-
export const CarbonMonoxideConcentrationMeasurementCluster = CarbonMonoxideConcentrationMeasurement.Cluster;
|
110
|
-
ClusterRegistry.register(ClusterType(CarbonMonoxideConcentrationMeasurement.Complete));
|
111
|
-
export const CarbonMonoxideConcentrationMeasurementBehavior = ClusterBehavior.for(ClusterType(CarbonMonoxideConcentrationMeasurement.Base));
|
112
|
-
export class CarbonMonoxideConcentrationMeasurementServer extends CarbonMonoxideConcentrationMeasurementBehavior.for(ClusterType(CarbonMonoxideConcentrationMeasurement.Base)) {
|
113
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { OperationalState } from 'matterbridge/matter/clusters';
|
2
|
-
import { Attribute, EventPriority, MutableCluster, OptionalAttribute, TlvArray, Event, TlvEnum, TlvNullable, TlvString, TlvUInt32, TlvUInt8, OptionalEvent, ClusterRegistry, TlvNoArguments, Command, } from 'matterbridge/matter/types';
|
3
|
-
export var OvenCavityOperationalState;
|
4
|
-
(function (OvenCavityOperationalState) {
|
5
|
-
OvenCavityOperationalState.ClusterInstance = MutableCluster({
|
6
|
-
id: 0x48,
|
7
|
-
name: 'OvenCavityOperationalState',
|
8
|
-
revision: 2,
|
9
|
-
attributes: {
|
10
|
-
phaseList: Attribute(0x0, TlvNullable(TlvArray(TlvString, { maxLength: 32 }))),
|
11
|
-
currentPhase: Attribute(0x1, TlvNullable(TlvUInt8)),
|
12
|
-
countdownTime: OptionalAttribute(0x2, TlvNullable(TlvUInt32.bound({ max: 259200 })), { default: null }),
|
13
|
-
operationalStateList: Attribute(0x3, TlvArray(OperationalState.TlvOperationalStateStruct), { default: [] }),
|
14
|
-
operationalState: Attribute(0x4, TlvEnum()),
|
15
|
-
operationalError: Attribute(0x5, OperationalState.TlvErrorStateStruct),
|
16
|
-
},
|
17
|
-
commands: {
|
18
|
-
stop: Command(0x1, TlvNoArguments, 0x4, OperationalState.TlvOperationalCommandResponse),
|
19
|
-
start: Command(0x2, TlvNoArguments, 0x4, OperationalState.TlvOperationalCommandResponse),
|
20
|
-
},
|
21
|
-
events: {
|
22
|
-
operationalError: Event(0x0, EventPriority.Critical, OperationalState.TlvOperationalErrorEvent),
|
23
|
-
operationCompletion: OptionalEvent(0x1, EventPriority.Info, OperationalState.TlvOperationCompletionEvent),
|
24
|
-
},
|
25
|
-
});
|
26
|
-
OvenCavityOperationalState.Cluster = OvenCavityOperationalState.ClusterInstance;
|
27
|
-
OvenCavityOperationalState.Complete = OvenCavityOperationalState.Cluster;
|
28
|
-
})(OvenCavityOperationalState || (OvenCavityOperationalState = {}));
|
29
|
-
export const OvenCavityOperationalStateCluster = OvenCavityOperationalState.Cluster;
|
30
|
-
ClusterRegistry.register(OvenCavityOperationalState.Complete);
|
@@ -1,71 +0,0 @@
|
|
1
|
-
import { OperationalState as OperationalStateNamespace } from 'matterbridge/matter/clusters';
|
2
|
-
import { Attribute, ClusterRegistry, Event, EventPriority, MutableCluster, OptionalAttribute, OptionalCommand, OptionalEvent, TlvArray, TlvEnum, TlvField, TlvNoArguments, TlvNullable, TlvObject, TlvOptionalField, TlvString, TlvUInt32, TlvUInt8, } from 'matterbridge/matter/types';
|
3
|
-
export var RvcOperationalState;
|
4
|
-
(function (RvcOperationalState) {
|
5
|
-
let OperationalState;
|
6
|
-
(function (OperationalState) {
|
7
|
-
OperationalState[OperationalState["Stopped"] = 0] = "Stopped";
|
8
|
-
OperationalState[OperationalState["Running"] = 1] = "Running";
|
9
|
-
OperationalState[OperationalState["Paused"] = 2] = "Paused";
|
10
|
-
OperationalState[OperationalState["Error"] = 3] = "Error";
|
11
|
-
OperationalState[OperationalState["SeekingCharger"] = 64] = "SeekingCharger";
|
12
|
-
OperationalState[OperationalState["Charging"] = 65] = "Charging";
|
13
|
-
OperationalState[OperationalState["Docked"] = 66] = "Docked";
|
14
|
-
})(OperationalState = RvcOperationalState.OperationalState || (RvcOperationalState.OperationalState = {}));
|
15
|
-
RvcOperationalState.TlvOperationalStateStruct = TlvObject({
|
16
|
-
operationalStateId: TlvField(0, TlvEnum()),
|
17
|
-
operationalStateLabel: TlvOptionalField(1, TlvString.bound({ maxLength: 64 })),
|
18
|
-
});
|
19
|
-
let ErrorState;
|
20
|
-
(function (ErrorState) {
|
21
|
-
ErrorState[ErrorState["NoError"] = 0] = "NoError";
|
22
|
-
ErrorState[ErrorState["UnableToStartOrResume"] = 1] = "UnableToStartOrResume";
|
23
|
-
ErrorState[ErrorState["UnableToCompleteOperation"] = 2] = "UnableToCompleteOperation";
|
24
|
-
ErrorState[ErrorState["CommandInvalidInState"] = 3] = "CommandInvalidInState";
|
25
|
-
ErrorState[ErrorState["FailedToFindChargingDock"] = 64] = "FailedToFindChargingDock";
|
26
|
-
ErrorState[ErrorState["Stuck"] = 65] = "Stuck";
|
27
|
-
ErrorState[ErrorState["DustBinMissing"] = 66] = "DustBinMissing";
|
28
|
-
ErrorState[ErrorState["DustBinFull"] = 67] = "DustBinFull";
|
29
|
-
ErrorState[ErrorState["WaterTankEmpty"] = 68] = "WaterTankEmpty";
|
30
|
-
ErrorState[ErrorState["WaterTankMissing"] = 69] = "WaterTankMissing";
|
31
|
-
ErrorState[ErrorState["WaterTankLidOpen"] = 70] = "WaterTankLidOpen";
|
32
|
-
ErrorState[ErrorState["MopCleaningPadMissing"] = 71] = "MopCleaningPadMissing";
|
33
|
-
})(ErrorState = RvcOperationalState.ErrorState || (RvcOperationalState.ErrorState = {}));
|
34
|
-
RvcOperationalState.TlvErrorStateStruct = TlvObject({
|
35
|
-
errorStateId: TlvField(0, TlvEnum()),
|
36
|
-
errorStateLabel: TlvOptionalField(1, TlvString.bound({ maxLength: 64 })),
|
37
|
-
errorStateDetails: TlvOptionalField(2, TlvString.bound({ maxLength: 64 })),
|
38
|
-
});
|
39
|
-
RvcOperationalState.TlvOperationalCommandResponse = TlvObject({
|
40
|
-
commandResponseState: TlvField(0, RvcOperationalState.TlvErrorStateStruct),
|
41
|
-
});
|
42
|
-
RvcOperationalState.TlvOperationalErrorEvent = TlvObject({ errorState: TlvField(0, RvcOperationalState.TlvErrorStateStruct) });
|
43
|
-
RvcOperationalState.ClusterInstance = MutableCluster({
|
44
|
-
id: 0x61,
|
45
|
-
name: 'RvcOperationalState',
|
46
|
-
revision: 2,
|
47
|
-
attributes: {
|
48
|
-
phaseList: Attribute(0x0, TlvNullable(TlvArray(TlvString, { maxLength: 32 }))),
|
49
|
-
currentPhase: Attribute(0x1, TlvNullable(TlvUInt8)),
|
50
|
-
countdownTime: OptionalAttribute(0x2, TlvNullable(TlvUInt32.bound({ max: 259200 })), { default: null }),
|
51
|
-
operationalStateList: Attribute(0x3, TlvArray(RvcOperationalState.TlvOperationalStateStruct), { default: [] }),
|
52
|
-
operationalState: Attribute(0x4, TlvEnum()),
|
53
|
-
operationalError: Attribute(0x5, RvcOperationalState.TlvErrorStateStruct),
|
54
|
-
},
|
55
|
-
commands: {
|
56
|
-
pause: OptionalCommand(0x0, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
|
57
|
-
stop: OptionalCommand(0x1, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
|
58
|
-
start: OptionalCommand(0x2, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
|
59
|
-
resume: OptionalCommand(0x3, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
|
60
|
-
goHome: OptionalCommand(0x80, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
|
61
|
-
},
|
62
|
-
events: {
|
63
|
-
operationalError: Event(0x0, EventPriority.Critical, RvcOperationalState.TlvOperationalErrorEvent),
|
64
|
-
operationCompletion: OptionalEvent(0x1, EventPriority.Info, OperationalStateNamespace.TlvOperationCompletionEvent),
|
65
|
-
},
|
66
|
-
});
|
67
|
-
RvcOperationalState.Cluster = RvcOperationalState.ClusterInstance;
|
68
|
-
RvcOperationalState.Complete = RvcOperationalState.Cluster;
|
69
|
-
})(RvcOperationalState || (RvcOperationalState = {}));
|
70
|
-
export const RvcOperationalStateCluster = RvcOperationalState.Cluster;
|
71
|
-
ClusterRegistry.register(RvcOperationalState.Complete);
|