matterbridge 2.2.9 → 3.0.0-edge.10
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 +44 -0
- package/dist/cli.js +6 -38
- package/dist/cluster/export.js +0 -2
- package/dist/defaultConfigSchema.js +0 -23
- package/dist/deviceManager.js +1 -94
- package/dist/frontend.js +20 -328
- package/dist/index.js +1 -28
- package/dist/logger/export.js +0 -1
- package/dist/matter/behaviors.js +0 -2
- package/dist/matter/clusters.js +0 -2
- package/dist/matter/devices.js +0 -2
- package/dist/matter/endpoints.js +0 -2
- package/dist/matter/export.js +0 -2
- package/dist/matter/types.js +0 -2
- package/dist/matterbridge.js +104 -761
- package/dist/matterbridgeAccessoryPlatform.js +0 -33
- package/dist/matterbridgeBehaviors.js +46 -72
- package/dist/matterbridgeDeviceTypes.js +249 -233
- package/dist/matterbridgeDynamicPlatform.js +0 -33
- package/dist/matterbridgeEndpoint.js +85 -759
- package/dist/matterbridgeEndpointHelpers.js +30 -136
- package/dist/matterbridgePlatform.js +9 -218
- package/dist/matterbridgeTypes.js +0 -24
- package/dist/pluginManager.js +3 -262
- package/dist/shelly.js +6 -146
- package/dist/storage/export.js +0 -1
- package/dist/update.js +0 -45
- package/dist/utils/colorUtils.js +2 -205
- package/dist/utils/copyDirectory.js +1 -37
- package/dist/utils/createZip.js +2 -42
- package/dist/utils/deepCopy.js +0 -40
- package/dist/utils/deepEqual.js +1 -65
- package/dist/utils/export.js +0 -1
- package/dist/utils/isvalid.js +0 -86
- package/dist/utils/network.js +5 -76
- package/dist/utils/parameter.js +0 -41
- package/dist/utils/wait.js +5 -48
- package/npm-shrinkwrap.json +289 -351
- package/package.json +3 -4
- package/dist/cli.d.ts +0 -29
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cluster/export.d.ts +0 -2
- package/dist/cluster/export.d.ts.map +0 -1
- package/dist/cluster/export.js.map +0 -1
- package/dist/defaultConfigSchema.d.ts +0 -27
- package/dist/defaultConfigSchema.d.ts.map +0 -1
- package/dist/defaultConfigSchema.js.map +0 -1
- package/dist/deviceManager.d.ts +0 -114
- package/dist/deviceManager.d.ts.map +0 -1
- package/dist/deviceManager.js.map +0 -1
- package/dist/frontend.d.ts +0 -221
- package/dist/frontend.d.ts.map +0 -1
- package/dist/frontend.js.map +0 -1
- package/dist/index.d.ts +0 -35
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logger/export.d.ts +0 -2
- package/dist/logger/export.d.ts.map +0 -1
- package/dist/logger/export.js.map +0 -1
- package/dist/matter/behaviors.d.ts +0 -2
- package/dist/matter/behaviors.d.ts.map +0 -1
- package/dist/matter/behaviors.js.map +0 -1
- package/dist/matter/clusters.d.ts +0 -2
- package/dist/matter/clusters.d.ts.map +0 -1
- package/dist/matter/clusters.js.map +0 -1
- package/dist/matter/devices.d.ts +0 -2
- package/dist/matter/devices.d.ts.map +0 -1
- package/dist/matter/devices.js.map +0 -1
- package/dist/matter/endpoints.d.ts +0 -2
- package/dist/matter/endpoints.d.ts.map +0 -1
- package/dist/matter/endpoints.js.map +0 -1
- package/dist/matter/export.d.ts +0 -5
- package/dist/matter/export.d.ts.map +0 -1
- package/dist/matter/export.js.map +0 -1
- package/dist/matter/types.d.ts +0 -3
- package/dist/matter/types.d.ts.map +0 -1
- package/dist/matter/types.js.map +0 -1
- package/dist/matterbridge.d.ts +0 -425
- package/dist/matterbridge.d.ts.map +0 -1
- package/dist/matterbridge.js.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts +0 -39
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
- package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
- package/dist/matterbridgeBehaviors.d.ts +0 -1056
- package/dist/matterbridgeBehaviors.d.ts.map +0 -1
- package/dist/matterbridgeBehaviors.js.map +0 -1
- package/dist/matterbridgeDeviceTypes.d.ts +0 -178
- package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
- package/dist/matterbridgeDeviceTypes.js.map +0 -1
- package/dist/matterbridgeDynamicPlatform.d.ts +0 -39
- package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
- package/dist/matterbridgeDynamicPlatform.js.map +0 -1
- package/dist/matterbridgeEndpoint.d.ts +0 -867
- package/dist/matterbridgeEndpoint.d.ts.map +0 -1
- package/dist/matterbridgeEndpoint.js.map +0 -1
- package/dist/matterbridgeEndpointHelpers.d.ts +0 -2275
- package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
- package/dist/matterbridgeEndpointHelpers.js.map +0 -1
- package/dist/matterbridgePlatform.d.ts +0 -285
- package/dist/matterbridgePlatform.d.ts.map +0 -1
- package/dist/matterbridgePlatform.js.map +0 -1
- package/dist/matterbridgeTypes.d.ts +0 -183
- package/dist/matterbridgeTypes.d.ts.map +0 -1
- package/dist/matterbridgeTypes.js.map +0 -1
- package/dist/pluginManager.d.ts +0 -271
- package/dist/pluginManager.d.ts.map +0 -1
- package/dist/pluginManager.js.map +0 -1
- package/dist/shelly.d.ts +0 -92
- package/dist/shelly.d.ts.map +0 -1
- package/dist/shelly.js.map +0 -1
- package/dist/storage/export.d.ts +0 -2
- package/dist/storage/export.d.ts.map +0 -1
- package/dist/storage/export.js.map +0 -1
- package/dist/update.d.ts +0 -32
- package/dist/update.d.ts.map +0 -1
- package/dist/update.js.map +0 -1
- package/dist/utils/colorUtils.d.ts +0 -61
- package/dist/utils/colorUtils.d.ts.map +0 -1
- package/dist/utils/colorUtils.js.map +0 -1
- package/dist/utils/copyDirectory.d.ts +0 -32
- package/dist/utils/copyDirectory.d.ts.map +0 -1
- package/dist/utils/copyDirectory.js.map +0 -1
- package/dist/utils/createZip.d.ts +0 -38
- package/dist/utils/createZip.d.ts.map +0 -1
- package/dist/utils/createZip.js.map +0 -1
- package/dist/utils/deepCopy.d.ts +0 -31
- package/dist/utils/deepCopy.d.ts.map +0 -1
- package/dist/utils/deepCopy.js.map +0 -1
- package/dist/utils/deepEqual.d.ts +0 -53
- package/dist/utils/deepEqual.d.ts.map +0 -1
- package/dist/utils/deepEqual.js.map +0 -1
- package/dist/utils/export.d.ts +0 -10
- package/dist/utils/export.d.ts.map +0 -1
- package/dist/utils/export.js.map +0 -1
- package/dist/utils/isvalid.d.ts +0 -87
- package/dist/utils/isvalid.d.ts.map +0 -1
- package/dist/utils/isvalid.js.map +0 -1
- package/dist/utils/network.d.ts +0 -69
- package/dist/utils/network.d.ts.map +0 -1
- package/dist/utils/network.js.map +0 -1
- package/dist/utils/parameter.d.ts +0 -44
- package/dist/utils/parameter.d.ts.map +0 -1
- package/dist/utils/parameter.js.map +0 -1
- package/dist/utils/wait.d.ts +0 -43
- package/dist/utils/wait.d.ts.map +0 -1
- package/dist/utils/wait.js.map +0 -1
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class MatterbridgeAccessoryPlatform.
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgeAccessoryPlatform.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2023-12-29
|
|
7
|
-
* @version 1.0.5
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
1
|
import { MatterbridgePlatform } from './matterbridgePlatform.js';
|
|
24
|
-
/**
|
|
25
|
-
* Represents a Matterbridge accessory platform.
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
2
|
export class MatterbridgeAccessoryPlatform extends MatterbridgePlatform {
|
|
29
|
-
/**
|
|
30
|
-
* Creates an instance of MatterbridgeAccessoryPlatform.
|
|
31
|
-
* @param {Matterbridge} matterbridge - The Matterbridge instance.
|
|
32
|
-
* @param {AnsiLogger} log - The logger instance.
|
|
33
|
-
* @param {PlatformConfig} config - The platform configuration.
|
|
34
|
-
*/
|
|
35
3
|
constructor(matterbridge, log, config) {
|
|
36
4
|
super(matterbridge, log, config);
|
|
37
5
|
this.type = 'AccessoryPlatform';
|
|
@@ -39,4 +7,3 @@ export class MatterbridgeAccessoryPlatform extends MatterbridgePlatform {
|
|
|
39
7
|
this.log.debug(`Matterbridge${this.type} loaded`);
|
|
40
8
|
}
|
|
41
9
|
}
|
|
42
|
-
//# sourceMappingURL=matterbridgeAccessoryPlatform.js.map
|
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class MatterbridgeEndpoint that extends the Endpoint class from the Matter.js library.
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgeBehaviors.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2024-11-07
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2024, 2025, 2026 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
|
-
/* eslint-disable @typescript-eslint/no-namespace */
|
|
24
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
25
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
26
|
-
// @matter
|
|
27
1
|
import { Behavior } from '@matter/main';
|
|
28
|
-
// @matter clusters
|
|
29
2
|
import { BooleanStateConfiguration } from '@matter/main/clusters/boolean-state-configuration';
|
|
30
3
|
import { ColorControl } from '@matter/main/clusters/color-control';
|
|
31
4
|
import { FanControl } from '@matter/main/clusters/fan-control';
|
|
@@ -34,7 +7,6 @@ import { Thermostat } from '@matter/main/clusters/thermostat';
|
|
|
34
7
|
import { ValveConfigurationAndControl } from '@matter/main/clusters/valve-configuration-and-control';
|
|
35
8
|
import { SmokeCoAlarm } from '@matter/main/clusters/smoke-co-alarm';
|
|
36
9
|
import { BooleanStateConfigurationServer } from '@matter/main/behaviors/boolean-state-configuration';
|
|
37
|
-
// @matter behaviors
|
|
38
10
|
import { IdentifyServer } from '@matter/main/behaviors/identify';
|
|
39
11
|
import { OnOffServer } from '@matter/main/behaviors/on-off';
|
|
40
12
|
import { LevelControlServer } from '@matter/main/behaviors/level-control';
|
|
@@ -42,15 +14,15 @@ import { ColorControlServer } from '@matter/main/behaviors/color-control';
|
|
|
42
14
|
import { WindowCoveringServer } from '@matter/main/behaviors/window-covering';
|
|
43
15
|
import { DoorLockServer } from '@matter/main/behaviors/door-lock';
|
|
44
16
|
import { FanControlServer } from '@matter/main/behaviors/fan-control';
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
17
|
+
import { ThermostatBehavior } from '@matter/main/behaviors/thermostat';
|
|
18
|
+
import { ValveConfigurationAndControlBehavior } from '@matter/main/behaviors/valve-configuration-and-control';
|
|
47
19
|
import { ModeSelectServer } from '@matter/main/behaviors/mode-select';
|
|
48
20
|
import { SmokeCoAlarmServer } from '@matter/main/behaviors/smoke-co-alarm';
|
|
49
21
|
import { SwitchServer } from '@matter/main/behaviors/switch';
|
|
50
|
-
export class
|
|
22
|
+
export class MatterbridgeServerDevice {
|
|
51
23
|
log;
|
|
52
24
|
commandHandler;
|
|
53
|
-
device;
|
|
25
|
+
device;
|
|
54
26
|
endpointId = undefined;
|
|
55
27
|
endpointNumber = undefined;
|
|
56
28
|
constructor(log, commandHandler, device) {
|
|
@@ -169,136 +141,135 @@ export class MatterbridgeBehaviorDevice {
|
|
|
169
141
|
this.commandHandler.executeHandler('enableDisableAlarm', { request: { alarmsToEnableDisable }, attributes: {}, endpoint: { number: this.endpointNumber, uniqueStorageKey: this.endpointId } });
|
|
170
142
|
}
|
|
171
143
|
}
|
|
172
|
-
export class
|
|
144
|
+
export class MatterbridgeServer extends Behavior {
|
|
173
145
|
static id = 'matterbridge';
|
|
174
146
|
}
|
|
175
|
-
(function (
|
|
147
|
+
(function (MatterbridgeServer) {
|
|
176
148
|
class State {
|
|
177
149
|
deviceCommand;
|
|
178
150
|
}
|
|
179
|
-
|
|
180
|
-
})(
|
|
151
|
+
MatterbridgeServer.State = State;
|
|
152
|
+
})(MatterbridgeServer || (MatterbridgeServer = {}));
|
|
181
153
|
export class MatterbridgeIdentifyServer extends IdentifyServer {
|
|
182
154
|
initialize() {
|
|
183
|
-
const device = this.agent.get(
|
|
155
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
184
156
|
device.setEndpointId(this.endpoint.maybeId);
|
|
185
157
|
device.setEndpointNumber(this.endpoint.maybeNumber);
|
|
186
158
|
super.initialize();
|
|
187
159
|
}
|
|
188
160
|
identify({ identifyTime }) {
|
|
189
|
-
const device = this.agent.get(
|
|
161
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
190
162
|
device.identify({ identifyTime });
|
|
191
163
|
super.identify({ identifyTime });
|
|
192
164
|
}
|
|
193
165
|
triggerEffect({ effectIdentifier, effectVariant }) {
|
|
194
|
-
const device = this.agent.get(
|
|
166
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
195
167
|
device.triggerEffect({ effectIdentifier, effectVariant });
|
|
196
168
|
super.triggerEffect({ effectIdentifier, effectVariant });
|
|
197
169
|
}
|
|
198
170
|
}
|
|
199
171
|
export class MatterbridgeOnOffServer extends OnOffServer {
|
|
200
172
|
async on() {
|
|
201
|
-
const device = this.agent.get(
|
|
173
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
202
174
|
device.on();
|
|
203
175
|
super.on();
|
|
204
176
|
}
|
|
205
177
|
async off() {
|
|
206
|
-
const device = this.agent.get(
|
|
178
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
207
179
|
device.off();
|
|
208
180
|
super.off();
|
|
209
181
|
}
|
|
210
182
|
async toggle() {
|
|
211
|
-
const device = this.agent.get(
|
|
183
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
212
184
|
device.toggle();
|
|
213
185
|
super.toggle();
|
|
214
186
|
}
|
|
215
187
|
}
|
|
216
188
|
export class MatterbridgeLevelControlServer extends LevelControlServer {
|
|
217
189
|
async moveToLevel({ level, transitionTime, optionsMask, optionsOverride }) {
|
|
218
|
-
const device = this.agent.get(
|
|
190
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
219
191
|
device.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
|
|
220
192
|
super.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
|
|
221
193
|
}
|
|
222
194
|
async moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride }) {
|
|
223
|
-
const device = this.agent.get(
|
|
195
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
224
196
|
device.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
|
|
225
197
|
super.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
|
|
226
198
|
}
|
|
227
199
|
}
|
|
228
200
|
export class MatterbridgeColorControlServer extends ColorControlServer.with(ColorControl.Feature.HueSaturation, ColorControl.Feature.Xy, ColorControl.Feature.ColorTemperature) {
|
|
229
201
|
async moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime }) {
|
|
230
|
-
const device = this.agent.get(
|
|
202
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
231
203
|
device.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
|
|
232
204
|
super.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
|
|
233
205
|
}
|
|
234
206
|
async moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime }) {
|
|
235
|
-
const device = this.agent.get(
|
|
207
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
236
208
|
device.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
|
|
237
209
|
super.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
|
|
238
210
|
}
|
|
239
211
|
async moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime }) {
|
|
240
|
-
const device = this.agent.get(
|
|
212
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
241
213
|
device.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
|
|
242
214
|
super.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
|
|
243
215
|
}
|
|
244
216
|
async moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime }) {
|
|
245
|
-
const device = this.agent.get(
|
|
217
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
246
218
|
device.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
|
|
247
219
|
super.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
|
|
248
220
|
}
|
|
249
221
|
async moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime }) {
|
|
250
|
-
const device = this.agent.get(
|
|
222
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
251
223
|
device.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
|
|
252
224
|
super.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
|
|
253
225
|
}
|
|
254
226
|
}
|
|
255
227
|
export class MatterbridgeWindowCoveringServer extends WindowCoveringServer.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift) {
|
|
256
228
|
async upOrOpen() {
|
|
257
|
-
const device = this.agent.get(
|
|
229
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
258
230
|
device.upOrOpen();
|
|
259
231
|
super.upOrOpen();
|
|
260
232
|
}
|
|
261
233
|
async downOrClose() {
|
|
262
|
-
const device = this.agent.get(
|
|
234
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
263
235
|
device.downOrClose();
|
|
264
236
|
super.downOrClose();
|
|
265
237
|
}
|
|
266
238
|
stopMotion() {
|
|
267
|
-
const device = this.agent.get(
|
|
239
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
268
240
|
device.stopMotion();
|
|
269
241
|
super.stopMotion();
|
|
270
242
|
}
|
|
271
243
|
goToLiftPercentage({ liftPercent100thsValue }) {
|
|
272
|
-
const device = this.agent.get(
|
|
244
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
273
245
|
device.goToLiftPercentage({ liftPercent100thsValue });
|
|
274
246
|
super.goToLiftPercentage({ liftPercent100thsValue });
|
|
275
247
|
}
|
|
276
248
|
async handleMovement(type, reversed, direction, targetPercent100ths) {
|
|
277
|
-
// Do nothing here, as the device will handle the movement
|
|
278
249
|
}
|
|
279
250
|
}
|
|
280
251
|
export class MatterbridgeDoorLockServer extends DoorLockServer {
|
|
281
252
|
async lockDoor() {
|
|
282
|
-
const device = this.agent.get(
|
|
253
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
283
254
|
device.lockDoor();
|
|
284
255
|
super.lockDoor();
|
|
285
256
|
}
|
|
286
257
|
async unlockDoor() {
|
|
287
|
-
const device = this.agent.get(
|
|
258
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
288
259
|
device.unlockDoor();
|
|
289
260
|
super.unlockDoor();
|
|
290
261
|
}
|
|
291
262
|
}
|
|
292
263
|
export class MatterbridgeModeSelectServer extends ModeSelectServer {
|
|
293
264
|
async changeToMode({ newMode }) {
|
|
294
|
-
const device = this.agent.get(
|
|
265
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
295
266
|
device.changeToMode({ newMode });
|
|
296
267
|
super.changeToMode({ newMode });
|
|
297
268
|
}
|
|
298
269
|
}
|
|
299
270
|
export class MatterbridgeFanControlServer extends FanControlServer.with(FanControl.Feature.MultiSpeed, FanControl.Feature.Auto, FanControl.Feature.Step) {
|
|
300
271
|
async step({ direction, wrap, lowestOff }) {
|
|
301
|
-
const device = this.agent.get(
|
|
272
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
302
273
|
device.step({ direction, wrap, lowestOff });
|
|
303
274
|
const lookupStepDirection = ['Increase', 'Decrease'];
|
|
304
275
|
device.log.debug(`Command step called with direction: ${lookupStepDirection[direction]} wrap: ${wrap} lowestOff: ${lowestOff}`);
|
|
@@ -321,9 +292,9 @@ export class MatterbridgeFanControlServer extends FanControlServer.with(FanContr
|
|
|
321
292
|
super.step({ direction, wrap, lowestOff });
|
|
322
293
|
}
|
|
323
294
|
}
|
|
324
|
-
export class MatterbridgeThermostatServer extends
|
|
295
|
+
export class MatterbridgeThermostatServer extends ThermostatBehavior.with(Thermostat.Feature.Cooling, Thermostat.Feature.Heating, Thermostat.Feature.AutoMode) {
|
|
325
296
|
async setpointRaiseLower({ mode, amount }) {
|
|
326
|
-
const device = this.agent.get(
|
|
297
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
327
298
|
device.setpointRaiseLower({ mode, amount });
|
|
328
299
|
const lookupSetpointAdjustMode = ['Heat', 'Cool', 'Both'];
|
|
329
300
|
device.log.debug(`Command setpointRaiseLower called with mode: ${lookupSetpointAdjustMode[mode]} amount: ${amount / 10}`);
|
|
@@ -339,38 +310,41 @@ export class MatterbridgeThermostatServer extends ThermostatServer.with(Thermost
|
|
|
339
310
|
this.state.occupiedCoolingSetpoint = setpoint * 100;
|
|
340
311
|
device.log.debug('Set occupiedCoolingSetpoint to:', setpoint);
|
|
341
312
|
}
|
|
342
|
-
super.setpointRaiseLower({ mode, amount });
|
|
343
313
|
}
|
|
344
314
|
}
|
|
345
|
-
export class MatterbridgeValveConfigurationAndControlServer extends
|
|
346
|
-
|
|
347
|
-
|
|
315
|
+
export class MatterbridgeValveConfigurationAndControlServer extends ValveConfigurationAndControlBehavior.with(ValveConfigurationAndControl.Feature.Level) {
|
|
316
|
+
initialize() {
|
|
317
|
+
}
|
|
318
|
+
open({ openDuration, targetLevel }) {
|
|
319
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
320
|
+
device.log.debug(`Command open called with openDuration: ${openDuration} targetLevel: ${targetLevel}`);
|
|
348
321
|
device.open({ openDuration, targetLevel });
|
|
349
|
-
|
|
322
|
+
this.state.targetLevel = targetLevel ?? 100;
|
|
323
|
+
this.state.currentLevel = targetLevel ?? 100;
|
|
350
324
|
}
|
|
351
|
-
|
|
352
|
-
const device = this.agent.get(
|
|
325
|
+
close() {
|
|
326
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
327
|
+
device.log.debug(`Command close called`);
|
|
353
328
|
device.close();
|
|
354
|
-
|
|
329
|
+
this.state.targetLevel = 0;
|
|
330
|
+
this.state.currentLevel = 0;
|
|
355
331
|
}
|
|
356
332
|
}
|
|
357
333
|
export class MatterbridgeSmokeCoAlarmServer extends SmokeCoAlarmServer.with(SmokeCoAlarm.Feature.SmokeAlarm, SmokeCoAlarm.Feature.CoAlarm) {
|
|
358
334
|
async selfTestRequest() {
|
|
359
|
-
const device = this.agent.get(
|
|
335
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
360
336
|
device.selfTestRequest();
|
|
361
337
|
super.selfTestRequest();
|
|
362
338
|
}
|
|
363
339
|
}
|
|
364
340
|
export class MatterbridgeBooleanStateConfigurationServer extends BooleanStateConfigurationServer.with(BooleanStateConfiguration.Feature.Visual, BooleanStateConfiguration.Feature.Audible, BooleanStateConfiguration.Feature.SensitivityLevel) {
|
|
365
341
|
async enableDisableAlarm({ alarmsToEnableDisable }) {
|
|
366
|
-
const device = this.agent.get(
|
|
342
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
367
343
|
device.enableDisableAlarm({ alarmsToEnableDisable });
|
|
368
344
|
super.enableDisableAlarm({ alarmsToEnableDisable });
|
|
369
345
|
}
|
|
370
346
|
}
|
|
371
347
|
export class MatterbridgeSwitchServer extends SwitchServer {
|
|
372
348
|
initialize() {
|
|
373
|
-
// Do nothing here, as the device will handle the switch logic
|
|
374
349
|
}
|
|
375
350
|
}
|
|
376
|
-
//# sourceMappingURL=matterbridgeBehaviors.js.map
|