homebridge-cmd4 8.0.6 → 8.0.7
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 +16 -2
- package/Cmd4Accessory.js +3 -2
- package/Extras/config.json +1 -1
- package/Extras/config.min.json +1 -1
- package/RUNNING_CHANGELOG.md +23 -0
- package/eslint.config.mjs +60 -0
- package/lib/CMD4_ACC_TYPE_ENUM.js +9 -5
- package/lib/CMD4_ACC_TYPE_ENUM.js.2.0.1 +5665 -0
- package/package.json +18 -15
- package/package.json.1 +120 -0
- package/postinstall.js +7 -26
- package/utils/Cmd4Storage.js +1 -1
- package/utils/isJSON.js +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-cmd4",
|
|
3
3
|
"description": "Exec Plugin for Homebridge supporting all accessorys and characteristics",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "John Talbot"
|
|
@@ -21,23 +21,27 @@
|
|
|
21
21
|
"command-exists": "^1.2.9",
|
|
22
22
|
"fakegato-history": ">=0.6.5",
|
|
23
23
|
"jwa": "^2.0.1",
|
|
24
|
-
"latest-version": "^
|
|
24
|
+
"latest-version": "^9.0.0",
|
|
25
25
|
"moment": "*"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@commitlint/cli": "^
|
|
29
|
-
"@commitlint/config-conventional": "^
|
|
28
|
+
"@commitlint/cli": "^21.2.4",
|
|
29
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
30
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
31
|
+
"@eslint/js": "^10.0.1",
|
|
30
32
|
"chai": "^4.2.0",
|
|
31
33
|
"commander": "^8.2.0",
|
|
32
|
-
"commitlint-plugin-function-rules": "^
|
|
33
|
-
"eslint": "^
|
|
34
|
+
"commitlint-plugin-function-rules": "^5.0.1",
|
|
35
|
+
"eslint": "^10.15.0",
|
|
34
36
|
"generate-changelog": "^1.8.0",
|
|
37
|
+
"globals": "^17.14.0",
|
|
35
38
|
"husky": "^4.3.8",
|
|
36
39
|
"link-checker": "^1.4.2",
|
|
37
40
|
"markdown-link-check": "^3.8.6",
|
|
38
41
|
"mocha": "^8.0.1",
|
|
39
42
|
"node-persist": "^0.0.11",
|
|
40
|
-
"
|
|
43
|
+
"jsonparse": "^1.3.1",
|
|
44
|
+
"sinon": "^22.1.0",
|
|
41
45
|
"which": "^2.0.2"
|
|
42
46
|
},
|
|
43
47
|
"directories": {
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"docs": "docs"
|
|
48
52
|
},
|
|
49
53
|
"engines": {
|
|
50
|
-
"node": "^18.20.4 || ^20.18.0 || ^22.10.0 || ^24.0.0",
|
|
54
|
+
"node": "^18.20.4 || ^20.18.0 || ^22.10.0 || ^24.15.0 || ^26.13.0",
|
|
51
55
|
"homebridge": "^1.8.0 || ^2.0.0"
|
|
52
56
|
},
|
|
53
57
|
"keywords": [
|
|
@@ -77,18 +81,17 @@
|
|
|
77
81
|
"scripts": {
|
|
78
82
|
"debug": "DEBUG=* homebridge --debug --plugin-path .",
|
|
79
83
|
"pretest": "printf ' test is only done in a development environment\n';sleep 2 ",
|
|
80
|
-
"testDebug": "
|
|
81
|
-
"test": "
|
|
82
|
-
"singleTest": "
|
|
83
|
-
"allTests": "
|
|
84
|
-
"sanityTests": "
|
|
84
|
+
"testDebug": "mocha --require async-dump.js --file test/mocha-setup --ignore test/versionChecker.js",
|
|
85
|
+
"test": "mocha --file test/mocha-setup",
|
|
86
|
+
"singleTest": "mocha --bail --file test/mocha-setup",
|
|
87
|
+
"allTests": "mocha --bail --file test/mocha-setup $( cat test/allTests )",
|
|
88
|
+
"sanityTests": "mocha --bail --file test/mocha-setup $( cat test/sanityTests )",
|
|
85
89
|
"_Note0": "Excluded from commit as may fail for probing GitHub to much",
|
|
86
90
|
"testMarkDown": "markdown-link-check ./README.md && markdown-link-check ./CHANGELOG.md && markdown-link-check ./docs/AdvancedTroubleShooting.md && markdown-link-check ./docs/Developers.md",
|
|
87
91
|
"testAutoGeneratedDocLinks": "link-checker docs/autoGenerated/CMD4_AccessoryDescriptions.html",
|
|
88
92
|
"commitTests": "npm run test && npm run testMarkDown",
|
|
89
93
|
"_Note": "Excluded only because they sometimes fail, but pass alone. ",
|
|
90
|
-
"testCmd4Accessory": "
|
|
91
|
-
"testVersionChecker": "node_modules/.bin/mocha --file test/mocha-setup test/versionChecker.js",
|
|
94
|
+
"testCmd4Accessory": "mocha --file test/mocha-setup test/Cmd4Accessory.js",
|
|
92
95
|
"lint": "eslint --ext .js *.js utils/*.js lib/*.js tools/* test/*.js",
|
|
93
96
|
"postinstall": "node postinstall.js",
|
|
94
97
|
"_Note01": "Auto change the version based on the commit history. ",
|
package/package.json.1
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "homebridge-cmd4",
|
|
3
|
+
"description": "Exec Plugin for Homebridge supporting all accessorys and characteristics",
|
|
4
|
+
"version": "8.0.6",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "John Talbot"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git://github.com/ztalbot2000/homebridge-cmd4.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/ztalbot2000/homebridge-cmd4#readme",
|
|
14
|
+
"changelog": "https://github.com/ztalbot2000/homebridge-cmd4/blob/master/ChangeLog.md",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/ztalbot2000/homebridge-cmd4/issues",
|
|
17
|
+
"email": "ztalbot2000@gmail.com"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"chalk": "^4.1.0",
|
|
21
|
+
"command-exists": "^1.2.9",
|
|
22
|
+
"fakegato-history": ">=0.6.5",
|
|
23
|
+
"jwa": "^2.0.1",
|
|
24
|
+
"latest-version": "^9.0.0",
|
|
25
|
+
"moment": "*"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@commitlint/cli": "^21.2.4",
|
|
29
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
30
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
31
|
+
"@eslint/js": "^10.0.1",
|
|
32
|
+
"chai": "^4.2.0",
|
|
33
|
+
"commander": "^8.2.0",
|
|
34
|
+
"commitlint-plugin-function-rules": "^1.1.20",
|
|
35
|
+
"eslint": "^10.15.0",
|
|
36
|
+
"generate-changelog": "^1.8.0",
|
|
37
|
+
"globals": "^17.14.0",
|
|
38
|
+
"husky": "^4.3.8",
|
|
39
|
+
"link-checker": "^1.4.2",
|
|
40
|
+
"markdown-link-check": "^3.8.6",
|
|
41
|
+
"glob": "^14.0.6",
|
|
42
|
+
"mocha": "^12.0.3",
|
|
43
|
+
"node-persist": "^0.0.11",
|
|
44
|
+
"sinon": "^22.1.0",
|
|
45
|
+
"which": "^2.0.2"
|
|
46
|
+
},
|
|
47
|
+
"directories": {
|
|
48
|
+
"test": "test",
|
|
49
|
+
"lib": "lib",
|
|
50
|
+
"utils": "utils",
|
|
51
|
+
"docs": "docs"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": "^18.20.4 || ^20.18.0 || ^22.10.0 || ^24.15.0 || ^26.13.0",
|
|
55
|
+
"homebridge": "^1.8.0 || ^2.0.0"
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"homebridge-plugin",
|
|
59
|
+
"homebridge",
|
|
60
|
+
"exec",
|
|
61
|
+
"command",
|
|
62
|
+
"switch",
|
|
63
|
+
"light",
|
|
64
|
+
"door",
|
|
65
|
+
"thermostat",
|
|
66
|
+
"security",
|
|
67
|
+
"temperature",
|
|
68
|
+
"virtual",
|
|
69
|
+
"Eve",
|
|
70
|
+
"Homekit",
|
|
71
|
+
"siri",
|
|
72
|
+
"home",
|
|
73
|
+
"Eve"
|
|
74
|
+
],
|
|
75
|
+
"husky": {
|
|
76
|
+
"hooks": {
|
|
77
|
+
"pre-commit": "npm run lint && npm run test test/cmd4Constants",
|
|
78
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"debug": "DEBUG=* homebridge --debug --plugin-path .",
|
|
83
|
+
"pretest": "printf ' test is only done in a development environment\n';sleep 2 ",
|
|
84
|
+
"testDebug": "mocha --require async-dump.js --file test/mocha-setup --ignore test/versionChecker.js",
|
|
85
|
+
"test": "mocha --file test/mocha-setup",
|
|
86
|
+
"singleTest": "mocha --bail --file test/mocha-setup",
|
|
87
|
+
"allTests": "mocha --bail --file test/mocha-setup $( cat test/allTests )",
|
|
88
|
+
"sanityTests": "mocha --bail --file test/mocha-setup $( cat test/sanityTests )",
|
|
89
|
+
"_Note0": "Excluded from commit as may fail for probing GitHub to much",
|
|
90
|
+
"testMarkDown": "markdown-link-check ./README.md && markdown-link-check ./CHANGELOG.md && markdown-link-check ./docs/AdvancedTroubleShooting.md && markdown-link-check ./docs/Developers.md",
|
|
91
|
+
"testAutoGeneratedDocLinks": "link-checker docs/autoGenerated/CMD4_AccessoryDescriptions.html",
|
|
92
|
+
"commitTests": "npm run test && npm run testMarkDown",
|
|
93
|
+
"_Note": "Excluded only because they sometimes fail, but pass alone. ",
|
|
94
|
+
"testCmd4Accessory": "mocha --file test/mocha-setup test/Cmd4Accessory.js",
|
|
95
|
+
"lint": "eslint --ext .js *.js utils/*.js lib/*.js tools/* test/*.js",
|
|
96
|
+
"postinstall": "node postinstall.js",
|
|
97
|
+
"_Note01": "Auto change the version based on the commit history. ",
|
|
98
|
+
"_Note02": "Where: ",
|
|
99
|
+
"_Note03": "To trigger a version update ",
|
|
100
|
+
"_Note04": " npm run release ",
|
|
101
|
+
"_Note05": " ",
|
|
102
|
+
"_Note06": "To trigger a patch update (1.0.0 → 1.0.1) ",
|
|
103
|
+
"_Note07": " git commit -m 'fix: …' ",
|
|
104
|
+
"_Note08": "To trigger a minor update (1.0.0 → 1.1.0) ",
|
|
105
|
+
"_Note09": " git commit -m 'feat: …' ",
|
|
106
|
+
"_Note10": "To trigger a major update (1.0.0 → 2.0.0) ",
|
|
107
|
+
"_Note11": " A BREAKING CHANGE: in the commit body ",
|
|
108
|
+
"_Note12": " ",
|
|
109
|
+
"_Note13": "As a summary, generate-changelog will do ",
|
|
110
|
+
"_Note14": " * Bumps the version in package.json ",
|
|
111
|
+
"_Note15": " * Updates CHANGELOG.md ",
|
|
112
|
+
"_Note16": " ",
|
|
113
|
+
"release": "tools/generateChangeLog",
|
|
114
|
+
"_Note17": " ",
|
|
115
|
+
"_Note18": "Overide default behaviour with: ",
|
|
116
|
+
"release:patch": "tools/generateChangeLog --type patch --cleanup",
|
|
117
|
+
"release:minor": "tools/generateChangeLog --type minor --cleanup",
|
|
118
|
+
"release:major": "tools/generateChangeLog --type major --cleanup"
|
|
119
|
+
}
|
|
120
|
+
}
|
package/postinstall.js
CHANGED
|
@@ -4,32 +4,13 @@
|
|
|
4
4
|
// Fun colour stuff
|
|
5
5
|
const chalk = require( "chalk" );
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
console.log( chalk.yellow( `HomeBridge-Cmd4 Important Notice:\n` ) );
|
|
8
|
+
console.log( chalk.red( `* ` ) + `Demo mode is available by not defining any polling.\n` );
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
console.log( chalk.underline( `Cmd4 New Users` ) );
|
|
11
|
+
console.log( chalk.green( `* ` ) + `You will need to follow the README to continue the configuration of HomeBridge-CMD4.\n` );
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
(
|
|
13
|
-
|
|
14
|
-
// Wait for the Promise of isUpgrade to complete.
|
|
15
|
-
let lv = await isUpgrade( );
|
|
16
|
-
|
|
17
|
-
if ( lv == true )
|
|
18
|
-
{
|
|
19
|
-
console.log( chalk.green( `[UPDATE AVAILABLE] ` ) + `Version ${lv} of ${myPkg.name} is available. Any release notes can be found here: ` + chalk.underline( `${myPkg.changelog}` ) );
|
|
20
|
-
}
|
|
21
|
-
console.log( chalk.yellow( `HomeBridge-Cmd4 5.0.0+ Important Notice:\n` ) );
|
|
22
|
-
console.log( `Cmd4 has been optimized for simplification and best practices. Its configuration has changed to what is recommended by Homebridge. See https://git.io/JtMGR.\n` );
|
|
23
|
-
console.log( `Gone are the are the very confusing Cmd4_Mode and RestartRecovery. The only changes you will see are the warnings that these options are no longer required.` );
|
|
24
|
-
console.log( chalk.red( `* ` ) + `RestartRecovery is now automatic; which not enabling could cause your device to turn on/off over a restart.` );
|
|
25
|
-
console.log( chalk.red( `* ` ) + `Cmd4_Mode is as per https://git.io/JtMGR where the callback is immediate to homebridge with the data from your device to follow.` );
|
|
26
|
-
console.log( chalk.red( `* ` ) + `Demo mode is still available by not defining any polling.\n` );
|
|
27
|
-
|
|
28
|
-
console.log( chalk.underline( `Cmd4 New Users` ) );
|
|
29
|
-
console.log( chalk.green( `* ` ) + `You will need to follow the README to continue the configuration of HomeBridge-CMD4.\n` );
|
|
30
|
-
|
|
31
|
-
console.log(`\n As always, if you like this plugin, don't forget to star it on GitHub.\n`);
|
|
32
|
-
console.log(`\n Enjoy`);
|
|
33
|
-
console.log(` John Talbot\n`);
|
|
34
|
-
})( );
|
|
13
|
+
console.log(`\n As always, if you like this plugin, don't forget to star it on GitHub.\n`);
|
|
14
|
+
console.log(`\n Enjoy`);
|
|
15
|
+
console.log(` John Talbot\n`);
|
|
35
16
|
|
package/utils/Cmd4Storage.js
CHANGED
|
@@ -64,7 +64,7 @@ class Cmd4Storage
|
|
|
64
64
|
// This version goes from 1-123 and changes to
|
|
65
65
|
// Assoc array so that index changes like this will no longer
|
|
66
66
|
// impact the storage schema as much
|
|
67
|
-
let i
|
|
67
|
+
let i;
|
|
68
68
|
for ( i=0; i < CMD4_ACC_TYPE_ENUM.ListPairings; i++ )
|
|
69
69
|
{
|
|
70
70
|
data[ i ] = fromData[ i ];
|
package/utils/isJSON.js
CHANGED
|
@@ -29,12 +29,12 @@ function isJSON( m )
|
|
|
29
29
|
if ( typeof m == "object" )
|
|
30
30
|
{
|
|
31
31
|
try{ m = JSON.stringify( m ); }
|
|
32
|
-
catch
|
|
32
|
+
catch { return false; } }
|
|
33
33
|
|
|
34
34
|
if ( typeof m == "string")
|
|
35
35
|
{
|
|
36
36
|
try{ m = JSON.parse( m ); }
|
|
37
|
-
catch
|
|
37
|
+
catch { return false; } }
|
|
38
38
|
|
|
39
39
|
if ( typeof m != "object") { return false; }
|
|
40
40
|
|