matterbridge 3.0.0-edge.3 → 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/dist/matterbridge.js
CHANGED
|
@@ -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}`);
|
|
@@ -19,7 +19,7 @@ import { ValveConfigurationAndControlBehavior } from '@matter/main/behaviors/val
|
|
|
19
19
|
import { ModeSelectServer } from '@matter/main/behaviors/mode-select';
|
|
20
20
|
import { SmokeCoAlarmServer } from '@matter/main/behaviors/smoke-co-alarm';
|
|
21
21
|
import { SwitchServer } from '@matter/main/behaviors/switch';
|
|
22
|
-
export class
|
|
22
|
+
export class MatterbridgeServerDevice {
|
|
23
23
|
log;
|
|
24
24
|
commandHandler;
|
|
25
25
|
device;
|
|
@@ -141,107 +141,107 @@ export class MatterbridgeBehaviorDevice {
|
|
|
141
141
|
this.commandHandler.executeHandler('enableDisableAlarm', { request: { alarmsToEnableDisable }, attributes: {}, endpoint: { number: this.endpointNumber, uniqueStorageKey: this.endpointId } });
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
export class
|
|
144
|
+
export class MatterbridgeServer extends Behavior {
|
|
145
145
|
static id = 'matterbridge';
|
|
146
146
|
}
|
|
147
|
-
(function (
|
|
147
|
+
(function (MatterbridgeServer) {
|
|
148
148
|
class State {
|
|
149
149
|
deviceCommand;
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
})(
|
|
151
|
+
MatterbridgeServer.State = State;
|
|
152
|
+
})(MatterbridgeServer || (MatterbridgeServer = {}));
|
|
153
153
|
export class MatterbridgeIdentifyServer extends IdentifyServer {
|
|
154
154
|
initialize() {
|
|
155
|
-
const device = this.agent.get(
|
|
155
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
156
156
|
device.setEndpointId(this.endpoint.maybeId);
|
|
157
157
|
device.setEndpointNumber(this.endpoint.maybeNumber);
|
|
158
158
|
super.initialize();
|
|
159
159
|
}
|
|
160
160
|
identify({ identifyTime }) {
|
|
161
|
-
const device = this.agent.get(
|
|
161
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
162
162
|
device.identify({ identifyTime });
|
|
163
163
|
super.identify({ identifyTime });
|
|
164
164
|
}
|
|
165
165
|
triggerEffect({ effectIdentifier, effectVariant }) {
|
|
166
|
-
const device = this.agent.get(
|
|
166
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
167
167
|
device.triggerEffect({ effectIdentifier, effectVariant });
|
|
168
168
|
super.triggerEffect({ effectIdentifier, effectVariant });
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
export class MatterbridgeOnOffServer extends OnOffServer {
|
|
172
172
|
async on() {
|
|
173
|
-
const device = this.agent.get(
|
|
173
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
174
174
|
device.on();
|
|
175
175
|
super.on();
|
|
176
176
|
}
|
|
177
177
|
async off() {
|
|
178
|
-
const device = this.agent.get(
|
|
178
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
179
179
|
device.off();
|
|
180
180
|
super.off();
|
|
181
181
|
}
|
|
182
182
|
async toggle() {
|
|
183
|
-
const device = this.agent.get(
|
|
183
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
184
184
|
device.toggle();
|
|
185
185
|
super.toggle();
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
export class MatterbridgeLevelControlServer extends LevelControlServer {
|
|
189
189
|
async moveToLevel({ level, transitionTime, optionsMask, optionsOverride }) {
|
|
190
|
-
const device = this.agent.get(
|
|
190
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
191
191
|
device.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
|
|
192
192
|
super.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
|
|
193
193
|
}
|
|
194
194
|
async moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride }) {
|
|
195
|
-
const device = this.agent.get(
|
|
195
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
196
196
|
device.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
|
|
197
197
|
super.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
export class MatterbridgeColorControlServer extends ColorControlServer.with(ColorControl.Feature.HueSaturation, ColorControl.Feature.Xy, ColorControl.Feature.ColorTemperature) {
|
|
201
201
|
async moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime }) {
|
|
202
|
-
const device = this.agent.get(
|
|
202
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
203
203
|
device.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
|
|
204
204
|
super.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
|
|
205
205
|
}
|
|
206
206
|
async moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime }) {
|
|
207
|
-
const device = this.agent.get(
|
|
207
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
208
208
|
device.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
|
|
209
209
|
super.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
|
|
210
210
|
}
|
|
211
211
|
async moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime }) {
|
|
212
|
-
const device = this.agent.get(
|
|
212
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
213
213
|
device.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
|
|
214
214
|
super.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
|
|
215
215
|
}
|
|
216
216
|
async moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime }) {
|
|
217
|
-
const device = this.agent.get(
|
|
217
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
218
218
|
device.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
|
|
219
219
|
super.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
|
|
220
220
|
}
|
|
221
221
|
async moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime }) {
|
|
222
|
-
const device = this.agent.get(
|
|
222
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
223
223
|
device.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
|
|
224
224
|
super.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
export class MatterbridgeWindowCoveringServer extends WindowCoveringServer.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift) {
|
|
228
228
|
async upOrOpen() {
|
|
229
|
-
const device = this.agent.get(
|
|
229
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
230
230
|
device.upOrOpen();
|
|
231
231
|
super.upOrOpen();
|
|
232
232
|
}
|
|
233
233
|
async downOrClose() {
|
|
234
|
-
const device = this.agent.get(
|
|
234
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
235
235
|
device.downOrClose();
|
|
236
236
|
super.downOrClose();
|
|
237
237
|
}
|
|
238
238
|
stopMotion() {
|
|
239
|
-
const device = this.agent.get(
|
|
239
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
240
240
|
device.stopMotion();
|
|
241
241
|
super.stopMotion();
|
|
242
242
|
}
|
|
243
243
|
goToLiftPercentage({ liftPercent100thsValue }) {
|
|
244
|
-
const device = this.agent.get(
|
|
244
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
245
245
|
device.goToLiftPercentage({ liftPercent100thsValue });
|
|
246
246
|
super.goToLiftPercentage({ liftPercent100thsValue });
|
|
247
247
|
}
|
|
@@ -250,26 +250,26 @@ export class MatterbridgeWindowCoveringServer extends WindowCoveringServer.with(
|
|
|
250
250
|
}
|
|
251
251
|
export class MatterbridgeDoorLockServer extends DoorLockServer {
|
|
252
252
|
async lockDoor() {
|
|
253
|
-
const device = this.agent.get(
|
|
253
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
254
254
|
device.lockDoor();
|
|
255
255
|
super.lockDoor();
|
|
256
256
|
}
|
|
257
257
|
async unlockDoor() {
|
|
258
|
-
const device = this.agent.get(
|
|
258
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
259
259
|
device.unlockDoor();
|
|
260
260
|
super.unlockDoor();
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
export class MatterbridgeModeSelectServer extends ModeSelectServer {
|
|
264
264
|
async changeToMode({ newMode }) {
|
|
265
|
-
const device = this.agent.get(
|
|
265
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
266
266
|
device.changeToMode({ newMode });
|
|
267
267
|
super.changeToMode({ newMode });
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
export class MatterbridgeFanControlServer extends FanControlServer.with(FanControl.Feature.MultiSpeed, FanControl.Feature.Auto, FanControl.Feature.Step) {
|
|
271
271
|
async step({ direction, wrap, lowestOff }) {
|
|
272
|
-
const device = this.agent.get(
|
|
272
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
273
273
|
device.step({ direction, wrap, lowestOff });
|
|
274
274
|
const lookupStepDirection = ['Increase', 'Decrease'];
|
|
275
275
|
device.log.debug(`Command step called with direction: ${lookupStepDirection[direction]} wrap: ${wrap} lowestOff: ${lowestOff}`);
|
|
@@ -294,7 +294,7 @@ export class MatterbridgeFanControlServer extends FanControlServer.with(FanContr
|
|
|
294
294
|
}
|
|
295
295
|
export class MatterbridgeThermostatServer extends ThermostatBehavior.with(Thermostat.Feature.Cooling, Thermostat.Feature.Heating, Thermostat.Feature.AutoMode) {
|
|
296
296
|
async setpointRaiseLower({ mode, amount }) {
|
|
297
|
-
const device = this.agent.get(
|
|
297
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
298
298
|
device.setpointRaiseLower({ mode, amount });
|
|
299
299
|
const lookupSetpointAdjustMode = ['Heat', 'Cool', 'Both'];
|
|
300
300
|
device.log.debug(`Command setpointRaiseLower called with mode: ${lookupSetpointAdjustMode[mode]} amount: ${amount / 10}`);
|
|
@@ -316,14 +316,14 @@ export class MatterbridgeValveConfigurationAndControlServer extends ValveConfigu
|
|
|
316
316
|
initialize() {
|
|
317
317
|
}
|
|
318
318
|
open({ openDuration, targetLevel }) {
|
|
319
|
-
const device = this.agent.get(
|
|
319
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
320
320
|
device.log.debug(`Command open called with openDuration: ${openDuration} targetLevel: ${targetLevel}`);
|
|
321
321
|
device.open({ openDuration, targetLevel });
|
|
322
322
|
this.state.targetLevel = targetLevel ?? 100;
|
|
323
323
|
this.state.currentLevel = targetLevel ?? 100;
|
|
324
324
|
}
|
|
325
325
|
close() {
|
|
326
|
-
const device = this.agent.get(
|
|
326
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
327
327
|
device.log.debug(`Command close called`);
|
|
328
328
|
device.close();
|
|
329
329
|
this.state.targetLevel = 0;
|
|
@@ -332,14 +332,14 @@ export class MatterbridgeValveConfigurationAndControlServer extends ValveConfigu
|
|
|
332
332
|
}
|
|
333
333
|
export class MatterbridgeSmokeCoAlarmServer extends SmokeCoAlarmServer.with(SmokeCoAlarm.Feature.SmokeAlarm, SmokeCoAlarm.Feature.CoAlarm) {
|
|
334
334
|
async selfTestRequest() {
|
|
335
|
-
const device = this.agent.get(
|
|
335
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
336
336
|
device.selfTestRequest();
|
|
337
337
|
super.selfTestRequest();
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
export class MatterbridgeBooleanStateConfigurationServer extends BooleanStateConfigurationServer.with(BooleanStateConfiguration.Feature.Visual, BooleanStateConfiguration.Feature.Audible, BooleanStateConfiguration.Feature.SensitivityLevel) {
|
|
341
341
|
async enableDisableAlarm({ alarmsToEnableDisable }) {
|
|
342
|
-
const device = this.agent.get(
|
|
342
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
343
343
|
device.enableDisableAlarm({ alarmsToEnableDisable });
|
|
344
344
|
super.enableDisableAlarm({ alarmsToEnableDisable });
|
|
345
345
|
}
|
|
@@ -44,13 +44,11 @@ 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;
|
|
@@ -178,7 +176,7 @@ export const pumpDevice = DeviceTypeDefinition({
|
|
|
178
176
|
deviceClass: DeviceClasses.Simple,
|
|
179
177
|
revision: 3,
|
|
180
178
|
requiredServerClusters: [OnOff.Cluster.id, PumpConfigurationAndControl.Cluster.id, Identify.Cluster.id],
|
|
181
|
-
optionalServerClusters: [LevelControl.Cluster.id, Groups.Cluster.id,
|
|
179
|
+
optionalServerClusters: [LevelControl.Cluster.id, Groups.Cluster.id, TemperatureMeasurement.Cluster.id, PressureMeasurement.Cluster.id, FlowMeasurement.Cluster.id],
|
|
182
180
|
});
|
|
183
181
|
export const waterValve = DeviceTypeDefinition({
|
|
184
182
|
name: 'MA-waterValve',
|
|
@@ -194,7 +192,7 @@ export const onOffSwitch = DeviceTypeDefinition({
|
|
|
194
192
|
deviceClass: DeviceClasses.Simple,
|
|
195
193
|
revision: 3,
|
|
196
194
|
requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id],
|
|
197
|
-
optionalServerClusters: [Groups.Cluster.id
|
|
195
|
+
optionalServerClusters: [Groups.Cluster.id],
|
|
198
196
|
});
|
|
199
197
|
export const dimmableSwitch = DeviceTypeDefinition({
|
|
200
198
|
name: 'MA-dimmableswitch',
|
|
@@ -202,7 +200,7 @@ export const dimmableSwitch = DeviceTypeDefinition({
|
|
|
202
200
|
deviceClass: DeviceClasses.Simple,
|
|
203
201
|
revision: 3,
|
|
204
202
|
requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id],
|
|
205
|
-
optionalServerClusters: [Groups.Cluster.id
|
|
203
|
+
optionalServerClusters: [Groups.Cluster.id],
|
|
206
204
|
});
|
|
207
205
|
export const colorTemperatureSwitch = DeviceTypeDefinition({
|
|
208
206
|
name: 'MA-colortemperatureswitch',
|
|
@@ -210,7 +208,7 @@ export const colorTemperatureSwitch = DeviceTypeDefinition({
|
|
|
210
208
|
deviceClass: DeviceClasses.Simple,
|
|
211
209
|
revision: 3,
|
|
212
210
|
requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id, ColorControl.Cluster.id],
|
|
213
|
-
optionalServerClusters: [Groups.Cluster.id
|
|
211
|
+
optionalServerClusters: [Groups.Cluster.id],
|
|
214
212
|
});
|
|
215
213
|
export const genericSwitch = DeviceTypeDefinition({
|
|
216
214
|
name: 'MA-genericswitch',
|
|
@@ -329,7 +327,7 @@ export const doorLockDevice = DeviceTypeDefinition({
|
|
|
329
327
|
code: 0xa,
|
|
330
328
|
deviceClass: DeviceClasses.Simple,
|
|
331
329
|
revision: 3,
|
|
332
|
-
requiredServerClusters: [Identify.Cluster.id, DoorLock.Cluster.id
|
|
330
|
+
requiredServerClusters: [Identify.Cluster.id, DoorLock.Cluster.id],
|
|
333
331
|
optionalServerClusters: [],
|
|
334
332
|
});
|
|
335
333
|
export const coverDevice = DeviceTypeDefinition({
|
|
@@ -394,5 +392,5 @@ export const airConditioner = DeviceTypeDefinition({
|
|
|
394
392
|
deviceClass: DeviceClasses.Simple,
|
|
395
393
|
revision: 2,
|
|
396
394
|
requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id, Thermostat.Cluster.id],
|
|
397
|
-
optionalServerClusters: [Groups.Cluster.id,
|
|
395
|
+
optionalServerClusters: [Groups.Cluster.id, FanControl.Cluster.id, ThermostatUserInterfaceConfiguration.Cluster.id, TemperatureMeasurement.Cluster.id, RelativeHumidityMeasurement.Cluster.id],
|
|
398
396
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnsiLogger, BLUE, CYAN, YELLOW, db, debugStringify, er, hk, or, zb } from './logger/export.js';
|
|
2
2
|
import { bridgedNode } from './matterbridgeDeviceTypes.js';
|
|
3
3
|
import { isValidNumber, isValidObject } from './utils/export.js';
|
|
4
|
-
import {
|
|
4
|
+
import { MatterbridgeServer, MatterbridgeServerDevice, MatterbridgeIdentifyServer, MatterbridgeOnOffServer, MatterbridgeLevelControlServer, MatterbridgeColorControlServer, MatterbridgeWindowCoveringServer, MatterbridgeThermostatServer, MatterbridgeFanControlServer, MatterbridgeDoorLockServer, MatterbridgeModeSelectServer, MatterbridgeValveConfigurationAndControlServer, MatterbridgeSmokeCoAlarmServer, MatterbridgeBooleanStateConfigurationServer, MatterbridgeSwitchServer, } from './matterbridgeBehaviors.js';
|
|
5
5
|
import { addClusterServers, addFixedLabel, addOptionalClusterServers, addRequiredClusterServers, addUserLabel, capitalizeFirstLetter, createUniqueId, getBehavior, getBehaviourTypesFromClusterClientIds, getBehaviourTypesFromClusterServerIds, getDefaultFlowMeasurementClusterServer, getDefaultIlluminanceMeasurementClusterServer, getDefaultPressureMeasurementClusterServer, getDefaultRelativeHumidityMeasurementClusterServer, getDefaultTemperatureMeasurementClusterServer, getDefaultOccupancySensingClusterServer, lowercaseFirstLetter, updateAttribute, getClusterId, getAttributeId, setAttribute, getAttribute, checkNotLatinCharacters, generateUniqueId, subscribeAttribute, } from './matterbridgeEndpointHelpers.js';
|
|
6
6
|
import { Endpoint, Lifecycle, MutableEndpoint, NamedHandler, SupportedBehaviors, VendorId } from '@matter/main';
|
|
7
7
|
import { getClusterNameById, MeasurementType } from '@matter/main/types';
|
|
@@ -134,7 +134,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
134
134
|
this.log = new AnsiLogger({ logName: options.uniqueStorageKey ?? 'MatterbridgeEndpoint', logTimestampFormat: 4, logLevel: debug === true ? "debug" : MatterbridgeEndpoint.logLevel });
|
|
135
135
|
this.log.debug(`${YELLOW}new${db} MatterbridgeEndpoint: ${zb}${'0x' + firstDefinition.code.toString(16).padStart(4, '0')}${db}-${zb}${firstDefinition.name}${db} ` +
|
|
136
136
|
`id: ${CYAN}${options.uniqueStorageKey}${db} number: ${CYAN}${options.endpointId}${db} taglist: ${CYAN}${options.tagList ? debugStringify(options.tagList) : 'undefined'}${db}`);
|
|
137
|
-
this.behaviors.require(
|
|
137
|
+
this.behaviors.require(MatterbridgeServer, { deviceCommand: new MatterbridgeServerDevice(this.log, this.commandHandler, undefined) });
|
|
138
138
|
}
|
|
139
139
|
static async loadInstance(definition, options = {}, debug = false) {
|
|
140
140
|
return new MatterbridgeEndpoint(definition, options, debug);
|
|
@@ -115,8 +115,8 @@ export class MatterbridgePlatform {
|
|
|
115
115
|
if (device.deviceName)
|
|
116
116
|
this._registeredEndpointsByName.delete(device.deviceName);
|
|
117
117
|
}
|
|
118
|
-
async unregisterAllDevices() {
|
|
119
|
-
await this.matterbridge.removeAllBridgedEndpoints(this.name);
|
|
118
|
+
async unregisterAllDevices(delay = 0) {
|
|
119
|
+
await this.matterbridge.removeAllBridgedEndpoints(this.name, delay);
|
|
120
120
|
this._registeredEndpoints.clear();
|
|
121
121
|
this._registeredEndpointsByName.clear();
|
|
122
122
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "3.0.0-edge.
|
|
3
|
+
"version": "3.0.0-edge.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "3.0.0-edge.
|
|
9
|
+
"version": "3.0.0-edge.4",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "^0.13.0-alpha.0-20250408-c916c7e8",
|