iobroker.smartcontrol 1.2.1 → 1.3.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.
Files changed (50) hide show
  1. package/.github/ISSUE_TEMPLATE/BugReport.md +36 -36
  2. package/.github/ISSUE_TEMPLATE/Enhancement.md +19 -19
  3. package/.github/auto-merge.yml +17 -17
  4. package/.github/workflows/dependabot-auto-merge.yml +23 -22
  5. package/.github/workflows/test-and-release.yml +92 -129
  6. package/.releaseconfig.json +3 -0
  7. package/LICENSE +21 -21
  8. package/README.md +378 -406
  9. package/admin/admin.d.ts +1 -0
  10. package/admin/doc-md/img/liveInfo.png +0 -0
  11. package/admin/doc-md/info-text_de.md +1 -0
  12. package/admin/doc-md/info-text_en.md +1 -0
  13. package/admin/doc-md/readme.txt +6 -6
  14. package/admin/doc-md/start_de.md +124 -124
  15. package/admin/doc-md/start_en.md +126 -126
  16. package/admin/doc-md/table-conditions_de.md +10 -10
  17. package/admin/doc-md/table-conditions_en.md +10 -10
  18. package/admin/doc-md/table-execution_de.md +12 -12
  19. package/admin/doc-md/table-execution_en.md +12 -12
  20. package/admin/doc-md/table-target-devices_de.md +18 -18
  21. package/admin/doc-md/table-target-devices_en.md +21 -21
  22. package/admin/doc-md/table-target-enums_de.md +13 -13
  23. package/admin/doc-md/table-target-enums_en.md +15 -15
  24. package/admin/doc-md/table-target-url_de.md +29 -29
  25. package/admin/doc-md/table-target-url_en.md +27 -27
  26. package/admin/doc-md/table-trigger-devices_de.md +12 -12
  27. package/admin/doc-md/table-trigger-devices_en.md +10 -10
  28. package/admin/doc-md/table-trigger-motion_de.md +23 -23
  29. package/admin/doc-md/table-trigger-motion_en.md +24 -24
  30. package/admin/doc-md/table-trigger-times_de.md +13 -13
  31. package/admin/doc-md/table-trigger-times_en.md +11 -11
  32. package/admin/doc-md/table-zones_de.md +15 -14
  33. package/admin/doc-md/table-zones_en.md +15 -14
  34. package/admin/doc-md/table-zones_select-targets_de.md +18 -18
  35. package/admin/doc-md/table-zones_select-targets_en.md +18 -18
  36. package/admin/index_m.html +32 -14
  37. package/admin/index_m.js +31 -1
  38. package/admin/style.css +2 -0
  39. package/admin/zero-md/webcomponents-loader.min.js +8 -8
  40. package/admin/zero-md/zero-md.min.js.js +8 -8
  41. package/io-package.json +453 -449
  42. package/lib/adapter-config.d.ts +15 -15
  43. package/lib/constants.js +128 -128
  44. package/lib/helper.js +1069 -1069
  45. package/lib/tools.js +93 -93
  46. package/lib/trigger-class.js +964 -964
  47. package/main.js +3 -2
  48. package/main.test.js +30 -30
  49. package/package.json +73 -70
  50. package/.github/workflows/npmpublish.yml +0 -30
package/main.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * ioBroker Smart Control Adapter
4
4
  *
5
- * @github https://github.com/Mic-M/ioBroker.smartcontrol
5
+ * @github https://github.com/iobroker-community-adapters/ioBroker.smartcontrol
6
6
  * @forum https://forum.iobroker.net/topic/36728/
7
7
  * @author Mic-M <https://github.com/Mic-M/ioBroker.smartcontrol>
8
8
  * @license MIT
@@ -49,7 +49,8 @@ class SmartControl extends utils.Adapter {
49
49
  Trigger: require('./lib/trigger-class.js'), // Class for Triggers and Target devices handling
50
50
  mSuncalc: require('suncalc2'), // https://github.com/andiling/suncalc2
51
51
  mSchedule: require('node-schedule'), // https://github.com/node-schedule/node-schedule
52
- mGot: require('got'), // https://github.com/sindresorhus/got || This is a 'request' replacement due to https://nodesource.com/blog/express-going-into-maintenance-mode#alternativestorequest
52
+ //ToDo: need to be replaced by axios
53
+ mGot: require('@esm2cjs/got'), // https://github.com/sindresorhus/got || This is a 'request' replacement due to https://nodesource.com/blog/express-going-into-maintenance-mode#alternativestorequest
53
54
 
54
55
  // {object} timers - All timer objects.
55
56
  timersZoneOn: {}, // for option "onAfter" in Zones table
package/main.test.js CHANGED
@@ -1,30 +1,30 @@
1
- 'use strict';
2
-
3
- /**
4
- * This is a dummy TypeScript test file using chai and mocha
5
- *
6
- * It's automatically excluded from npm and its build output is excluded from both git and npm.
7
- * It is advised to test all your modules with accompanying *.test.js-files
8
- */
9
-
10
- // tslint:disable:no-unused-expression
11
-
12
- const { expect } = require('chai');
13
- // import { functionToTest } from "./moduleToTest";
14
-
15
- describe('module to test => function to test', () => {
16
- // initializing logic
17
- const expected = 5;
18
-
19
- it(`should return ${expected}`, () => {
20
- const result = 5;
21
- // assign result a value from functionToTest
22
- expect(result).to.equal(expected);
23
- // or using the should() syntax
24
- result.should.equal(expected);
25
- });
26
- // ... more tests => it
27
-
28
- });
29
-
30
- // ... more test suites => describe
1
+ 'use strict';
2
+
3
+ /**
4
+ * This is a dummy TypeScript test file using chai and mocha
5
+ *
6
+ * It's automatically excluded from npm and its build output is excluded from both git and npm.
7
+ * It is advised to test all your modules with accompanying *.test.js-files
8
+ */
9
+
10
+ // tslint:disable:no-unused-expression
11
+
12
+ const { expect } = require('chai');
13
+ // import { functionToTest } from "./moduleToTest";
14
+
15
+ describe('module to test => function to test', () => {
16
+ // initializing logic
17
+ const expected = 5;
18
+
19
+ it(`should return ${expected}`, () => {
20
+ const result = 5;
21
+ // assign result a value from functionToTest
22
+ expect(result).to.equal(expected);
23
+ // or using the should() syntax
24
+ result.should.equal(expected);
25
+ });
26
+ // ... more tests => it
27
+
28
+ });
29
+
30
+ // ... more test suites => describe
package/package.json CHANGED
@@ -1,70 +1,73 @@
1
- {
2
- "name": "iobroker.smartcontrol",
3
- "version": "1.2.1",
4
- "description": "Control devices smarter: by grouping, including triggers like motion, opening window, etc. and set target devices accordingly",
5
- "author": {
6
- "name": "Mic-M",
7
- "email": "iob.micm@gmail.com"
8
- },
9
- "homepage": "https://github.com/Mic-M/ioBroker.smartcontrol",
10
- "license": "MIT",
11
- "keywords": [
12
- "smart",
13
- "control",
14
- "rooms",
15
- "groups",
16
- "motion sensors",
17
- "devices",
18
- "switches",
19
- "lights",
20
- "trigger",
21
- "schedule"
22
- ],
23
- "repository": {
24
- "type": "git",
25
- "url": "https://github.com/Mic-M/ioBroker.smartcontrol"
26
- },
27
- "dependencies": {
28
- "@iobroker/adapter-core": "^2.4.0",
29
- "@types/jquery": "^3.5.4",
30
- "cheerio": "^1.0.0-rc.3",
31
- "got": "^11.8.0",
32
- "node-schedule": "^1.3.2",
33
- "suncalc2": "^1.8.1"
34
- },
35
- "devDependencies": {
36
- "@iobroker/testing": "^2.2.0",
37
- "@types/chai": "^4.2.14",
38
- "@types/chai-as-promised": "^7.1.3",
39
- "@types/gulp": "^4.0.7",
40
- "@types/mocha": "^8.0.4",
41
- "@types/node": "^14.14.7",
42
- "@types/proxyquire": "^1.3.28",
43
- "@types/sinon": "^9.0.8",
44
- "@types/sinon-chai": "^3.2.5",
45
- "axios": "^0.21.0",
46
- "chai": "^4.2.0",
47
- "chai-as-promised": "^7.1.1",
48
- "eslint": "^7.13.0",
49
- "got": "^11.8.0",
50
- "gulp": "^4.0.2",
51
- "mocha": "^8.2.1",
52
- "proxyquire": "^2.1.3",
53
- "sinon": "^9.2.1",
54
- "sinon-chai": "^3.5.0",
55
- "suncalc2": "^1.8.1"
56
- },
57
- "main": "main.js",
58
- "scripts": {
59
- "test:js": "mocha --opts test/mocha.custom.opts",
60
- "test:package": "mocha test/package --exit",
61
- "test:unit": "mocha test/unit --exit",
62
- "test:integration": "mocha test/integration --exit",
63
- "test": "npm run test:js && npm run test:package",
64
- "lint": "eslint"
65
- },
66
- "bugs": {
67
- "url": "https://github.com/Mic-M/ioBroker.smartcontrol/issues"
68
- },
69
- "readmeFilename": "README.md"
70
- }
1
+ {
2
+ "name": "iobroker.smartcontrol",
3
+ "version": "1.3.0",
4
+ "description": "Control devices smarter: by grouping, including triggers like motion, opening window, etc. and set target devices accordingly",
5
+ "author": {
6
+ "name": "Mic-M",
7
+ "email": "iob.micm@gmail.com"
8
+ },
9
+ "homepage": "https://github.com/iobroker-community-adapters/ioBroker.smartcontrol",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "smart",
13
+ "control",
14
+ "rooms",
15
+ "groups",
16
+ "motion sensors",
17
+ "devices",
18
+ "switches",
19
+ "lights",
20
+ "trigger",
21
+ "schedule"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/iobroker-community-adapters/ioBroker.smartcontrol"
26
+ },
27
+ "dependencies": {
28
+ "@esm2cjs/got": "^12.5.2",
29
+ "@iobroker/adapter-core": "^2.4.0",
30
+ "@types/jquery": "^3.5.14",
31
+ "cheerio": "^1.0.0-rc.12",
32
+ "node-schedule": "^2.1.0",
33
+ "suncalc2": "^1.8.1"
34
+ },
35
+ "devDependencies": {
36
+ "@alcalzone/release-script": "^3.5.9",
37
+ "@alcalzone/release-script-plugin-iobroker": "^3.5.9",
38
+ "@alcalzone/release-script-plugin-license": "^3.5.9",
39
+ "@alcalzone/release-script-plugin-manual-review": "^3.5.9",
40
+ "@iobroker/testing": "^4.1.0",
41
+ "@types/chai": "^4.3.1",
42
+ "@types/chai-as-promised": "^7.1.3",
43
+ "@types/gulp": "^4.0.9",
44
+ "@types/mocha": "^9.1.1",
45
+ "@types/node": "^18.7.23",
46
+ "@types/proxyquire": "^1.3.28",
47
+ "@types/sinon": "^10.0.11",
48
+ "@types/sinon-chai": "^3.2.5",
49
+ "axios": "^0.27.2",
50
+ "chai": "^4.3.6",
51
+ "chai-as-promised": "^7.1.1",
52
+ "eslint": "^8.24.0",
53
+ "gulp": "^4.0.2",
54
+ "mocha": "^10.0.0",
55
+ "proxyquire": "^2.1.3",
56
+ "sinon": "^9.2.4",
57
+ "sinon-chai": "^3.7.0"
58
+ },
59
+ "main": "main.js",
60
+ "scripts": {
61
+ "test:js": "mocha --opts test/mocha.custom.opts",
62
+ "test:package": "mocha test/package --exit",
63
+ "test:unit": "mocha test/unit --exit",
64
+ "test:integration": "mocha test/integration --exit",
65
+ "test": "npm run test:js && npm run test:package",
66
+ "lint": "eslint",
67
+ "release": "release-script"
68
+ },
69
+ "bugs": {
70
+ "url": "https://github.com/iobroker-community-adapters/ioBroker.smartcontrol/issues"
71
+ },
72
+ "readmeFilename": "README.md"
73
+ }
@@ -1,30 +0,0 @@
1
- name: Publish
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v1
12
- - uses: actions/setup-node@v1
13
- with:
14
- node-version: 12
15
- - run: npm i
16
- - run: npm test
17
-
18
- publish-npm:
19
- needs: build
20
- runs-on: ubuntu-latest
21
- steps:
22
- - uses: actions/checkout@v1
23
- - uses: actions/setup-node@v1
24
- with:
25
- node-version: 12
26
- registry-url: https://registry.npmjs.org/
27
- - run: npm i
28
- - run: npm publish
29
- env:
30
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}