homebridge-cmd4 6.0.1 → 6.1.0
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 +4 -51
- package/Cmd4Accessory.js +107 -80
- package/Cmd4Platform.js +14 -2
- package/Cmd4PriorityPollingQueue.js +18 -7
- package/RUNNING_CHANGELOG.md +41 -0
- package/cmd4Constants.js +1 -0
- package/docs/Developers.md +1 -1
- package/lib/CMD4_ACC_TYPE_ENUM.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,60 +1,13 @@
|
|
|
1
1
|
# Homebridges-cmd4 - CMD4 Plugin for Homebridge - Supports ~All Accessory Types and now all Characteristics too!!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
##### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* For bug[#116](https://github.com/ztalbot2000/homebridge-cmd4/pull/116) remove stateCmd validation and for AirCon add global const parsing ([e7bc4963](https://github.com/ztalbot2000/homebridge-cmd4/commit/e7bc49630c47d16d296ff9751df7c7666cf2ecd3))
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# Homebridges-cmd4 - CMD4 Plugin for Homebridge - Supports ~All Accessory Types and now all Characteristics too!!
|
|
10
|
-
## 6.0.0 (2021-10-01)
|
|
2
|
+
### 6.1.0 (2022-01-30)
|
|
11
3
|
|
|
12
4
|
##### New Features
|
|
13
5
|
|
|
14
|
-
|
|
15
|
-
- To this end; Cmd4 Version 6 will be the version that prepares you for the change by *Warning* you that your config.json needs to be corrected. The duration of this preparatory stage will be pretty generous as I am still working on the config-schema.json integration with Homebridge-ui. I had to stop when it became evident what changes were required for Homebridge-ui integration.
|
|
16
|
-
|
|
17
|
-
Here are the rules / changes:
|
|
18
|
-
1. No script changes are required. Cmd4 still sends: Get/Set <DeviceName> <Upper Case Characteristic Type > < value >
|
|
19
|
-
2. Constants are still fully capitalized. i.e. "statusFault": "NO_FAULT" or "category": "TELEVISION"
|
|
20
|
-
3. As before Device Types start with an upper case. i.e. "type": "Television"
|
|
21
|
-
4. Cmd4 directives and characteristics start with lower case: i.e. "polling": [ { "characteristic": "volume", "interval": 10 }]
|
|
22
|
-
5. For advanced devices like the AirCon, Queue types remain the same:
|
|
23
|
-
i.e. queueTypes: [ { "queueName": "MyQueue", "queueType": "WoRm" }]
|
|
24
|
-
|
|
25
|
-
Finally
|
|
26
|
-
I tried to make the warnings very explict for what the correction should be and believe me; I am more sorry to have
|
|
27
|
-
to do this than you may think.
|
|
28
|
-
|
|
29
|
-
Thank you,
|
|
30
|
-
John Talbot
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* Schema Prep - Found in Beta Check case of type ([9a394de0](https://github.com/ztalbot2000/homebridge-cmd4/commit/9a394de020b2ccf67a9c30194163807ea3a226a9))
|
|
34
|
-
* Schema Prep - More documentation changes ([c6d68f1f](https://github.com/ztalbot2000/homebridge-cmd4/commit/c6d68f1f8a7c24e786a54dbf1660dba98a5d1b6a))
|
|
35
|
-
* Schema Prep - Documentation changes for feat ([5be7393d](https://github.com/ztalbot2000/homebridge-cmd4/commit/5be7393d4b722c602862a382b1bd710556ff196a))
|
|
36
|
-
* Schema Prep. More fakegato testing, Make cmd4Dbg not be file global scope ([50355797](https://github.com/ztalbot2000/homebridge-cmd4/commit/503557973758fd4103ab13f34680a4f08eaed3c2))
|
|
37
|
-
* Schema Prep - for fakegato and others, correct key/value pair the first time it is found ([335ca7e5](https://github.com/ztalbot2000/homebridge-cmd4/commit/335ca7e50958a089c21bfac61ee1982756b7965b))
|
|
38
|
-
* Schema Prep - Make sure fakegato characteristics are correct ([a8274c7a](https://github.com/ztalbot2000/homebridge-cmd4/commit/a8274c7adb9ffdc2c34d048057f8334d6da9ef8a))
|
|
39
|
-
* Schema Prep - Should save by index, like others ([20872e2b](https://github.com/ztalbot2000/homebridge-cmd4/commit/20872e2b0f8a5c52131bb9247ba6e6ae11b20fb4))
|
|
40
|
-
* Schema-Prep This works with all lower case, still sends Get/Set upper case ([d3764584](https://github.com/ztalbot2000/homebridge-cmd4/commit/d3764584f5e0faf369490ad85ed16ba3f19e41c8))
|
|
41
|
-
* Schema Prep - constants are now lower case and the input is lowered instead ([03b232a1](https://github.com/ztalbot2000/homebridge-cmd4/commit/03b232a152a622025ccfe7c6dc32ab3fa59d6df2))
|
|
42
|
-
* New tset tool to check where constant is defined ([4fc3668a](https://github.com/ztalbot2000/homebridge-cmd4/commit/4fc3668ad0e1fe51dde4a32ef83f3c78584f4e91))
|
|
43
|
-
* Schema Prep - Change variables to lower case, still check for Upper case ([2b8f4bf7](https://github.com/ztalbot2000/homebridge-cmd4/commit/2b8f4bf768d1c7aebb3c45f6b019de8201c1656e))
|
|
44
|
-
* Schema prep- Change constants to an object ([f0dd0de9](https://github.com/ztalbot2000/homebridge-cmd4/commit/f0dd0de923c12fe6dd52cf5469ff87b2d762ee37))
|
|
45
|
-
* Continue Schema Prep. Cmd4Storage is now referenced accordingly ([79d85b01](https://github.com/ztalbot2000/homebridge-cmd4/commit/79d85b01bac8d1d3a79a407bcbec0163f19f4e4d))
|
|
46
|
-
* Schema Prep. FakeGato simplification ([fd26104b](https://github.com/ztalbot2000/homebridge-cmd4/commit/fd26104b0d9c35a53209e91b3efb9ccf820c0333))
|
|
47
|
-
* Prep for Schema. Stored data now version controlled and assoc array class ([59d7a229](https://github.com/ztalbot2000/homebridge-cmd4/commit/59d7a22903fbb95b4e1b55a7fca4629960c89bfe))
|
|
48
|
-
* Prep for schema. Warn keys must be lower case ([fe3c155c](https://github.com/ztalbot2000/homebridge-cmd4/commit/fe3c155c5b00574ca3b03baf6d3a32f942756988))
|
|
49
|
-
* "Prep for Schema. Unclutter namespace" ([12a63fb5](https://github.com/ztalbot2000/homebridge-cmd4/commit/12a63fb5339f346b31702bc2f52aa60f299c0de4))
|
|
6
|
+
* See if WoRm2 Queue can resolve large scale AirCon accessories ([61b164ae](https://github.com/ztalbot2000/homebridge-cmd4/commit/61b164ae11ffb4731da0ac60bba51d7fbeefff94))
|
|
50
7
|
|
|
51
8
|
##### Bug Fixes
|
|
52
9
|
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* The warning should read Capitalized, not Upper case ([9b7f7957](https://github.com/ztalbot2000/homebridge-cmd4/commit/9b7f7957613c2c36cb61c86d1f66b3bfa34d49fc))
|
|
56
|
-
* Found in demo mode, polling for default characteristics was attempted ([01960b73](https://github.com/ztalbot2000/homebridge-cmd4/commit/01960b73c696d788ea06469c5749da2272662e55))
|
|
57
|
-
* For Demo mode, Target states must be defined so warning is not shown ([a1e00e3f](https://github.com/ztalbot2000/homebridge-cmd4/commit/a1e00e3f84e80300c190b50473ee44026bfe42bc))
|
|
58
|
-
* Testing Prep Schema fix. Added unit test so will not happen again ([85ab69f7](https://github.com/ztalbot2000/homebridge-cmd4/commit/85ab69f7c366d2ab37ffe76c9eda7ba0d480e3d1))
|
|
10
|
+
* bug [#124](https://github.com/ztalbot2000/homebridge-cmd4/pull/124), Eve graph not being displayed ([929da3e3](https://github.com/ztalbot2000/homebridge-cmd4/commit/929da3e39548df645d316365ab1273d6b5ed250d))
|
|
11
|
+
* PROGRAM_SCHEDULED_MANUAL_MODE_ constant remove trailing underscore ([52e1fd3f](https://github.com/ztalbot2000/homebridge-cmd4/commit/52e1fd3f100e18588a171c96b8ef9f511180c1bd))
|
|
59
12
|
|
|
60
13
|
|
package/Cmd4Accessory.js
CHANGED
|
@@ -237,6 +237,16 @@ class Cmd4Accessory
|
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
// Add the global constants to the listOfConstants
|
|
241
|
+
if ( this.parentInfo && this.parentInfo.globalConstants != null )
|
|
242
|
+
{
|
|
243
|
+
this.processConstants( this.parentInfo.globalConstants );
|
|
244
|
+
// Since linked accessories get processed first, The parentInfo they
|
|
245
|
+
// get is actually "this" and we need for the linked accessory to
|
|
246
|
+
// process the constants first in order to see them. i.e. ${IP}
|
|
247
|
+
this.globalConstants = this.parentInfo.globalConstants;
|
|
248
|
+
}
|
|
249
|
+
|
|
240
250
|
// Direct if polling should be set or false.
|
|
241
251
|
// You cannot copy polling from the parent because you would be copying the array
|
|
242
252
|
// of polled characteristics that the child does not have, or turning on polling
|
|
@@ -1196,7 +1206,7 @@ class Cmd4Accessory
|
|
|
1196
1206
|
this.loggingService = new FakeGatoHistoryService
|
|
1197
1207
|
(
|
|
1198
1208
|
this.eve,
|
|
1199
|
-
this,
|
|
1209
|
+
this.platform,
|
|
1200
1210
|
{ [ constants.STORAGE ] : constants.FS,
|
|
1201
1211
|
[ constants.PATH ] : this.storagePath
|
|
1202
1212
|
}
|
|
@@ -1208,7 +1218,7 @@ class Cmd4Accessory
|
|
|
1208
1218
|
this.loggingService = new FakeGatoHistoryService
|
|
1209
1219
|
(
|
|
1210
1220
|
this.eve,
|
|
1211
|
-
this,
|
|
1221
|
+
this.platform,
|
|
1212
1222
|
{ [ constants.STORAGE ] : constants.GOOGLE_DRIVE,
|
|
1213
1223
|
[ constants.FOLDER ] : this.folder,
|
|
1214
1224
|
[ constants.KEYPATH ] : this.keyPath }
|
|
@@ -1283,108 +1293,99 @@ class Cmd4Accessory
|
|
|
1283
1293
|
this.cmd4Storage.setStoredValueForIndex( accTypeEnumIndex, properValue );
|
|
1284
1294
|
}
|
|
1285
1295
|
|
|
1286
|
-
processRequires(
|
|
1296
|
+
processRequires( requiresArray )
|
|
1287
1297
|
{
|
|
1288
|
-
if ( Array.isArray (
|
|
1289
|
-
|
|
1290
|
-
for ( let required in requires )
|
|
1291
|
-
this.processRequires( requires[ required ] );
|
|
1298
|
+
if ( ! Array.isArray ( requiresArray ) )
|
|
1299
|
+
throw new Error( `requires must be an array of { "require": "some requires string" }` );
|
|
1292
1300
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
if ( isJSON( requires ) )
|
|
1301
|
+
// Iterate over the groups of key/value constants in the array.
|
|
1302
|
+
for ( let argIndex = 0; argIndex < requiresArray.length; argIndex++ )
|
|
1296
1303
|
{
|
|
1297
|
-
|
|
1298
|
-
for ( let key in requires )
|
|
1299
|
-
{
|
|
1300
|
-
let required = requires[ key ] ;
|
|
1304
|
+
let argEntry = requiresArray[ argIndex ];
|
|
1301
1305
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1306
|
+
if ( argEntry.require == undefined )
|
|
1307
|
+
throw new Error( `Requires definition at index: "${ argIndex }" has no "require":"SomeRequire"` );
|
|
1304
1308
|
|
|
1309
|
+
let required = argEntry.require;
|
|
1305
1310
|
|
|
1306
|
-
|
|
1311
|
+
if ( typeof required != "string" )
|
|
1312
|
+
throw new Error( `Requires definition: "${ required }" must be a string.` );
|
|
1313
|
+
required = this.replaceConstantsInString( required );
|
|
1307
1314
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1315
|
+
if ( settings.cmd4Dbg ) this.log.debug( `Requiring ${ required }` );
|
|
1316
|
+
|
|
1317
|
+
require( required );
|
|
1311
1318
|
}
|
|
1312
|
-
throw new Error( `Requires must be an array of/or list of key/value pairs: "${ requires }".` );
|
|
1313
1319
|
}
|
|
1314
1320
|
|
|
1315
|
-
processConstants(
|
|
1321
|
+
processConstants( constantsArgArray )
|
|
1316
1322
|
{
|
|
1317
|
-
if ( Array.isArray (
|
|
1318
|
-
|
|
1319
|
-
for ( let constant in constantArg )
|
|
1320
|
-
this.processConstants( constantArg[ constant ] );
|
|
1323
|
+
if ( ! Array.isArray ( constantsArgArray ) )
|
|
1324
|
+
throw new Error( `Constants must be an array of { "key": "\${SomeKey}", "value": "some replacement string" }` );
|
|
1321
1325
|
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1326
|
+
|
|
1327
|
+
// Iterate over the groups of key/value constants in the array.
|
|
1328
|
+
for ( let argIndex = 0; argIndex < constantsArgArray.length; argIndex++ )
|
|
1325
1329
|
{
|
|
1326
|
-
|
|
1327
|
-
for ( let key in constantArg )
|
|
1328
|
-
{
|
|
1329
|
-
let keyToAdd = key ;
|
|
1330
|
-
let valueToAdd = constantArg[ key ] ;
|
|
1331
|
-
if ( ! keyToAdd.startsWith( "${" ) )
|
|
1332
|
-
throw new Error( `Constant definition for: "${ keyToAdd }" must start with "\${" for clarity.` );
|
|
1330
|
+
let argEntry = constantsArgArray[ argIndex ];
|
|
1333
1331
|
|
|
1332
|
+
if ( argEntry.key == undefined )
|
|
1333
|
+
throw new Error( `Constant definition at index: "${ argIndex }" has no "key":"\${SomeKey}"` );
|
|
1334
1334
|
|
|
1335
|
-
|
|
1336
|
-
|
|
1335
|
+
if ( argEntry.value == undefined )
|
|
1336
|
+
throw new Error( `Constant definition at index: "${ argIndex }" has no "value":"Some replacement string` );
|
|
1337
1337
|
|
|
1338
|
+
let keyToAdd = argEntry.key;
|
|
1339
|
+
let valueToAdd = argEntry.value;
|
|
1340
|
+
if ( ! keyToAdd.startsWith( "${" ) )
|
|
1341
|
+
throw new Error( `Constant definition for: "${ keyToAdd }" must start with "\${" for clarity.` );
|
|
1338
1342
|
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
valueToAdd.replace(/^'/, "")
|
|
1342
|
-
valueToAdd.replace(/'$/, "")
|
|
1343
|
+
if ( ! keyToAdd.endsWith( "}" ) )
|
|
1344
|
+
throw new Error( `Constant definition for: "${ keyToAdd }" must end with "}" for clarity.` );
|
|
1343
1345
|
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1346
|
+
// remove any leading and trailing single quotes
|
|
1347
|
+
// so that using it for replacement will be easier.
|
|
1348
|
+
valueToAdd.replace(/^'/, "")
|
|
1349
|
+
valueToAdd.replace(/'$/, "")
|
|
1348
1350
|
|
|
1349
|
-
|
|
1351
|
+
// Do not check for duplicates. Linked accessories add the same
|
|
1352
|
+
// ${IP} for example
|
|
1353
|
+
this.listOfConstants[ keyToAdd ] = valueToAdd;
|
|
1354
|
+
}
|
|
1350
1355
|
}
|
|
1351
1356
|
|
|
1352
|
-
processVariables(
|
|
1357
|
+
processVariables( variablesArgArray )
|
|
1353
1358
|
{
|
|
1354
|
-
if ( Array.isArray (
|
|
1355
|
-
|
|
1356
|
-
for ( let variable in variables )
|
|
1357
|
-
this.processConstants( variables[ variable ] );
|
|
1359
|
+
if ( ! Array.isArray ( variablesArgArray ) )
|
|
1360
|
+
throw new Error( `Variables must be an array of { "key": "\${SomeKey}", "value": "some replacement string" }` );
|
|
1358
1361
|
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
+
|
|
1363
|
+
// Iterate over the groups of key/value constants in the array.
|
|
1364
|
+
for ( let argIndex = 0; argIndex < variablesArgArray.length; argIndex++ )
|
|
1362
1365
|
{
|
|
1363
|
-
|
|
1364
|
-
for ( let key in variables )
|
|
1365
|
-
{
|
|
1366
|
-
let keyToAdd = key ;
|
|
1367
|
-
let valueToAdd = variables[ key ] ;
|
|
1368
|
-
if ( ! keyToAdd.startsWith( "${" ) )
|
|
1369
|
-
throw new Error( `Variable definition for: "${ keyToAdd }" must start with "\${" for clarity.` );
|
|
1366
|
+
let argEntry = variablesArgArray[ argIndex ];
|
|
1370
1367
|
|
|
1371
|
-
|
|
1372
|
-
|
|
1368
|
+
if ( argEntry.key == undefined )
|
|
1369
|
+
throw new Error( `Variable definition at index: "${ argIndex }" has no "key":"\${SomeKey}"` );
|
|
1373
1370
|
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
valueToAdd.replace(/^'/, "")
|
|
1377
|
-
valueToAdd.replace(/'$/, "")
|
|
1371
|
+
if ( argEntry.value == undefined )
|
|
1372
|
+
throw new Error( `Variable definition at index: "${ argIndex }" has no "value":"Some replacement string` );
|
|
1378
1373
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1374
|
+
let keyToAdd = argEntry.key;
|
|
1375
|
+
let valueToAdd = argEntry.value;
|
|
1376
|
+
if ( ! keyToAdd.startsWith( "${" ) )
|
|
1377
|
+
throw new Error( `Variable definition for: "${ keyToAdd }" must start with "\${" for clarity.` );
|
|
1381
1378
|
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
return;
|
|
1385
|
-
}
|
|
1379
|
+
if ( ! keyToAdd.endsWith( "}" ) )
|
|
1380
|
+
throw new Error( `Variable definition for: "${ keyToAdd }" must end with "}" for clarity.` );
|
|
1386
1381
|
|
|
1387
|
-
|
|
1382
|
+
// remove any leading and trailing single quotes
|
|
1383
|
+
// so that using it for replacement will be easier.
|
|
1384
|
+
valueToAdd.replace(/^'/, "")
|
|
1385
|
+
valueToAdd.replace(/'$/, "")
|
|
1386
|
+
|
|
1387
|
+
this.listOfVariables[ keyToAdd ] = valueToAdd;
|
|
1388
|
+
}
|
|
1388
1389
|
}
|
|
1389
1390
|
|
|
1390
1391
|
accessoryTypeConfigToCmd4Accessories( config, parentInfo )
|
|
@@ -1471,7 +1472,7 @@ class Cmd4Accessory
|
|
|
1471
1472
|
throw new Error( `Unknown device type: "${ value }" given in: "${ this.displayName }".` );
|
|
1472
1473
|
|
|
1473
1474
|
// warn now
|
|
1474
|
-
this.log.warn( `The config.json Cmd4 device type: ${ value } is lowerCase. It should be: ${ rcValue.deviceName }. In the near future this will be an error for homebridge-
|
|
1475
|
+
this.log.warn( `The config.json Cmd4 device type: ${ value } is lowerCase. It should be: ${ rcValue.deviceName }. In the near future this will be an error for homebridge-UI integration.\nTo remove this Warning, Please fix your config.json.` );
|
|
1475
1476
|
|
|
1476
1477
|
this.type = rcValue.deviceName;
|
|
1477
1478
|
}
|
|
@@ -1540,6 +1541,9 @@ class Cmd4Accessory
|
|
|
1540
1541
|
|
|
1541
1542
|
break;
|
|
1542
1543
|
case constants.QUEUETYPES:
|
|
1544
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the accessory level. Please move it to where "Platform: "Cmd4" is located in your config.json.` );
|
|
1545
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1546
|
+
|
|
1543
1547
|
parseAddQueueTypes( this.log, value );
|
|
1544
1548
|
|
|
1545
1549
|
break;
|
|
@@ -1565,6 +1569,7 @@ class Cmd4Accessory
|
|
|
1565
1569
|
case constants.POLLING:
|
|
1566
1570
|
// Do not parse it yet as characteristics must be set first.
|
|
1567
1571
|
this.polling = value;
|
|
1572
|
+
|
|
1568
1573
|
break;
|
|
1569
1574
|
case "Cmd4_Mode":
|
|
1570
1575
|
case "cmd4_Mode":
|
|
@@ -1600,18 +1605,30 @@ class Cmd4Accessory
|
|
|
1600
1605
|
|
|
1601
1606
|
break;
|
|
1602
1607
|
case constants.STORAGE:
|
|
1608
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
1609
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1610
|
+
|
|
1603
1611
|
this.storage = value;
|
|
1604
1612
|
|
|
1605
1613
|
break;
|
|
1606
1614
|
case constants.STORAGEPATH:
|
|
1615
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
1616
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1617
|
+
|
|
1607
1618
|
this.storagePath = value
|
|
1608
1619
|
|
|
1609
1620
|
break;
|
|
1610
1621
|
case constants.FOLDER:
|
|
1622
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
1623
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1624
|
+
|
|
1611
1625
|
this.folder = value
|
|
1612
1626
|
|
|
1613
1627
|
break;
|
|
1614
1628
|
case constants.KEYPATH:
|
|
1629
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
1630
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1631
|
+
|
|
1615
1632
|
this.keyPath = value
|
|
1616
1633
|
|
|
1617
1634
|
break;
|
|
@@ -1625,6 +1642,9 @@ class Cmd4Accessory
|
|
|
1625
1642
|
|
|
1626
1643
|
break;
|
|
1627
1644
|
case constants.CONSTANTS:
|
|
1645
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Accessory level. Please move it to where "Platform: "Cmd4" is located in your config.json.` );
|
|
1646
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1647
|
+
|
|
1628
1648
|
this.processConstants( value );
|
|
1629
1649
|
|
|
1630
1650
|
break;
|
|
@@ -1647,6 +1667,9 @@ class Cmd4Accessory
|
|
|
1647
1667
|
|
|
1648
1668
|
break;
|
|
1649
1669
|
case constants.ALLOWTLV8:
|
|
1670
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Accessory level. Please move it to where "Platform: "Cmd4" is located.` );
|
|
1671
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1672
|
+
|
|
1650
1673
|
this.allowTLV8 = value;
|
|
1651
1674
|
break;
|
|
1652
1675
|
default:
|
|
@@ -1693,10 +1716,6 @@ class Cmd4Accessory
|
|
|
1693
1716
|
this.log.info( chalk.blue( `Cmd4 is running in Demo Mode for ${ this.displayName }` ) );
|
|
1694
1717
|
}
|
|
1695
1718
|
|
|
1696
|
-
// Add the global constants to the listOfConstants
|
|
1697
|
-
if ( this.parentInfo.globalConstants != null )
|
|
1698
|
-
this.processConstants( this.parentInfo.globalConstants );
|
|
1699
|
-
|
|
1700
1719
|
// Handle seperation of strings of state_cmd for a prefix
|
|
1701
1720
|
if ( this.state_cmd_prefix )
|
|
1702
1721
|
this.state_cmd_prefix = this.state_cmd_prefix + " ";
|
|
@@ -1916,6 +1935,9 @@ class Cmd4Accessory
|
|
|
1916
1935
|
if ( this.queue && this.queue.queueName != value )
|
|
1917
1936
|
throw new Error( chalk.red( `Already defined Priority Polling Queue "${ this.queue.queueName }" for ${ this.displayName } cannot be redefined.` ) );
|
|
1918
1937
|
|
|
1938
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the polling level. Please define it for the accessory: ${ this.displayName } as "queue": "${ value }"` );
|
|
1939
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1940
|
+
|
|
1919
1941
|
this.queue = addQueue( this.log, value, constants.QUEUETYPE_WORM );
|
|
1920
1942
|
|
|
1921
1943
|
break;
|
|
@@ -1941,6 +1963,11 @@ class Cmd4Accessory
|
|
|
1941
1963
|
}
|
|
1942
1964
|
case constants.QUEUETYPES:
|
|
1943
1965
|
{
|
|
1966
|
+
// WHY IS THIS HERE AT ALL ??????????
|
|
1967
|
+
|
|
1968
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the accessory level. Please move it to where "Platform: "Cmd4" is located in your config.json.` );
|
|
1969
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
1970
|
+
|
|
1944
1971
|
parseAddQueueTypes( this.log, value );
|
|
1945
1972
|
// This whole record is not a characteristic polling entry
|
|
1946
1973
|
// continue to next ( via return )
|
package/Cmd4Platform.js
CHANGED
|
@@ -89,7 +89,7 @@ class Cmd4Platform
|
|
|
89
89
|
this.toBeRestoredPlatforms = [ ];
|
|
90
90
|
this.createdCmd4Accessories = [ ];
|
|
91
91
|
this.createdCmd4Platforms = [ ];
|
|
92
|
-
this.
|
|
92
|
+
this.globalConstants = null;
|
|
93
93
|
|
|
94
94
|
this.services = [ ];
|
|
95
95
|
|
|
@@ -272,6 +272,9 @@ class Cmd4Platform
|
|
|
272
272
|
this.log.warn( `To remove this message, just remove "${ key }" from your config.json` );
|
|
273
273
|
break;
|
|
274
274
|
case constants.STORAGE:
|
|
275
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
276
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
277
|
+
|
|
275
278
|
if ( value == constants.FS || value == constants.GOOGLEDRIVEl )
|
|
276
279
|
this.storage = value;
|
|
277
280
|
else
|
|
@@ -279,14 +282,23 @@ class Cmd4Platform
|
|
|
279
282
|
|
|
280
283
|
break;
|
|
281
284
|
case constants.STORAGEPATH:
|
|
285
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
286
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
287
|
+
|
|
282
288
|
this.storagePath = value;
|
|
283
289
|
|
|
284
290
|
break;
|
|
285
291
|
case constants.FOLDER:
|
|
292
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
293
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
294
|
+
|
|
286
295
|
this.folder = value;
|
|
287
296
|
|
|
288
297
|
break;
|
|
289
298
|
case constants.KEYPATH:
|
|
299
|
+
this.log.warn( `Warning: ${ key } will soon been deprecated at the Platform level. It was always meant to just be a fakegato config option only.` );
|
|
300
|
+
this.log.warn( `This message will disappear when you have done so.` );
|
|
301
|
+
|
|
290
302
|
this.keyPath = value;
|
|
291
303
|
|
|
292
304
|
break;
|
|
@@ -297,7 +309,7 @@ class Cmd4Platform
|
|
|
297
309
|
case constants.CONSTANTS:
|
|
298
310
|
// Save the constants defined globally so the accessory
|
|
299
311
|
// can parse it.
|
|
300
|
-
this.
|
|
312
|
+
this.globalConstants = value;
|
|
301
313
|
|
|
302
314
|
break
|
|
303
315
|
case constants.PLATFORM:
|
|
@@ -122,10 +122,13 @@ class Cmd4PriorityPollingQueue
|
|
|
122
122
|
let storedValue = self.cmd4Storage.getStoredValueForIndex( accTypeEnumIndex );
|
|
123
123
|
callback( 0, storedValue );
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
if ( self.queue.queueType != constants.QUEUETYPE_WORM2 )
|
|
126
|
+
{
|
|
127
|
+
// When the value is returned, it will update homebridge
|
|
128
|
+
self.queue.highPriorityQueue.push( { [ constants.IS_SET_lv ]: false, [ constants.QUEUE_GET_IS_UPDATE_lv ]: true, [ constants.ACCESSORY_lv ]: self, [ constants.ACC_TYPE_ENUM_INDEX_lv ]: accTypeEnumIndex, [ constants.CHARACTERISTIC_STRING_lv ]: characteristicString, [ constants.TIMEOUT_lv ]: timeout, [ constants.STATE_CHANGE_RESPONSE_TIME_lv ]: null, [ constants.VALUE_lv ]: null, [ constants.CALLBACK_lv ]: callback } );
|
|
127
129
|
|
|
128
|
-
|
|
130
|
+
self.queue.processQueueFunc( HIGH_PRIORITY_GET, self.queue );
|
|
131
|
+
}
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
addLowPriorityGetPolledQueueEntry( accessory, accTypeEnumIndex, characteristicString, interval, timeout )
|
|
@@ -232,7 +235,9 @@ class Cmd4PriorityPollingQueue
|
|
|
232
235
|
} else // getValue failed
|
|
233
236
|
{
|
|
234
237
|
// High Priority Get failed. We need to keep trying (WoRm queue only )
|
|
235
|
-
if ( queue.queueType == constants.QUEUETYPE_WORM
|
|
238
|
+
if ( queue.queueType == constants.QUEUETYPE_WORM ||
|
|
239
|
+
queue.queueType == constants.QUEUETYPE_WORM2
|
|
240
|
+
)
|
|
236
241
|
queue.highPriorityQueue.push( entry );
|
|
237
242
|
|
|
238
243
|
queue.errorCountSinceLastGoodTransaction++;
|
|
@@ -798,7 +803,9 @@ class Cmd4PriorityPollingQueue
|
|
|
798
803
|
setTimeout( ( ) =>
|
|
799
804
|
{
|
|
800
805
|
if ( entryIndex == 0 && settings.cmd4Dbg )
|
|
801
|
-
if ( queue.queueType == constants.QUEUETYPE_WORM
|
|
806
|
+
if ( queue.queueType == constants.QUEUETYPE_WORM ||
|
|
807
|
+
queue.queueType == constants.QUEUETYPE_WORM2
|
|
808
|
+
)
|
|
802
809
|
entry.accessory.log.debug( `Started staggered kick off of ${ queue.lowPriorityQueue.length } polled characteristics for queue: "${ entry.accessory.queue.queueName }"` );
|
|
803
810
|
else
|
|
804
811
|
entry.accessory.log.debug( `Started staggered kick off of ${ queue.lowPriorityQueue.length } polled characteristics for "${ entry.accessory.displayName }"` );
|
|
@@ -810,7 +817,9 @@ class Cmd4PriorityPollingQueue
|
|
|
810
817
|
if ( entryIndex == queue.lowPriorityQueue.length -1 )
|
|
811
818
|
{
|
|
812
819
|
if ( settings.cmd4Dbg )
|
|
813
|
-
if ( queue.queueType == constants.QUEUETYPE_WORM
|
|
820
|
+
if ( queue.queueType == constants.QUEUETYPE_WORM ||
|
|
821
|
+
queue.queueType == constants.QUEUETYPE_WORM2
|
|
822
|
+
)
|
|
814
823
|
entry.accessory.log.debug( `All characteristics are now being polled for queue: "${ queue.queueName }"` );
|
|
815
824
|
else
|
|
816
825
|
entry.accessory.log.debug( `All characteristics are now being polled for "${ entry.accessory.displayName }"` );
|
|
@@ -853,6 +862,7 @@ class Cmd4PriorityPollingQueue
|
|
|
853
862
|
this.processQueueFunc = this.processSequentialQueue;
|
|
854
863
|
break;
|
|
855
864
|
case constants.QUEUETYPE_WORM:
|
|
865
|
+
case constants.QUEUETYPE_WORM2:
|
|
856
866
|
this.processQueueFunc = this.processWormQueue;
|
|
857
867
|
// When not in debug mode, do not echo errors for the WoRm queue
|
|
858
868
|
// as errors are handled through retries.
|
|
@@ -941,9 +951,10 @@ var parseAddQueueTypes = function ( log, entrys )
|
|
|
941
951
|
break;
|
|
942
952
|
case constants.QUEUETYPE:
|
|
943
953
|
if ( value != constants.QUEUETYPE_WORM &&
|
|
954
|
+
value != constants.QUEUETYPE_WORM2 &&
|
|
944
955
|
value != constants.QUEUETYPE_SEQUENTIAL )
|
|
945
956
|
{
|
|
946
|
-
throw new Error( `QueueType: ${ entry.queueType } is not valid at index: ${ entryIndex }. Expected: ${ constants.QUEUETYPE_WORM } or ${ constants.QUEUETYPE_SEQUENTIAL }` );
|
|
957
|
+
throw new Error( `QueueType: ${ entry.queueType } is not valid at index: ${ entryIndex }. Expected: ${ constants.QUEUETYPE_WORM }, ${ constants.QUEUETYPE_WORM2 } or ${ constants.QUEUETYPE_SEQUENTIAL }` );
|
|
947
958
|
}
|
|
948
959
|
|
|
949
960
|
queueType = value;
|
package/RUNNING_CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
## Homebridge UI User. Do not click on any inline links. Homebridge UI does not supprt them. Bug#1098
|
|
4
4
|
|
|
5
5
|
## ChangeLog
|
|
6
|
+
* <a href="#Whats-new-in-6-1-0">**Whats new in 6.1.0**</a>
|
|
7
|
+
* <a href="#Whats-new-in-6-0-4">**Whats new in 6.0.4**</a>
|
|
8
|
+
* <a href="#Whats-new-in-6-0-3">**Whats new in 6.0.3**</a>
|
|
9
|
+
* <a href="#Whats-new-in-6-0-2">**Whats new in 6.0.2**</a>
|
|
6
10
|
* <a href="#Whats-new-in-6-0-1">**Whats new in 6.0.1**</a>
|
|
7
11
|
* <a href="#Whats-new-in-6-0-0">**Whats new in 6.0.0**</a>
|
|
8
12
|
* <a href="#Whats-new-in-6-0-0-beta1">**Whats new in 6.0.0.beta1**</a>
|
|
@@ -76,6 +80,43 @@
|
|
|
76
80
|
* <a href="#Whats-new-in-2-1">**Whats new in 2.1**</a>
|
|
77
81
|
* <a href="#Whats-new-in-2-0">**Whats new in 2.0**</a>
|
|
78
82
|
|
|
83
|
+
<a name="Whats-new-in-6-1-0">## Whats new in 6.1.0</a>
|
|
84
|
+
### 6.1.0 (2022-01-30)
|
|
85
|
+
|
|
86
|
+
##### New Features
|
|
87
|
+
|
|
88
|
+
* See if WoRm2 Queue can resolve large scale AirCon accessories ([61b164ae](https://github.com/ztalbot2000/homebridge-cmd4/commit/61b164ae11ffb4731da0ac60bba51d7fbeefff94))
|
|
89
|
+
|
|
90
|
+
##### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* bug [#124](https://github.com/ztalbot2000/homebridge-cmd4/pull/124), Eve graph not being displayed ([929da3e3](https://github.com/ztalbot2000/homebridge-cmd4/commit/929da3e39548df645d316365ab1273d6b5ed250d))
|
|
93
|
+
* PROGRAM_SCHEDULED_MANUAL_MODE_ constant remove trailing underscore ([52e1fd3f](https://github.com/ztalbot2000/homebridge-cmd4/commit/52e1fd3f100e18588a171c96b8ef9f511180c1bd))
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
<a name="Whats-new-in-6-0-4">## Whats new in 6.0.4</a>
|
|
97
|
+
#### 6.0.4 (2021-12-31)
|
|
98
|
+
|
|
99
|
+
##### Bug Fixes
|
|
100
|
+
|
|
101
|
+
* Constants were not getting passed down to linked types ([b7252bf9](https://github.com/ztalbot2000/homebridge-cmd4/commit/b7252bf934e26535047008f343f4d6b627dd6ddb))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<a name="Whats-new-in-6-0-3">## Whats new in 6.0.3</a>
|
|
105
|
+
### 6.0.3 (2021-11-11)
|
|
106
|
+
|
|
107
|
+
##### Bug Fix
|
|
108
|
+
|
|
109
|
+
* Schema Prep for Homebridge-UI integration ([2c5df2c1](https://github.com/ztalbot2000/homebridge-cmd4/commit/2c5df2c1279ebe88fdaedbaa22ae0124e2841b6d))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<a name="Whats-new-in-6-0-2">## Whats new in 6.0.2</a>
|
|
113
|
+
### 6.0.2 (2021-11-10)
|
|
114
|
+
|
|
115
|
+
##### Bug Fix
|
|
116
|
+
|
|
117
|
+
* Schema Prep - For Homebridge-ui schema must have defined keys ([3053780b](https://github.com/ztalbot2000/homebridge-cmd4/commit/3053780b40eb3d4505dc407411257109977688a1))
|
|
118
|
+
|
|
119
|
+
|
|
79
120
|
<a name="Whats-new-in-6-0-1">## Whats new in 6.0.1</a>
|
|
80
121
|
#### 6.0.1 (2021-11-07)
|
|
81
122
|
|
package/cmd4Constants.js
CHANGED
|
@@ -81,6 +81,7 @@ var cmd4Constants = {
|
|
|
81
81
|
// Queue Types
|
|
82
82
|
QUEUETYPE_SEQUENTIAL: "Sequential",
|
|
83
83
|
QUEUETYPE_WORM: "WoRm",
|
|
84
|
+
QUEUETYPE_WORM2: "WoRm2",
|
|
84
85
|
// Used internally to mean only polled entries go straight through the queue
|
|
85
86
|
QUEUETYPE_STANDARD: "StandarD",
|
|
86
87
|
// Used internally to mean entries go straight through the queue
|
package/docs/Developers.md
CHANGED
|
@@ -453,7 +453,7 @@ The value "0" should be used for any characteristics value which is not possible
|
|
|
453
453
|
### Step 3. Install homebridge-cmd4 development dependencies
|
|
454
454
|
|
|
455
455
|
```bash
|
|
456
|
-
*SHELL*> npm install --
|
|
456
|
+
*SHELL*> npm install --dev
|
|
457
457
|
```
|
|
458
458
|
|
|
459
459
|
### Step 4. Run the provided test cases
|
|
@@ -2860,7 +2860,7 @@ module.exports =
|
|
|
2860
2860
|
Characteristic.ProgramMode.NO_PROGRAM_SCHEDULED,
|
|
2861
2861
|
"PROGRAM_SCHEDULED":
|
|
2862
2862
|
Characteristic.ProgramMode.PROGRAM_SCHEDULED,
|
|
2863
|
-
"
|
|
2863
|
+
"PROGRAM_SCHEDULED_MANUAL_MODE":
|
|
2864
2864
|
Characteristic.ProgramMode.PROGRAM_SCHEDULED_MANUAL_MODE_
|
|
2865
2865
|
}
|
|
2866
2866
|
},
|