matterbridge 3.0.0-edge.2 → 3.0.0-edge.4

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 CHANGED
@@ -59,21 +59,25 @@ Modified clusters:
59
59
  - [doorLock]: Fixed supportedOperatingModes inverted bitmap (Thanks Apollon).
60
60
  - [DevicesIcon]: Fixed rendering of leak freeze and rain sensors.
61
61
 
62
- ## [2.2.8] - 2025-04-08
62
+ ## [2.2.8] - 2025-04-10
63
63
 
64
64
  ### Added
65
65
 
66
- - [platform]: Added stack to errors messages.
66
+ - [platform]: Added stack to error messages.
67
+ - [endpoint]: Added createLevelControlClusterServer()
67
68
  - [endpoint]: Added createLevelTvocMeasurementClusterServer()
69
+ - [frontend]: Added a restart button on the QRCode panel when the advertising for a not paired node is expired.
68
70
 
69
71
  ### Changed
70
72
 
71
73
  - [package]: Update dependencies.
72
74
  - [package]: Use node:https.
75
+ - [endpoint]: Modified createOnOffClusterServer().
73
76
 
74
77
  ### Fixed
75
78
 
76
79
  - [homepage]: Fixed warning log for homepage property in package.json.
80
+ - [DevicesIcon]: Fixed rendering of rain, freeze and leak sensors.
77
81
 
78
82
  <a href="https://www.buymeacoffee.com/luligugithub">
79
83
  <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
@@ -1,205 +1 @@
1
- import { ModeBase } from '@matter/main/clusters/mode-base';
2
- import { Attribute, BitFlag, ClusterRegistry, Command, Event, EventPriority, FixedAttribute, MutableCluster, OptionalAttribute, OptionalCommand, OptionalEvent, TlvArray, TlvEnum, TlvField, TlvNoArguments, TlvNullable, TlvObject, TlvOptionalField, TlvString, TlvUInt32, TlvUInt8, TlvVendorId, WritableAttribute, } from '@matter/main/types';
3
- import { OperationalState as OperationalStateNamespace } from '@matter/main/clusters/operational-state';
4
- export var RvcRunMode;
5
- (function (RvcRunMode) {
6
- let Feature;
7
- (function (Feature) {
8
- Feature["OnOff"] = "OnOff";
9
- })(Feature = RvcRunMode.Feature || (RvcRunMode.Feature = {}));
10
- let ModeTag;
11
- (function (ModeTag) {
12
- ModeTag[ModeTag["Auto"] = 0] = "Auto";
13
- ModeTag[ModeTag["Quick"] = 1] = "Quick";
14
- ModeTag[ModeTag["Quiet"] = 2] = "Quiet";
15
- ModeTag[ModeTag["LowNoise"] = 3] = "LowNoise";
16
- ModeTag[ModeTag["LowEnergy"] = 4] = "LowEnergy";
17
- ModeTag[ModeTag["Vacation"] = 5] = "Vacation";
18
- ModeTag[ModeTag["Min"] = 6] = "Min";
19
- ModeTag[ModeTag["Max"] = 7] = "Max";
20
- ModeTag[ModeTag["Night"] = 8] = "Night";
21
- ModeTag[ModeTag["Day"] = 9] = "Day";
22
- ModeTag[ModeTag["Idle"] = 16384] = "Idle";
23
- ModeTag[ModeTag["Cleaning"] = 16385] = "Cleaning";
24
- ModeTag[ModeTag["Mapping"] = 16386] = "Mapping";
25
- })(ModeTag = RvcRunMode.ModeTag || (RvcRunMode.ModeTag = {}));
26
- RvcRunMode.TlvModeTagStruct = TlvObject({
27
- mfgCode: TlvOptionalField(0, TlvVendorId),
28
- value: TlvField(1, TlvEnum()),
29
- });
30
- RvcRunMode.TlvModeOption = TlvObject({
31
- label: TlvField(0, TlvString.bound({ maxLength: 64 })),
32
- mode: TlvField(1, TlvUInt8),
33
- modeTags: TlvField(2, TlvArray(RvcRunMode.TlvModeTagStruct, { maxLength: 8 })),
34
- });
35
- let ModeChangeStatus;
36
- (function (ModeChangeStatus) {
37
- ModeChangeStatus[ModeChangeStatus["Stuck"] = 65] = "Stuck";
38
- ModeChangeStatus[ModeChangeStatus["DustBinMissing"] = 66] = "DustBinMissing";
39
- ModeChangeStatus[ModeChangeStatus["DustBinFull"] = 67] = "DustBinFull";
40
- ModeChangeStatus[ModeChangeStatus["WaterTankEmpty"] = 68] = "WaterTankEmpty";
41
- ModeChangeStatus[ModeChangeStatus["WaterTankMissing"] = 69] = "WaterTankMissing";
42
- ModeChangeStatus[ModeChangeStatus["WaterTankLidOpen"] = 70] = "WaterTankLidOpen";
43
- ModeChangeStatus[ModeChangeStatus["MopCleaningPadMissing"] = 71] = "MopCleaningPadMissing";
44
- ModeChangeStatus[ModeChangeStatus["BatteryLow"] = 72] = "BatteryLow";
45
- })(ModeChangeStatus = RvcRunMode.ModeChangeStatus || (RvcRunMode.ModeChangeStatus = {}));
46
- RvcRunMode.OnOffComponent = MutableCluster.Component({
47
- attributes: {
48
- startUpMode: WritableAttribute(0x2, TlvNullable(TlvUInt8), { persistent: true }),
49
- onMode: WritableAttribute(0x3, TlvNullable(TlvUInt8), { persistent: true, default: null }),
50
- },
51
- });
52
- RvcRunMode.Base = MutableCluster.Component({
53
- id: 0x54,
54
- name: 'RvcRunMode',
55
- revision: 3,
56
- features: {
57
- onOff: BitFlag(0),
58
- },
59
- attributes: {
60
- supportedModes: FixedAttribute(0x0, TlvArray(RvcRunMode.TlvModeOption, { minLength: 2, maxLength: 255 }), { default: [] }),
61
- currentMode: Attribute(0x1, TlvUInt8, { persistent: true }),
62
- },
63
- commands: {
64
- changeToMode: Command(0x0, ModeBase.TlvChangeToModeRequest, 0x1, ModeBase.TlvChangeToModeResponse),
65
- },
66
- extensions: MutableCluster.Extensions({ flags: { onOff: true }, component: RvcRunMode.OnOffComponent }),
67
- });
68
- RvcRunMode.ClusterInstance = MutableCluster(RvcRunMode.Base);
69
- RvcRunMode.Cluster = RvcRunMode.ClusterInstance;
70
- RvcRunMode.Complete = RvcRunMode.Cluster;
71
- })(RvcRunMode || (RvcRunMode = {}));
72
- export const RvcRunModeCluster = RvcRunMode.Cluster;
73
- ClusterRegistry.register(RvcRunMode.Complete);
74
- export var RvcCleanMode;
75
- (function (RvcCleanMode) {
76
- let Feature;
77
- (function (Feature) {
78
- Feature["OnOff"] = "OnOff";
79
- })(Feature = RvcCleanMode.Feature || (RvcCleanMode.Feature = {}));
80
- let ModeTag;
81
- (function (ModeTag) {
82
- ModeTag[ModeTag["Auto"] = 0] = "Auto";
83
- ModeTag[ModeTag["Quick"] = 1] = "Quick";
84
- ModeTag[ModeTag["Quiet"] = 2] = "Quiet";
85
- ModeTag[ModeTag["LowNoise"] = 3] = "LowNoise";
86
- ModeTag[ModeTag["LowEnergy"] = 4] = "LowEnergy";
87
- ModeTag[ModeTag["Vacation"] = 5] = "Vacation";
88
- ModeTag[ModeTag["Min"] = 6] = "Min";
89
- ModeTag[ModeTag["Max"] = 7] = "Max";
90
- ModeTag[ModeTag["Night"] = 8] = "Night";
91
- ModeTag[ModeTag["Day"] = 9] = "Day";
92
- ModeTag[ModeTag["DeepClean"] = 16384] = "DeepClean";
93
- ModeTag[ModeTag["Vacuum"] = 16385] = "Vacuum";
94
- ModeTag[ModeTag["Mop"] = 16386] = "Mop";
95
- })(ModeTag = RvcCleanMode.ModeTag || (RvcCleanMode.ModeTag = {}));
96
- RvcCleanMode.TlvModeTagStruct = TlvObject({
97
- mfgCode: TlvOptionalField(0, TlvVendorId),
98
- value: TlvField(1, TlvEnum()),
99
- });
100
- RvcCleanMode.TlvModeOption = TlvObject({
101
- label: TlvField(0, TlvString.bound({ maxLength: 64 })),
102
- mode: TlvField(1, TlvUInt8),
103
- modeTags: TlvField(2, TlvArray(RvcCleanMode.TlvModeTagStruct, { maxLength: 8 })),
104
- });
105
- let ModeChangeStatus;
106
- (function (ModeChangeStatus) {
107
- ModeChangeStatus[ModeChangeStatus["CleaningInProgress"] = 64] = "CleaningInProgress";
108
- })(ModeChangeStatus = RvcCleanMode.ModeChangeStatus || (RvcCleanMode.ModeChangeStatus = {}));
109
- RvcCleanMode.OnOffComponent = MutableCluster.Component({
110
- attributes: {
111
- startUpMode: WritableAttribute(0x2, TlvNullable(TlvUInt8), { persistent: true }),
112
- onMode: WritableAttribute(0x3, TlvNullable(TlvUInt8), { persistent: true, default: null }),
113
- },
114
- });
115
- RvcCleanMode.Base = MutableCluster.Component({
116
- id: 0x55,
117
- name: 'RvcCleanMode',
118
- revision: 3,
119
- features: {
120
- onOff: BitFlag(0),
121
- },
122
- attributes: {
123
- supportedModes: FixedAttribute(0x0, TlvArray(RvcCleanMode.TlvModeOption, { minLength: 2, maxLength: 255 }), { default: [] }),
124
- currentMode: Attribute(0x1, TlvUInt8, { persistent: true }),
125
- },
126
- commands: {
127
- changeToMode: Command(0x0, ModeBase.TlvChangeToModeRequest, 0x1, ModeBase.TlvChangeToModeResponse),
128
- },
129
- extensions: MutableCluster.Extensions({ flags: { onOff: true }, component: RvcCleanMode.OnOffComponent }),
130
- });
131
- RvcCleanMode.ClusterInstance = MutableCluster(RvcCleanMode.Base);
132
- RvcCleanMode.Cluster = RvcCleanMode.ClusterInstance;
133
- RvcCleanMode.Complete = RvcCleanMode.Cluster;
134
- })(RvcCleanMode || (RvcCleanMode = {}));
135
- export const RvcCleanModeCluster = RvcCleanMode.Cluster;
136
- ClusterRegistry.register(RvcCleanMode.Complete);
137
- export var RvcOperationalState;
138
- (function (RvcOperationalState) {
139
- let OperationalState;
140
- (function (OperationalState) {
141
- OperationalState[OperationalState["Stopped"] = 0] = "Stopped";
142
- OperationalState[OperationalState["Running"] = 1] = "Running";
143
- OperationalState[OperationalState["Paused"] = 2] = "Paused";
144
- OperationalState[OperationalState["Error"] = 3] = "Error";
145
- OperationalState[OperationalState["SeekingCharger"] = 64] = "SeekingCharger";
146
- OperationalState[OperationalState["Charging"] = 65] = "Charging";
147
- OperationalState[OperationalState["Docked"] = 66] = "Docked";
148
- })(OperationalState = RvcOperationalState.OperationalState || (RvcOperationalState.OperationalState = {}));
149
- RvcOperationalState.TlvOperationalStateStruct = TlvObject({
150
- operationalStateId: TlvField(0, TlvEnum()),
151
- operationalStateLabel: TlvOptionalField(1, TlvString.bound({ maxLength: 64 })),
152
- });
153
- let ErrorState;
154
- (function (ErrorState) {
155
- ErrorState[ErrorState["NoError"] = 0] = "NoError";
156
- ErrorState[ErrorState["UnableToStartOrResume"] = 1] = "UnableToStartOrResume";
157
- ErrorState[ErrorState["UnableToCompleteOperation"] = 2] = "UnableToCompleteOperation";
158
- ErrorState[ErrorState["CommandInvalidInState"] = 3] = "CommandInvalidInState";
159
- ErrorState[ErrorState["FailedToFindChargingDock"] = 64] = "FailedToFindChargingDock";
160
- ErrorState[ErrorState["Stuck"] = 65] = "Stuck";
161
- ErrorState[ErrorState["DustBinMissing"] = 66] = "DustBinMissing";
162
- ErrorState[ErrorState["DustBinFull"] = 67] = "DustBinFull";
163
- ErrorState[ErrorState["WaterTankEmpty"] = 68] = "WaterTankEmpty";
164
- ErrorState[ErrorState["WaterTankMissing"] = 69] = "WaterTankMissing";
165
- ErrorState[ErrorState["WaterTankLidOpen"] = 70] = "WaterTankLidOpen";
166
- ErrorState[ErrorState["MopCleaningPadMissing"] = 71] = "MopCleaningPadMissing";
167
- })(ErrorState = RvcOperationalState.ErrorState || (RvcOperationalState.ErrorState = {}));
168
- RvcOperationalState.TlvErrorStateStruct = TlvObject({
169
- errorStateId: TlvField(0, TlvEnum()),
170
- errorStateLabel: TlvOptionalField(1, TlvString.bound({ maxLength: 64 })),
171
- errorStateDetails: TlvOptionalField(2, TlvString.bound({ maxLength: 64 })),
172
- });
173
- RvcOperationalState.TlvOperationalCommandResponse = TlvObject({
174
- commandResponseState: TlvField(0, RvcOperationalState.TlvErrorStateStruct),
175
- });
176
- RvcOperationalState.TlvOperationalErrorEvent = TlvObject({ errorState: TlvField(0, RvcOperationalState.TlvErrorStateStruct) });
177
- RvcOperationalState.ClusterInstance = MutableCluster({
178
- id: 0x61,
179
- name: 'RvcOperationalState',
180
- revision: 2,
181
- attributes: {
182
- phaseList: Attribute(0x0, TlvNullable(TlvArray(TlvString, { maxLength: 32 }))),
183
- currentPhase: Attribute(0x1, TlvNullable(TlvUInt8)),
184
- countdownTime: OptionalAttribute(0x2, TlvNullable(TlvUInt32.bound({ max: 259200 })), { default: null }),
185
- operationalStateList: Attribute(0x3, TlvArray(RvcOperationalState.TlvOperationalStateStruct), { default: [] }),
186
- operationalState: Attribute(0x4, TlvEnum()),
187
- operationalError: Attribute(0x5, RvcOperationalState.TlvErrorStateStruct),
188
- },
189
- commands: {
190
- pause: OptionalCommand(0x0, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
191
- stop: OptionalCommand(0x1, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
192
- start: OptionalCommand(0x2, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
193
- resume: OptionalCommand(0x3, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
194
- goHome: OptionalCommand(0x80, TlvNoArguments, 0x4, RvcOperationalState.TlvOperationalCommandResponse),
195
- },
196
- events: {
197
- operationalError: Event(0x0, EventPriority.Critical, RvcOperationalState.TlvOperationalErrorEvent),
198
- operationCompletion: OptionalEvent(0x1, EventPriority.Info, OperationalStateNamespace.TlvOperationCompletionEvent),
199
- },
200
- });
201
- RvcOperationalState.Cluster = RvcOperationalState.ClusterInstance;
202
- RvcOperationalState.Complete = RvcOperationalState.Cluster;
203
- })(RvcOperationalState || (RvcOperationalState = {}));
204
- export const RvcOperationalStateCluster = RvcOperationalState.Cluster;
205
- ClusterRegistry.register(RvcOperationalState.Complete);
1
+ export {};
@@ -1728,12 +1728,14 @@ export class Matterbridge extends EventEmitter {
1728
1728
  this.devices.remove(device);
1729
1729
  }
1730
1730
  async removeAllBridgedEndpoints(pluginName, delay = 0) {
1731
- this.log.debug(`Removing all bridged endpoints for plugin ${plg}${pluginName}${db}`);
1731
+ this.log.debug(`Removing all bridged endpoints for plugin ${plg}${pluginName}${db}${delay > 0 ? ` with delay ${delay} ms` : ''}`);
1732
1732
  for (const device of this.devices.array().filter((device) => device.plugin === pluginName)) {
1733
1733
  await this.removeBridgedEndpoint(pluginName, device);
1734
1734
  if (delay > 0)
1735
1735
  await new Promise((resolve) => setTimeout(resolve, delay));
1736
1736
  }
1737
+ if (delay > 0)
1738
+ await new Promise((resolve) => setTimeout(resolve, delay * 2));
1737
1739
  }
1738
1740
  async subscribeAttributeChanged(plugin, device) {
1739
1741
  this.log.info(`Subscribing attributes for endpoint ${dev}${device.deviceName}${nf} (${dev}${device.id}${nf}) plugin ${plg}${plugin.name}${nf}`);
@@ -1,5 +1,4 @@
1
- import { Behavior, ClusterBehavior } from '@matter/main';
2
- import { Status } from '@matter/main/types';
1
+ import { Behavior } from '@matter/main';
3
2
  import { BooleanStateConfiguration } from '@matter/main/clusters/boolean-state-configuration';
4
3
  import { ColorControl } from '@matter/main/clusters/color-control';
5
4
  import { FanControl } from '@matter/main/clusters/fan-control';
@@ -20,11 +19,7 @@ import { ValveConfigurationAndControlBehavior } from '@matter/main/behaviors/val
20
19
  import { ModeSelectServer } from '@matter/main/behaviors/mode-select';
21
20
  import { SmokeCoAlarmServer } from '@matter/main/behaviors/smoke-co-alarm';
22
21
  import { SwitchServer } from '@matter/main/behaviors/switch';
23
- import { RvcCleanMode } from 'matterbridge/cluster';
24
- import { RvcRunMode } from 'matterbridge/cluster';
25
- import { RvcOperationalState } from 'matterbridge/cluster';
26
- import { OperationalState } from '@matter/main/clusters/operational-state';
27
- export class MatterbridgeBehaviorDevice {
22
+ export class MatterbridgeServerDevice {
28
23
  log;
29
24
  commandHandler;
30
25
  device;
@@ -146,107 +141,107 @@ export class MatterbridgeBehaviorDevice {
146
141
  this.commandHandler.executeHandler('enableDisableAlarm', { request: { alarmsToEnableDisable }, attributes: {}, endpoint: { number: this.endpointNumber, uniqueStorageKey: this.endpointId } });
147
142
  }
148
143
  }
149
- export class MatterbridgeBehavior extends Behavior {
144
+ export class MatterbridgeServer extends Behavior {
150
145
  static id = 'matterbridge';
151
146
  }
152
- (function (MatterbridgeBehavior) {
147
+ (function (MatterbridgeServer) {
153
148
  class State {
154
149
  deviceCommand;
155
150
  }
156
- MatterbridgeBehavior.State = State;
157
- })(MatterbridgeBehavior || (MatterbridgeBehavior = {}));
151
+ MatterbridgeServer.State = State;
152
+ })(MatterbridgeServer || (MatterbridgeServer = {}));
158
153
  export class MatterbridgeIdentifyServer extends IdentifyServer {
159
154
  initialize() {
160
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
155
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
161
156
  device.setEndpointId(this.endpoint.maybeId);
162
157
  device.setEndpointNumber(this.endpoint.maybeNumber);
163
158
  super.initialize();
164
159
  }
165
160
  identify({ identifyTime }) {
166
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
161
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
167
162
  device.identify({ identifyTime });
168
163
  super.identify({ identifyTime });
169
164
  }
170
165
  triggerEffect({ effectIdentifier, effectVariant }) {
171
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
166
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
172
167
  device.triggerEffect({ effectIdentifier, effectVariant });
173
168
  super.triggerEffect({ effectIdentifier, effectVariant });
174
169
  }
175
170
  }
176
171
  export class MatterbridgeOnOffServer extends OnOffServer {
177
172
  async on() {
178
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
173
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
179
174
  device.on();
180
175
  super.on();
181
176
  }
182
177
  async off() {
183
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
178
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
184
179
  device.off();
185
180
  super.off();
186
181
  }
187
182
  async toggle() {
188
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
183
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
189
184
  device.toggle();
190
185
  super.toggle();
191
186
  }
192
187
  }
193
188
  export class MatterbridgeLevelControlServer extends LevelControlServer {
194
189
  async moveToLevel({ level, transitionTime, optionsMask, optionsOverride }) {
195
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
190
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
196
191
  device.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
197
192
  super.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
198
193
  }
199
194
  async moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride }) {
200
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
195
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
201
196
  device.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
202
197
  super.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
203
198
  }
204
199
  }
205
200
  export class MatterbridgeColorControlServer extends ColorControlServer.with(ColorControl.Feature.HueSaturation, ColorControl.Feature.Xy, ColorControl.Feature.ColorTemperature) {
206
201
  async moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime }) {
207
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
202
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
208
203
  device.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
209
204
  super.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
210
205
  }
211
206
  async moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime }) {
212
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
207
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
213
208
  device.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
214
209
  super.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
215
210
  }
216
211
  async moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime }) {
217
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
212
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
218
213
  device.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
219
214
  super.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
220
215
  }
221
216
  async moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime }) {
222
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
217
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
223
218
  device.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
224
219
  super.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
225
220
  }
226
221
  async moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime }) {
227
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
222
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
228
223
  device.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
229
224
  super.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
230
225
  }
231
226
  }
232
227
  export class MatterbridgeWindowCoveringServer extends WindowCoveringServer.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift) {
233
228
  async upOrOpen() {
234
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
229
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
235
230
  device.upOrOpen();
236
231
  super.upOrOpen();
237
232
  }
238
233
  async downOrClose() {
239
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
234
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
240
235
  device.downOrClose();
241
236
  super.downOrClose();
242
237
  }
243
238
  stopMotion() {
244
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
239
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
245
240
  device.stopMotion();
246
241
  super.stopMotion();
247
242
  }
248
243
  goToLiftPercentage({ liftPercent100thsValue }) {
249
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
244
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
250
245
  device.goToLiftPercentage({ liftPercent100thsValue });
251
246
  super.goToLiftPercentage({ liftPercent100thsValue });
252
247
  }
@@ -255,26 +250,26 @@ export class MatterbridgeWindowCoveringServer extends WindowCoveringServer.with(
255
250
  }
256
251
  export class MatterbridgeDoorLockServer extends DoorLockServer {
257
252
  async lockDoor() {
258
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
253
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
259
254
  device.lockDoor();
260
255
  super.lockDoor();
261
256
  }
262
257
  async unlockDoor() {
263
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
258
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
264
259
  device.unlockDoor();
265
260
  super.unlockDoor();
266
261
  }
267
262
  }
268
263
  export class MatterbridgeModeSelectServer extends ModeSelectServer {
269
264
  async changeToMode({ newMode }) {
270
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
265
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
271
266
  device.changeToMode({ newMode });
272
267
  super.changeToMode({ newMode });
273
268
  }
274
269
  }
275
270
  export class MatterbridgeFanControlServer extends FanControlServer.with(FanControl.Feature.MultiSpeed, FanControl.Feature.Auto, FanControl.Feature.Step) {
276
271
  async step({ direction, wrap, lowestOff }) {
277
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
272
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
278
273
  device.step({ direction, wrap, lowestOff });
279
274
  const lookupStepDirection = ['Increase', 'Decrease'];
280
275
  device.log.debug(`Command step called with direction: ${lookupStepDirection[direction]} wrap: ${wrap} lowestOff: ${lowestOff}`);
@@ -299,7 +294,7 @@ export class MatterbridgeFanControlServer extends FanControlServer.with(FanContr
299
294
  }
300
295
  export class MatterbridgeThermostatServer extends ThermostatBehavior.with(Thermostat.Feature.Cooling, Thermostat.Feature.Heating, Thermostat.Feature.AutoMode) {
301
296
  async setpointRaiseLower({ mode, amount }) {
302
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
297
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
303
298
  device.setpointRaiseLower({ mode, amount });
304
299
  const lookupSetpointAdjustMode = ['Heat', 'Cool', 'Both'];
305
300
  device.log.debug(`Command setpointRaiseLower called with mode: ${lookupSetpointAdjustMode[mode]} amount: ${amount / 10}`);
@@ -321,14 +316,14 @@ export class MatterbridgeValveConfigurationAndControlServer extends ValveConfigu
321
316
  initialize() {
322
317
  }
323
318
  open({ openDuration, targetLevel }) {
324
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
319
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
325
320
  device.log.debug(`Command open called with openDuration: ${openDuration} targetLevel: ${targetLevel}`);
326
321
  device.open({ openDuration, targetLevel });
327
322
  this.state.targetLevel = targetLevel ?? 100;
328
323
  this.state.currentLevel = targetLevel ?? 100;
329
324
  }
330
325
  close() {
331
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
326
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
332
327
  device.log.debug(`Command close called`);
333
328
  device.close();
334
329
  this.state.targetLevel = 0;
@@ -337,14 +332,14 @@ export class MatterbridgeValveConfigurationAndControlServer extends ValveConfigu
337
332
  }
338
333
  export class MatterbridgeSmokeCoAlarmServer extends SmokeCoAlarmServer.with(SmokeCoAlarm.Feature.SmokeAlarm, SmokeCoAlarm.Feature.CoAlarm) {
339
334
  async selfTestRequest() {
340
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
335
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
341
336
  device.selfTestRequest();
342
337
  super.selfTestRequest();
343
338
  }
344
339
  }
345
340
  export class MatterbridgeBooleanStateConfigurationServer extends BooleanStateConfigurationServer.with(BooleanStateConfiguration.Feature.Visual, BooleanStateConfiguration.Feature.Audible, BooleanStateConfiguration.Feature.SensitivityLevel) {
346
341
  async enableDisableAlarm({ alarmsToEnableDisable }) {
347
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
342
+ const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
348
343
  device.enableDisableAlarm({ alarmsToEnableDisable });
349
344
  super.enableDisableAlarm({ alarmsToEnableDisable });
350
345
  }
@@ -353,71 +348,3 @@ export class MatterbridgeSwitchServer extends SwitchServer {
353
348
  initialize() {
354
349
  }
355
350
  }
356
- export const RvcRunModeBehavior = ClusterBehavior.withInterface().for(RvcRunMode.Cluster);
357
- export class MatterbridgeRvcRunModeServer extends RvcRunModeBehavior.with(RvcRunMode.Feature.OnOff) {
358
- initialize() {
359
- }
360
- changeToMode({ newMode }) {
361
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
362
- device.changeToMode({ newMode });
363
- this.state.currentMode = newMode;
364
- console.log('MatterbridgeRvcRunModeServer changeToMode called with newMode:', newMode);
365
- return { status: Status.Success, statusText: 'Success' };
366
- }
367
- }
368
- export const RvcCleanModeBehavior = ClusterBehavior.withInterface().for(RvcCleanMode.Cluster);
369
- export class MatterbridgeRvcCleanModeServer extends RvcCleanModeBehavior.with(RvcRunMode.Feature.OnOff) {
370
- initialize() {
371
- }
372
- changeToMode({ newMode }) {
373
- const device = this.agent.get(MatterbridgeBehavior).state.deviceCommand;
374
- device.changeToMode({ newMode });
375
- this.state.currentMode = newMode;
376
- console.log('MatterbridgeRvcCleanModeServer changeToMode called with newMode:', newMode);
377
- return { status: Status.Success, statusText: 'Success' };
378
- }
379
- }
380
- export const RvcOperationalStateBehavior = ClusterBehavior.withInterface().for(RvcOperationalState.Cluster);
381
- export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateBehavior {
382
- initialize() {
383
- console.log('MatterbridgeRvcOperationalStateServer initialized: setting operational state to Docked');
384
- this.state.operationalState = RvcOperationalState.OperationalState.Docked;
385
- this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error' };
386
- this.reactTo(this.agent.get(OnOffServer).events.onOff$Changed, this.handleOnOffChange);
387
- }
388
- handleOnOffChange(onOff) {
389
- if (onOff) {
390
- console.log('OnOffServer changed to ON: setting operational state to Running');
391
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2;
392
- this.state.operationalState = RvcOperationalState.OperationalState.Running;
393
- this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error' };
394
- }
395
- else {
396
- console.log('OnOffServer changed to OFF: setting operational state to Docked');
397
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
398
- this.state.operationalState = RvcOperationalState.OperationalState.Docked;
399
- this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error' };
400
- }
401
- }
402
- pause() {
403
- console.log('MatterbridgeRvcOperationalStateServer: pause called setting operational state to Paused and currentMode to Idle');
404
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
405
- this.state.operationalState = RvcOperationalState.OperationalState.Paused;
406
- this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error' };
407
- return { commandResponseState: { errorStateId: OperationalState.ErrorState.NoError, errorStateLabel: 'No error' } };
408
- }
409
- resume() {
410
- console.log('MatterbridgeRvcOperationalStateServer: resume called setting operational state to Running and currentMode to Cleaning');
411
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2;
412
- this.state.operationalState = RvcOperationalState.OperationalState.Running;
413
- this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error' };
414
- return { commandResponseState: { errorStateId: OperationalState.ErrorState.NoError, errorStateLabel: 'No error' } };
415
- }
416
- goHome() {
417
- console.log('MatterbridgeRvcOperationalStateServer: go home called setting operational state to Docked and currentMode to Idle');
418
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
419
- this.state.operationalState = RvcOperationalState.OperationalState.Docked;
420
- this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error' };
421
- return { commandResponseState: { errorStateId: OperationalState.ErrorState.NoError, errorStateLabel: 'No error' } };
422
- }
423
- }
@@ -44,41 +44,35 @@ import { EnergyPreference } from '@matter/main/clusters/energy-preference';
44
44
  import { RvcRunMode } from '@matter/main/clusters/rvc-run-mode';
45
45
  import { RvcOperationalState } from '@matter/main/clusters/rvc-operational-state';
46
46
  import { RvcCleanMode } from '@matter/main/clusters/rvc-clean-mode';
47
- import { ScenesManagement } from '@matter/main/clusters/scenes-management';
48
47
  import { HepaFilterMonitoring } from '@matter/main/clusters/hepa-filter-monitoring';
49
48
  import { ActivatedCarbonFilterMonitoring } from '@matter/main/clusters/activated-carbon-filter-monitoring';
50
49
  import { DeviceEnergyManagementMode } from '@matter/main/clusters/device-energy-management-mode';
51
50
  import { AdministratorCommissioning } from '@matter/main/clusters/administrator-commissioning';
52
51
  import { EcosystemInformation } from '@matter/main/clusters/ecosystem-information';
53
- import { AccessControl } from '@matter/main/clusters/access-control';
54
52
  import { CommissionerControl } from '@matter/main/clusters/commissioner-control';
55
53
  import { ServiceArea } from '@matter/main/clusters';
56
54
  export var DeviceClasses;
57
55
  (function (DeviceClasses) {
58
56
  DeviceClasses["Node"] = "Node";
59
- DeviceClasses["Utility"] = "Utility";
60
57
  DeviceClasses["App"] = "App";
58
+ DeviceClasses["Utility"] = "Utility";
61
59
  DeviceClasses["Simple"] = "Simple";
62
60
  DeviceClasses["Dynamic"] = "Dynamic";
63
61
  DeviceClasses["Client"] = "Client";
64
62
  DeviceClasses["Server"] = "Server";
65
63
  DeviceClasses["Composed"] = "Composed";
66
- DeviceClasses["Multiple"] = "Multiple";
67
- DeviceClasses["EZInitiator"] = "EZ-Initiator";
68
- DeviceClasses["EZTarget"] = "EZ-Target";
64
+ DeviceClasses["Duplicate"] = "Duplicate";
69
65
  DeviceClasses["BridgedPowerSourceInfo"] = "BridgedPowerSourceInfo";
70
66
  })(DeviceClasses || (DeviceClasses = {}));
71
- export const DeviceTypeDefinition = ({ name, code, deviceClass, superSet, revision, requiredServerClusters = [], optionalServerClusters = [], requiredClientClusters = [], optionalClientClusters = [], unknown = false, }) => ({
67
+ export const DeviceTypeDefinition = ({ name, code, deviceClass, revision, requiredServerClusters = [], optionalServerClusters = [], requiredClientClusters = [], optionalClientClusters = [], }) => ({
72
68
  name,
73
69
  code: DeviceTypeId(code),
74
70
  deviceClass,
75
- superSet,
76
71
  revision,
77
72
  requiredServerClusters,
78
73
  optionalServerClusters,
79
74
  requiredClientClusters,
80
75
  optionalClientClusters,
81
- unknown,
82
76
  });
83
77
  export const powerSource = DeviceTypeDefinition({
84
78
  name: 'MA-powerSource',
@@ -182,7 +176,7 @@ export const pumpDevice = DeviceTypeDefinition({
182
176
  deviceClass: DeviceClasses.Simple,
183
177
  revision: 3,
184
178
  requiredServerClusters: [OnOff.Cluster.id, PumpConfigurationAndControl.Cluster.id, Identify.Cluster.id],
185
- optionalServerClusters: [LevelControl.Cluster.id, Groups.Cluster.id, ScenesManagement.Cluster.id, TemperatureMeasurement.Cluster.id, PressureMeasurement.Cluster.id, FlowMeasurement.Cluster.id],
179
+ optionalServerClusters: [LevelControl.Cluster.id, Groups.Cluster.id, TemperatureMeasurement.Cluster.id, PressureMeasurement.Cluster.id, FlowMeasurement.Cluster.id],
186
180
  });
187
181
  export const waterValve = DeviceTypeDefinition({
188
182
  name: 'MA-waterValve',
@@ -198,7 +192,7 @@ export const onOffSwitch = DeviceTypeDefinition({
198
192
  deviceClass: DeviceClasses.Simple,
199
193
  revision: 3,
200
194
  requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id],
201
- optionalServerClusters: [Groups.Cluster.id, ScenesManagement.Cluster.id],
195
+ optionalServerClusters: [Groups.Cluster.id],
202
196
  });
203
197
  export const dimmableSwitch = DeviceTypeDefinition({
204
198
  name: 'MA-dimmableswitch',
@@ -206,7 +200,7 @@ export const dimmableSwitch = DeviceTypeDefinition({
206
200
  deviceClass: DeviceClasses.Simple,
207
201
  revision: 3,
208
202
  requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id],
209
- optionalServerClusters: [Groups.Cluster.id, ScenesManagement.Cluster.id],
203
+ optionalServerClusters: [Groups.Cluster.id],
210
204
  });
211
205
  export const colorTemperatureSwitch = DeviceTypeDefinition({
212
206
  name: 'MA-colortemperatureswitch',
@@ -214,7 +208,7 @@ export const colorTemperatureSwitch = DeviceTypeDefinition({
214
208
  deviceClass: DeviceClasses.Simple,
215
209
  revision: 3,
216
210
  requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id, ColorControl.Cluster.id],
217
- optionalServerClusters: [Groups.Cluster.id, ScenesManagement.Cluster.id],
211
+ optionalServerClusters: [Groups.Cluster.id],
218
212
  });
219
213
  export const genericSwitch = DeviceTypeDefinition({
220
214
  name: 'MA-genericswitch',
@@ -333,7 +327,7 @@ export const doorLockDevice = DeviceTypeDefinition({
333
327
  code: 0xa,
334
328
  deviceClass: DeviceClasses.Simple,
335
329
  revision: 3,
336
- requiredServerClusters: [Identify.Cluster.id, DoorLock.Cluster.id, AccessControl.Cluster.id],
330
+ requiredServerClusters: [Identify.Cluster.id, DoorLock.Cluster.id],
337
331
  optionalServerClusters: [],
338
332
  });
339
333
  export const coverDevice = DeviceTypeDefinition({
@@ -398,5 +392,5 @@ export const airConditioner = DeviceTypeDefinition({
398
392
  deviceClass: DeviceClasses.Simple,
399
393
  revision: 2,
400
394
  requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id, Thermostat.Cluster.id],
401
- optionalServerClusters: [Groups.Cluster.id, ScenesManagement.Cluster.id, FanControl.Cluster.id, ThermostatUserInterfaceConfiguration.Cluster.id, TemperatureMeasurement.Cluster.id, RelativeHumidityMeasurement.Cluster.id],
395
+ optionalServerClusters: [Groups.Cluster.id, FanControl.Cluster.id, ThermostatUserInterfaceConfiguration.Cluster.id, TemperatureMeasurement.Cluster.id, RelativeHumidityMeasurement.Cluster.id],
402
396
  });