matterbridge 1.3.3 → 1.3.5
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 +598 -542
- package/README.md +641 -594
- package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/OzoneConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/OzoneConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/OzoneConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/OzoneConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/Pm10ConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/Pm10ConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/Pm10ConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/Pm10ConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/Pm1ConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/Pm1ConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/Pm1ConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/Pm1ConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/Pm25ConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/Pm25ConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/Pm25ConcentrationMeasurementCluster.js +2 -2
- package/dist/cluster/Pm25ConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/RadonConcentrationMeasurementCluster.d.ts +1 -1
- package/dist/cluster/RadonConcentrationMeasurementCluster.d.ts.map +1 -1
- package/dist/cluster/RadonConcentrationMeasurementCluster.js +1 -1
- package/dist/cluster/RadonConcentrationMeasurementCluster.js.map +1 -1
- package/dist/cluster/export.d.ts +25 -0
- package/dist/cluster/export.d.ts.map +1 -0
- package/dist/cluster/export.js +25 -0
- package/dist/cluster/export.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/log/export.d.ts +2 -0
- package/dist/log/export.d.ts.map +1 -0
- package/dist/log/export.js +2 -0
- package/dist/log/export.js.map +1 -0
- package/dist/matterbridge.d.ts +6 -0
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +172 -306
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeController.d.ts.map +1 -1
- package/dist/matterbridgeController.js +0 -3
- package/dist/matterbridgeController.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +213 -4
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +129 -42
- package/dist/matterbridgeDevice.js.map +1 -1
- package/dist/storage/export.d.ts +2 -0
- package/dist/storage/export.d.ts.map +1 -0
- package/dist/storage/export.js +2 -0
- package/dist/storage/export.js.map +1 -0
- package/dist/utils/colorUtils.d.ts +61 -0
- package/dist/utils/colorUtils.d.ts.map +1 -0
- package/dist/utils/colorUtils.js +313 -0
- package/dist/utils/colorUtils.js.map +1 -0
- package/dist/utils/export.d.ts +3 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/export.js +3 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/utils.d.ts +73 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +266 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.cbfc6c9b.js → main.c3b5dfce.js} +3 -3
- package/frontend/build/static/js/{main.cbfc6c9b.js.map → main.c3b5dfce.js.map} +1 -1
- package/package.json +34 -20
- package/migrationV8.txt +0 -61
- /package/frontend/build/static/js/{main.cbfc6c9b.js.LICENSE.txt → main.c3b5dfce.js.LICENSE.txt} +0 -0
|
@@ -1107,7 +1107,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1107
1107
|
activeNetworkFaults: [],
|
|
1108
1108
|
}, {
|
|
1109
1109
|
resetCounts: async (data) => {
|
|
1110
|
-
// eslint-disable-next-line no-console
|
|
1111
1110
|
this.log.debug('Matter command: resetCounts');
|
|
1112
1111
|
await this.commandHandler.executeHandler('resetCounts', data);
|
|
1113
1112
|
},
|
|
@@ -1160,7 +1159,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1160
1159
|
}, {
|
|
1161
1160
|
moveToLevel: async ({ request, attributes, endpoint }) => {
|
|
1162
1161
|
this.log.debug('Matter command: moveToLevel request:', request, 'attributes.currentLevel:', attributes.currentLevel.getLocal());
|
|
1163
|
-
await this.commandHandler.executeHandler('moveToLevel', { request
|
|
1162
|
+
await this.commandHandler.executeHandler('moveToLevel', { request, attributes, endpoint });
|
|
1164
1163
|
},
|
|
1165
1164
|
move: async () => {
|
|
1166
1165
|
this.log.error('Matter command: move not implemented');
|
|
@@ -1173,7 +1172,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1173
1172
|
},
|
|
1174
1173
|
moveToLevelWithOnOff: async ({ request, attributes, endpoint }) => {
|
|
1175
1174
|
this.log.debug('Matter command: moveToLevelWithOnOff request:', request, 'attributes.currentLevel:', attributes.currentLevel.getLocal());
|
|
1176
|
-
await this.commandHandler.executeHandler('moveToLevelWithOnOff', { request
|
|
1175
|
+
await this.commandHandler.executeHandler('moveToLevelWithOnOff', { request, attributes, endpoint });
|
|
1177
1176
|
},
|
|
1178
1177
|
moveWithOnOff: async () => {
|
|
1179
1178
|
this.log.error('Matter command: moveWithOnOff not implemented');
|
|
@@ -1218,57 +1217,46 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1218
1217
|
colorTempPhysicalMinMireds,
|
|
1219
1218
|
colorTempPhysicalMaxMireds,
|
|
1220
1219
|
}, {
|
|
1221
|
-
moveToHue: async ({ request
|
|
1222
|
-
// eslint-disable-next-line no-console
|
|
1220
|
+
moveToHue: async ({ request, attributes, endpoint }) => {
|
|
1223
1221
|
this.log.debug('Matter command: moveToHue request:', request, 'attributes.currentHue:', attributes.currentHue.getLocal());
|
|
1224
1222
|
// attributes.currentHue.setLocal(request.hue);
|
|
1225
|
-
this.commandHandler.executeHandler('moveToHue', { request
|
|
1223
|
+
this.commandHandler.executeHandler('moveToHue', { request, attributes, endpoint });
|
|
1226
1224
|
},
|
|
1227
1225
|
moveHue: async () => {
|
|
1228
|
-
// eslint-disable-next-line no-console
|
|
1229
1226
|
this.log.error('Matter command: moveHue not implemented');
|
|
1230
1227
|
},
|
|
1231
1228
|
stepHue: async () => {
|
|
1232
|
-
// eslint-disable-next-line no-console
|
|
1233
1229
|
this.log.error('Matter command: stepHue not implemented');
|
|
1234
1230
|
},
|
|
1235
|
-
moveToSaturation: async ({ request
|
|
1236
|
-
// eslint-disable-next-line no-console
|
|
1231
|
+
moveToSaturation: async ({ request, attributes, endpoint }) => {
|
|
1237
1232
|
this.log.debug('Matter command: moveToSaturation request:', request, 'attributes.currentSaturation:', attributes.currentSaturation.getLocal());
|
|
1238
1233
|
// attributes.currentSaturation.setLocal(request.saturation);
|
|
1239
|
-
this.commandHandler.executeHandler('moveToSaturation', { request
|
|
1234
|
+
this.commandHandler.executeHandler('moveToSaturation', { request, attributes, endpoint });
|
|
1240
1235
|
},
|
|
1241
1236
|
moveSaturation: async () => {
|
|
1242
|
-
// eslint-disable-next-line no-console
|
|
1243
1237
|
this.log.error('Matter command: moveSaturation not implemented');
|
|
1244
1238
|
},
|
|
1245
1239
|
stepSaturation: async () => {
|
|
1246
|
-
// eslint-disable-next-line no-console
|
|
1247
1240
|
this.log.error('Matter command: stepSaturation not implemented');
|
|
1248
1241
|
},
|
|
1249
|
-
moveToHueAndSaturation: async ({ request
|
|
1250
|
-
// eslint-disable-next-line no-console
|
|
1242
|
+
moveToHueAndSaturation: async ({ request, attributes, endpoint }) => {
|
|
1251
1243
|
this.log.debug('Matter command: moveToHueAndSaturation request:', request, 'attributes.currentHue:', attributes.currentHue.getLocal(), 'attributes.currentSaturation:', attributes.currentSaturation.getLocal());
|
|
1252
1244
|
// attributes.currentHue.setLocal(request.hue);
|
|
1253
1245
|
// attributes.currentSaturation.setLocal(request.saturation);
|
|
1254
|
-
this.commandHandler.executeHandler('moveToHueAndSaturation', { request
|
|
1246
|
+
this.commandHandler.executeHandler('moveToHueAndSaturation', { request, attributes, endpoint });
|
|
1255
1247
|
},
|
|
1256
1248
|
stopMoveStep: async () => {
|
|
1257
|
-
// eslint-disable-next-line no-console
|
|
1258
1249
|
this.log.error('Matter command: stopMoveStep not implemented');
|
|
1259
1250
|
},
|
|
1260
|
-
moveToColorTemperature: async ({ request
|
|
1261
|
-
// eslint-disable-next-line no-console
|
|
1251
|
+
moveToColorTemperature: async ({ request, attributes, endpoint }) => {
|
|
1262
1252
|
this.log.debug('Matter command: moveToColorTemperature request:', request, 'attributes.colorTemperatureMireds:', attributes.colorTemperatureMireds.getLocal());
|
|
1263
1253
|
// attributes.colorTemperatureMireds.setLocal(request.colorTemperatureMireds);
|
|
1264
|
-
this.commandHandler.executeHandler('moveToColorTemperature', { request
|
|
1254
|
+
this.commandHandler.executeHandler('moveToColorTemperature', { request, attributes, endpoint });
|
|
1265
1255
|
},
|
|
1266
1256
|
moveColorTemperature: async () => {
|
|
1267
|
-
// eslint-disable-next-line no-console
|
|
1268
1257
|
this.log.error('Matter command: moveColorTemperature not implemented');
|
|
1269
1258
|
},
|
|
1270
1259
|
stepColorTemperature: async () => {
|
|
1271
|
-
// eslint-disable-next-line no-console
|
|
1272
1260
|
this.log.error('Matter command: stepColorTemperature not implemented');
|
|
1273
1261
|
},
|
|
1274
1262
|
}, {});
|
|
@@ -1285,6 +1273,93 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1285
1273
|
createDefaultColorControlClusterServer(currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1286
1274
|
this.addClusterServer(this.getDefaultColorControlClusterServer(currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1287
1275
|
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Get a default color control cluster server.
|
|
1278
|
+
*
|
|
1279
|
+
* @param currentHue - The current hue value.
|
|
1280
|
+
* @param currentSaturation - The current saturation value.
|
|
1281
|
+
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1282
|
+
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1283
|
+
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1284
|
+
*/
|
|
1285
|
+
getDefaultXYColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1286
|
+
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
1287
|
+
colorMode: ColorControl.ColorMode.CurrentHueAndCurrentSaturation,
|
|
1288
|
+
options: {
|
|
1289
|
+
executeIfOff: false,
|
|
1290
|
+
},
|
|
1291
|
+
numberOfPrimaries: null,
|
|
1292
|
+
enhancedColorMode: ColorControl.EnhancedColorMode.CurrentHueAndCurrentSaturation,
|
|
1293
|
+
colorCapabilities: { xy: true, hueSaturation: true, colorLoop: false, enhancedHue: false, colorTemperature: true },
|
|
1294
|
+
currentHue: 0,
|
|
1295
|
+
currentSaturation: 0,
|
|
1296
|
+
currentX,
|
|
1297
|
+
currentY,
|
|
1298
|
+
colorTemperatureMireds,
|
|
1299
|
+
colorTempPhysicalMinMireds,
|
|
1300
|
+
colorTempPhysicalMaxMireds,
|
|
1301
|
+
}, {
|
|
1302
|
+
moveToColor: async (data) => {
|
|
1303
|
+
this.log.debug('Matter command: moveToColor request:', data.request, 'attributes.currentHue:', data.attributes.currentX.getLocal(), data.attributes.currentY.getLocal());
|
|
1304
|
+
this.commandHandler.executeHandler('moveToColor', data);
|
|
1305
|
+
},
|
|
1306
|
+
moveColor: async () => {
|
|
1307
|
+
this.log.error('Matter command: moveColor not implemented');
|
|
1308
|
+
},
|
|
1309
|
+
stepColor: async () => {
|
|
1310
|
+
this.log.error('Matter command: stepColor not implemented');
|
|
1311
|
+
},
|
|
1312
|
+
moveToHue: async ({ request, attributes, endpoint }) => {
|
|
1313
|
+
this.log.debug('Matter command: moveToHue request:', request, 'attributes.currentHue:', attributes.currentHue.getLocal());
|
|
1314
|
+
this.commandHandler.executeHandler('moveToHue', { request, attributes, endpoint });
|
|
1315
|
+
},
|
|
1316
|
+
moveHue: async () => {
|
|
1317
|
+
this.log.error('Matter command: moveHue not implemented');
|
|
1318
|
+
},
|
|
1319
|
+
stepHue: async () => {
|
|
1320
|
+
this.log.error('Matter command: stepHue not implemented');
|
|
1321
|
+
},
|
|
1322
|
+
moveToSaturation: async ({ request, attributes, endpoint }) => {
|
|
1323
|
+
this.log.debug('Matter command: moveToSaturation request:', request, 'attributes.currentSaturation:', attributes.currentSaturation.getLocal());
|
|
1324
|
+
this.commandHandler.executeHandler('moveToSaturation', { request, attributes, endpoint });
|
|
1325
|
+
},
|
|
1326
|
+
moveSaturation: async () => {
|
|
1327
|
+
this.log.error('Matter command: moveSaturation not implemented');
|
|
1328
|
+
},
|
|
1329
|
+
stepSaturation: async () => {
|
|
1330
|
+
this.log.error('Matter command: stepSaturation not implemented');
|
|
1331
|
+
},
|
|
1332
|
+
moveToHueAndSaturation: async ({ request, attributes, endpoint }) => {
|
|
1333
|
+
this.log.debug('Matter command: moveToHueAndSaturation request:', request, 'attributes.currentHue:', attributes.currentHue.getLocal(), 'attributes.currentSaturation:', attributes.currentSaturation.getLocal());
|
|
1334
|
+
this.commandHandler.executeHandler('moveToHueAndSaturation', { request, attributes, endpoint });
|
|
1335
|
+
},
|
|
1336
|
+
stopMoveStep: async () => {
|
|
1337
|
+
this.log.error('Matter command: stopMoveStep not implemented');
|
|
1338
|
+
},
|
|
1339
|
+
moveToColorTemperature: async ({ request, attributes, endpoint }) => {
|
|
1340
|
+
this.log.debug('Matter command: moveToColorTemperature request:', request, 'attributes.colorTemperatureMireds:', attributes.colorTemperatureMireds.getLocal());
|
|
1341
|
+
this.commandHandler.executeHandler('moveToColorTemperature', { request, attributes, endpoint });
|
|
1342
|
+
},
|
|
1343
|
+
moveColorTemperature: async () => {
|
|
1344
|
+
this.log.error('Matter command: moveColorTemperature not implemented');
|
|
1345
|
+
},
|
|
1346
|
+
stepColorTemperature: async () => {
|
|
1347
|
+
this.log.error('Matter command: stepColorTemperature not implemented');
|
|
1348
|
+
},
|
|
1349
|
+
}, {});
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Creates a default color control cluster server.
|
|
1353
|
+
*
|
|
1354
|
+
* @param currentHue - The current hue value.
|
|
1355
|
+
* @param currentSaturation - The current saturation value.
|
|
1356
|
+
* @param colorTemperatureMireds - The color temperature in mireds.
|
|
1357
|
+
* @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
|
|
1358
|
+
* @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
|
|
1359
|
+
*/
|
|
1360
|
+
createDefaultXYColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1361
|
+
this.addClusterServer(this.getDefaultXYColorControlClusterServer(currentX, currentY, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1362
|
+
}
|
|
1288
1363
|
/**
|
|
1289
1364
|
* Get a default window covering cluster server.
|
|
1290
1365
|
*
|
|
@@ -1311,22 +1386,18 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1311
1386
|
installedOpenLimitLift: 0,
|
|
1312
1387
|
}, {
|
|
1313
1388
|
upOrOpen: async (data) => {
|
|
1314
|
-
// eslint-disable-next-line no-console
|
|
1315
1389
|
this.log.debug('Matter command: upOrOpen');
|
|
1316
1390
|
await this.commandHandler.executeHandler('upOrOpen', data);
|
|
1317
1391
|
},
|
|
1318
1392
|
downOrClose: async (data) => {
|
|
1319
|
-
// eslint-disable-next-line no-console
|
|
1320
1393
|
this.log.debug('Matter command: downOrClose');
|
|
1321
1394
|
await this.commandHandler.executeHandler('downOrClose', data);
|
|
1322
1395
|
},
|
|
1323
1396
|
stopMotion: async (data) => {
|
|
1324
|
-
// eslint-disable-next-line no-console
|
|
1325
1397
|
this.log.debug('Matter command: stopMotion');
|
|
1326
1398
|
await this.commandHandler.executeHandler('stopMotion', data);
|
|
1327
1399
|
},
|
|
1328
1400
|
goToLiftPercentage: async (data) => {
|
|
1329
|
-
// eslint-disable-next-line no-console
|
|
1330
1401
|
this.log.debug(`Matter command: goToLiftPercentage: ${data.request.liftPercent100thsValue} current: ${data.attributes.currentPositionLiftPercent100ths?.getLocal()} ` +
|
|
1331
1402
|
`target: ${data.attributes.targetPositionLiftPercent100ths?.getLocal()} status: ${data.attributes.operationalStatus.getLocal().lift}`);
|
|
1332
1403
|
await this.commandHandler.executeHandler('goToLiftPercentage', data);
|
|
@@ -1358,7 +1429,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1358
1429
|
tilt: 0,
|
|
1359
1430
|
});
|
|
1360
1431
|
}
|
|
1361
|
-
// eslint-disable-next-line no-console
|
|
1362
1432
|
// console.log(`Set WindowCovering initial currentPositionLiftPercent100ths and targetPositionLiftPercent100ths to ${position} and operationalStatus to Stopped.`);
|
|
1363
1433
|
}
|
|
1364
1434
|
}
|
|
@@ -1381,7 +1451,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1381
1451
|
tilt: 0,
|
|
1382
1452
|
});
|
|
1383
1453
|
}
|
|
1384
|
-
// eslint-disable-next-line no-console
|
|
1385
1454
|
// console.log(`Set WindowCovering currentPositionLiftPercent100ths: ${current}, targetPositionLiftPercent100ths: ${target} and operationalStatus: ${status}.`);
|
|
1386
1455
|
}
|
|
1387
1456
|
/**
|
|
@@ -1395,7 +1464,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1395
1464
|
if (!windowCovering)
|
|
1396
1465
|
return;
|
|
1397
1466
|
windowCovering.setOperationalStatusAttribute({ global: status, lift: status, tilt: 0 });
|
|
1398
|
-
// eslint-disable-next-line no-console
|
|
1399
1467
|
// console.log(`Set WindowCovering operationalStatus: ${status}`);
|
|
1400
1468
|
}
|
|
1401
1469
|
/**
|
|
@@ -1409,7 +1477,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1409
1477
|
if (!windowCovering)
|
|
1410
1478
|
return undefined;
|
|
1411
1479
|
const status = windowCovering.getOperationalStatusAttribute();
|
|
1412
|
-
// eslint-disable-next-line no-console
|
|
1413
1480
|
// console.log(`Get WindowCovering operationalStatus: ${status.global}`);
|
|
1414
1481
|
return status.global;
|
|
1415
1482
|
}
|
|
@@ -1426,7 +1493,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1426
1493
|
return;
|
|
1427
1494
|
windowCovering.setCurrentPositionLiftPercent100thsAttribute(position);
|
|
1428
1495
|
windowCovering.setTargetPositionLiftPercent100thsAttribute(position);
|
|
1429
|
-
// eslint-disable-next-line no-console
|
|
1430
1496
|
// console.log(`Set WindowCovering currentPositionLiftPercent100ths: ${position} and targetPositionLiftPercent100ths: ${position}.`);
|
|
1431
1497
|
}
|
|
1432
1498
|
/**
|
|
@@ -1445,12 +1511,10 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1445
1511
|
supportedOperatingModes: { normal: true, vacation: false, privacy: false, noRemoteLockUnlock: false, passage: false },
|
|
1446
1512
|
}, {
|
|
1447
1513
|
lockDoor: async (data) => {
|
|
1448
|
-
// eslint-disable-next-line no-console
|
|
1449
1514
|
this.log.debug('Matter command: lockDoor', data.request);
|
|
1450
1515
|
await this.commandHandler.executeHandler('lockDoor', data);
|
|
1451
1516
|
},
|
|
1452
1517
|
unlockDoor: async (data) => {
|
|
1453
|
-
// eslint-disable-next-line no-console
|
|
1454
1518
|
this.log.debug('Matter command: unlockDoor', data.request);
|
|
1455
1519
|
await this.commandHandler.executeHandler('unlockDoor', data);
|
|
1456
1520
|
},
|
|
@@ -1471,7 +1535,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1471
1535
|
this.addClusterServer(this.getDefaultDoorLockClusterServer(lockState, lockType));
|
|
1472
1536
|
}
|
|
1473
1537
|
/**
|
|
1474
|
-
* Get a default switch cluster server.
|
|
1538
|
+
* Get a default momentary switch cluster server.
|
|
1475
1539
|
*
|
|
1476
1540
|
* @remarks
|
|
1477
1541
|
* This method adds a cluster server with default momentary switch features and configurations suitable for (AppleHome) Single Double Long automations.
|
|
@@ -1491,16 +1555,41 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1491
1555
|
});
|
|
1492
1556
|
}
|
|
1493
1557
|
/**
|
|
1494
|
-
* Creates a default switch cluster server.
|
|
1558
|
+
* Creates a default momentary switch cluster server.
|
|
1495
1559
|
*
|
|
1496
1560
|
* @remarks
|
|
1497
|
-
* This method adds a cluster server with default switch features and configurations.
|
|
1561
|
+
* This method adds a cluster server with default momentary switch features and configurations.
|
|
1498
1562
|
*/
|
|
1499
1563
|
createDefaultSwitchClusterServer() {
|
|
1500
1564
|
this.addClusterServer(this.getDefaultSwitchClusterServer());
|
|
1501
1565
|
this.addFixedLabel('orientation', 'Switch');
|
|
1502
1566
|
this.addFixedLabel('label', 'Switch');
|
|
1503
1567
|
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Get a default latching switch cluster server.
|
|
1570
|
+
*
|
|
1571
|
+
* @remarks
|
|
1572
|
+
* This method adds a cluster server with default latching switch features and configuration.
|
|
1573
|
+
*/
|
|
1574
|
+
getDefaultLatchingSwitchClusterServer() {
|
|
1575
|
+
return ClusterServer(SwitchCluster.with(Switch.Feature.LatchingSwitch), {
|
|
1576
|
+
numberOfPositions: 2,
|
|
1577
|
+
currentPosition: 0,
|
|
1578
|
+
}, {}, {
|
|
1579
|
+
switchLatched: true,
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* Creates a default latching switch cluster server.
|
|
1584
|
+
*
|
|
1585
|
+
* @remarks
|
|
1586
|
+
* This method adds a cluster server with default latching switch features and configuration.
|
|
1587
|
+
*/
|
|
1588
|
+
createDefaultLatchingSwitchClusterServer() {
|
|
1589
|
+
this.addClusterServer(this.getDefaultLatchingSwitchClusterServer());
|
|
1590
|
+
this.addFixedLabel('orientation', 'Switch');
|
|
1591
|
+
this.addFixedLabel('label', 'Switch');
|
|
1592
|
+
}
|
|
1504
1593
|
getDefaultModeSelectClusterServer(description, supportedModes, currentMode = 0, startUpMode = 0) {
|
|
1505
1594
|
return ClusterServer(ModeSelectCluster, {
|
|
1506
1595
|
description: description,
|
|
@@ -1686,7 +1775,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1686
1775
|
sensorFault: { generalFault: sensorFault },
|
|
1687
1776
|
}, {
|
|
1688
1777
|
enableDisableAlarm: async ({ request, attributes }) => {
|
|
1689
|
-
// eslint-disable-next-line no-console
|
|
1690
1778
|
this.log.debug('Matter command: enableDisableAlarm', request);
|
|
1691
1779
|
await this.commandHandler.executeHandler('enableDisableAlarm', { request, attributes });
|
|
1692
1780
|
},
|
|
@@ -1866,7 +1954,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
1866
1954
|
thermostatRunningMode: Thermostat.ThermostatRunningMode.Off,
|
|
1867
1955
|
}, {
|
|
1868
1956
|
setpointRaiseLower: async ({ request, attributes }) => {
|
|
1869
|
-
// eslint-disable-next-line no-console
|
|
1870
1957
|
this.log.debug('Matter command: setpointRaiseLower', request);
|
|
1871
1958
|
await this.commandHandler.executeHandler('setpointRaiseLower', { request, attributes });
|
|
1872
1959
|
},
|
|
@@ -2136,7 +2223,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2136
2223
|
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2137
2224
|
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2138
2225
|
*/
|
|
2139
|
-
getDefaultOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.
|
|
2226
|
+
getDefaultOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2140
2227
|
return ClusterServer(OzoneConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2141
2228
|
measuredValue,
|
|
2142
2229
|
minMeasuredValue: null,
|
|
@@ -2153,7 +2240,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2153
2240
|
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2154
2241
|
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2155
2242
|
*/
|
|
2156
|
-
createDefaulOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.
|
|
2243
|
+
createDefaulOzoneConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2157
2244
|
this.addClusterServer(this.getDefaultOzoneConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2158
2245
|
}
|
|
2159
2246
|
/**
|
|
@@ -2192,7 +2279,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2192
2279
|
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2193
2280
|
* @returns {ClusterServer} - The default Carbon Monoxide Concentration Measurement Cluster Server.
|
|
2194
2281
|
*/
|
|
2195
|
-
getDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.
|
|
2282
|
+
getDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2196
2283
|
return ClusterServer(NitrogenDioxideConcentrationMeasurementCluster.with('NumericMeasurement'), {
|
|
2197
2284
|
measuredValue,
|
|
2198
2285
|
minMeasuredValue: null,
|
|
@@ -2209,7 +2296,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
2209
2296
|
* @param {ConcentrationMeasurement.MeasurementUnit} measurementUnit - The unit of measurement.
|
|
2210
2297
|
* @param {ConcentrationMeasurement.MeasurementMedium} measurementMedium - The medium of measurement.
|
|
2211
2298
|
*/
|
|
2212
|
-
createDefaulNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.
|
|
2299
|
+
createDefaulNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue = 0, measurementUnit = ConcentrationMeasurement.MeasurementUnit.Ugm3, measurementMedium = ConcentrationMeasurement.MeasurementMedium.Air) {
|
|
2213
2300
|
this.addClusterServer(this.getDefaultNitrogenDioxideConcentrationMeasurementClusterServer(measuredValue, measurementUnit, measurementMedium));
|
|
2214
2301
|
}
|
|
2215
2302
|
/**
|