iobroker.zigbee 1.7.5 → 1.8.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/LICENSE +1 -1
  2. package/README.md +22 -29
  3. package/admin/admin.js +494 -469
  4. package/admin/i18n/de/translations.json +108 -0
  5. package/admin/i18n/en/translations.json +108 -0
  6. package/admin/i18n/es/translations.json +102 -0
  7. package/admin/i18n/fr/translations.json +108 -0
  8. package/admin/i18n/it/translations.json +102 -0
  9. package/admin/i18n/nl/translations.json +108 -0
  10. package/admin/i18n/pl/translations.json +108 -0
  11. package/admin/i18n/pt/translations.json +102 -0
  12. package/admin/i18n/ru/translations.json +108 -0
  13. package/admin/i18n/uk/translations.json +108 -0
  14. package/admin/i18n/zh-cn/translations.json +102 -0
  15. package/admin/index_m.html +1 -1
  16. package/admin/tab_m.html +44 -3
  17. package/admin/words.js +107 -108
  18. package/io-package.json +326 -357
  19. package/lib/backup.js +2 -2
  20. package/lib/binding.js +23 -24
  21. package/lib/colors.js +16 -14
  22. package/lib/commands.js +89 -82
  23. package/lib/developer.js +6 -7
  24. package/lib/devices.js +145 -154
  25. package/lib/exclude.js +30 -36
  26. package/lib/exposes.js +106 -111
  27. package/lib/groups.js +53 -54
  28. package/lib/json.js +3 -4
  29. package/lib/networkmap.js +2 -2
  30. package/lib/ota.js +23 -15
  31. package/lib/rgb.js +47 -44
  32. package/lib/seriallist.js +21 -10
  33. package/lib/states.js +488 -498
  34. package/lib/statescontroller.js +170 -164
  35. package/lib/utils.js +22 -21
  36. package/lib/zbBaseExtension.js +4 -4
  37. package/lib/zbDelayedAction.js +5 -13
  38. package/lib/zbDeviceAvailability.js +47 -44
  39. package/lib/zbDeviceConfigure.js +18 -23
  40. package/lib/zbDeviceEvent.js +3 -4
  41. package/lib/zigbeecontroller.js +97 -100
  42. package/main.js +149 -133
  43. package/package.json +33 -19
  44. package/.eslintignore +0 -2
  45. package/.eslintrc.json +0 -37
  46. package/.github/FUNDING.yml +0 -3
  47. package/.github/stale.yml +0 -13
  48. package/.github/workflows/test-and-release.yml +0 -151
  49. package/.travis/wiki.sh +0 -28
  50. package/admin/adapter-settings.js +0 -244
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee",
3
- "version": "1.7.5",
3
+ "version": "1.8.0",
4
4
  "author": {
5
5
  "name": "Kirov Ilya",
6
6
  "email": "kirovilya@gmail.com"
@@ -17,28 +17,33 @@
17
17
  "engines": {
18
18
  "node": ">=10"
19
19
  },
20
+ "optionalDependencies": {
21
+ "serialport": "^10.5.0"
22
+ },
20
23
  "dependencies": {
21
- "zigbee-herdsman": "0.14.34",
22
- "zigbee-herdsman-converters": "14.0.531",
23
- "@iobroker/adapter-core": "^2.4.0",
24
- "tar": "^6.0.5",
25
- "typescript": "^4.0.5"
24
+ "zigbee-herdsman": "0.14.76",
25
+ "zigbee-herdsman-converters": "14.0.676",
26
+ "@iobroker/adapter-core": "^2.6.7",
27
+ "tar": "^6.1.12",
28
+ "typescript": "^4.9.3"
26
29
  },
27
30
  "description": "Zigbee devices",
28
31
  "devDependencies": {
29
- "@alcalzone/release-script": "~3.4.2",
30
- "@iobroker/testing": "^2.5.4",
31
- "axios": "^0.21.1",
32
- "mixin-deep": "^1.3.2",
33
- "eslint": "^7.18.0",
34
- "eslint-config-google": "*",
35
- "lint-diff": "*",
36
- "chai": "^4.3.4",
32
+ "@alcalzone/release-script": "^3.5.9",
33
+ "@alcalzone/release-script-plugin-iobroker": "^3.5.9",
34
+ "@alcalzone/release-script-plugin-license": "^3.5.9",
35
+ "@iobroker/testing": "^4.1.0",
36
+ "axios": "^1.2.0",
37
+ "mixin-deep": "^2.0.1",
38
+ "eslint": "^8.28.0",
39
+ "eslint-config-prettier": "^8.5.0",
40
+ "eslint-plugin-prettier": "^4.2.1",
41
+ "chai": "^4.3.7",
37
42
  "chai-as-promised": "^7.1.1",
38
43
  "gulp": "^4.0.2",
39
44
  "gulp-jsdoc3": "^3.0.0",
40
45
  "gulp-replace": "^1.1.3",
41
- "mocha": "^9.1.3"
46
+ "mocha": "^10.1.0"
42
47
  },
43
48
  "homepage": "https://github.com/ioBroker/ioBroker.zigbee",
44
49
  "keywords": [
@@ -56,7 +61,15 @@
56
61
  ],
57
62
  "license": "MIT",
58
63
  "main": "main.js",
59
- "optionalDependencies": {},
64
+ "files": [
65
+ "admin/",
66
+ "lib/",
67
+ "docs/",
68
+ "support/",
69
+ "io-package.json",
70
+ "LICENSE",
71
+ "main.js"
72
+ ],
60
73
  "readmeFilename": "README.md",
61
74
  "repository": {
62
75
  "type": "git",
@@ -70,8 +83,9 @@
70
83
  "test:integration": "mocha test/integration --exit",
71
84
  "watch:parcel": "parcel admin/src/index.tsx -d admin/build --hmr-port 1235",
72
85
  "test:js": "mocha --opts test/mocha.custom.opts",
73
- "lint": "npm run lint:js",
74
- "lint:js": "eslint",
75
- "release": "release-script"
86
+ "release": "release-script",
87
+ "release-patch": "release-script patch --yes --no-update-lockfile",
88
+ "release-minor": "release-script minor --yes --no-update-lockfile",
89
+ "release-major": "release-script major --yes --no-update-lockfile"
76
90
  }
77
91
  }
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- node_modules/*
2
- test/*
package/.eslintrc.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "env": {
3
- "es6": true,
4
- "node": true,
5
- "mocha": true
6
- },
7
- "extends": "eslint:recommended",
8
- "rules": {
9
- "indent": [
10
- "error",
11
- 4,
12
- {
13
- "SwitchCase": 1
14
- }
15
- ],
16
- "linebreak-style": 0,
17
- "no-console": "off",
18
- "no-var": "error",
19
- "prefer-const": "error",
20
- "quotes": [
21
- "error",
22
- "single",
23
- {
24
- "avoidEscape": true,
25
- "allowTemplateLiterals": true
26
- }
27
- ],
28
- "semi": [
29
- "error",
30
- "always"
31
- ],
32
- "no-prototype-builtins": "off"
33
- },
34
- "parserOptions": {
35
- "ecmaVersion": 2019
36
- }
37
- }
@@ -1,3 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- custom: ['https://www.paypal.me/goofyk', 'https://paypal.me/ArthurRupp']
package/.github/stale.yml DELETED
@@ -1,13 +0,0 @@
1
- # Number of days of inactivity before an issue becomes stale
2
- daysUntilStale: 60
3
- # Number of days of inactivity before a stale issue is closed
4
- daysUntilClose: 7
5
- # Label to use when marking an issue as stale
6
- staleLabel: stale
7
- # Comment to post when marking an issue as stale. Set to `false` to disable
8
- markComment: >
9
- This issue has been automatically marked as stale because it has not had
10
- recent activity. It will be closed if no further activity occurs. Thank you
11
- for your contributions.
12
- # Comment to post when closing a stale issue. Set to `false` to disable
13
- closeComment: false
@@ -1,151 +0,0 @@
1
- name: Test and Release
2
-
3
- # Run this job on all pushes and pull requests
4
- # as well as tags with a semantic version
5
- on:
6
- push:
7
- branches:
8
- - "*"
9
- tags:
10
- # normal versions
11
- - "v[0-9]+.[0-9]+.[0-9]+"
12
- # pre-releases
13
- - "v[0-9]+.[0-9]+.[0-9]+-**"
14
- pull_request: {}
15
-
16
- jobs:
17
- # Performs quick checks before the expensive test runs
18
- check-and-lint:
19
- if: contains(github.event.head_commit.message, '[skip ci]') == false
20
-
21
- runs-on: ubuntu-latest
22
-
23
- strategy:
24
- matrix:
25
- node-version: [14.x]
26
-
27
- steps:
28
- - name: Checkout code
29
- uses: actions/checkout@v2
30
-
31
- - name: Use Node.js ${{ matrix.node-version }}
32
- uses: actions/setup-node@v1
33
- with:
34
- node-version: ${{ matrix.node-version }}
35
-
36
- - name: Install Dependencies
37
- run: npm ci
38
-
39
- - name: Lint source code
40
- run: npm run lint
41
- - name: Test package files
42
- run: npm run test:package
43
-
44
- # Runs adapter tests on all supported node versions and OSes
45
- adapter-tests:
46
- if: contains(github.event.head_commit.message, '[skip ci]') == false
47
-
48
- needs: [check-and-lint]
49
-
50
- runs-on: ${{ matrix.os }}
51
- strategy:
52
- matrix:
53
- node-version: [12.x, 14.x, 16.x]
54
- os: [ubuntu-latest, macos-latest]
55
-
56
- steps:
57
- - name: Checkout code
58
- uses: actions/checkout@v2
59
-
60
- - name: Use Node.js ${{ matrix.node-version }}
61
- uses: actions/setup-node@v1
62
- with:
63
- node-version: ${{ matrix.node-version }}
64
-
65
- - name: Install Dependencies
66
- run: npm ci
67
-
68
- - name: Run unit tests
69
- run: npm run test:unit
70
-
71
- - name: Run integration tests (unix only)
72
- if: startsWith(runner.OS, 'windows') == false
73
- run: DEBUG=testing:* npm run test:integration
74
-
75
- - name: Run integration tests (windows only)
76
- if: startsWith(runner.OS, 'windows')
77
- run: set DEBUG=testing:* & npm run test:integration
78
-
79
- # Deploys the final package to NPM
80
- deploy:
81
- needs: [adapter-tests]
82
-
83
- # Trigger this step only when a commit on any branch is tagged with a version number
84
- if: |
85
- contains(github.event.head_commit.message, '[skip ci]') == false &&
86
- github.event_name == 'push' &&
87
- startsWith(github.ref, 'refs/tags/v')
88
-
89
- runs-on: ubuntu-latest
90
- strategy:
91
- matrix:
92
- node-version: [14.x]
93
-
94
- steps:
95
- - name: Checkout code
96
- uses: actions/checkout@v2
97
-
98
- - name: Use Node.js ${{ matrix.node-version }}
99
- uses: actions/setup-node@v1
100
- with:
101
- node-version: ${{ matrix.node-version }}
102
-
103
- - name: Extract the version and commit body from the tag
104
- id: extract_release
105
- # The body may be multiline, therefore newlines and % need to be escaped
106
- run: |
107
- VERSION="${{ github.ref }}"
108
- VERSION=${VERSION##*/v}
109
- echo "::set-output name=VERSION::$VERSION"
110
- BODY=$(git show -s --format=%b)
111
- BODY="${BODY//'%'/'%25'}"
112
- BODY="${BODY//$'\n'/'%0A'}"
113
- BODY="${BODY//$'\r'/'%0D'}"
114
- echo "::set-output name=BODY::$BODY"
115
-
116
- # If you like, activate automated version publish to NPM
117
- # Only if commit contains a version, see : https://github.com/AlCalzone/release-script
118
-
119
- - name: Publish package to npm
120
- run: |
121
- npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
122
- npm whoami
123
- npm publish
124
-
125
- # - name: Create Github Release
126
- # uses: actions/create-release@v1
127
- # env:
128
- # GITHUB_TOKEN: ${{ secrets.Github_Token}}
129
- # with:
130
- # tag_name: ${{ github.ref }}
131
- # release_name: Release v${{ steps.extract_release.outputs.VERSION }}
132
- # draft: false
133
- # # Prerelease versions create prereleases on Github
134
- # prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }}
135
- # body: ${{ steps.extract_release.outputs.BODY }}
136
- #
137
- # - name: Notify Sentry.io about the release
138
- # run: |
139
- # npm i -g @sentry/cli
140
- # export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
141
- # export SENTRY_URL=https://sentry.iobroker.net
142
- # export SENTRY_ORG=iobroker
143
- # export SENTRY_PROJECT=iobroker-zigbee
144
- # export SENTRY_VERSION=iobroker.zigbee@${{ steps.extract_release.outputs.VERSION }}
145
- # sentry-cli releases new $SENTRY_VERSION
146
- # sentry-cli releases finalize $SENTRY_VERSION
147
- # # Add the following line BEFORE finalize if repositories are connected in Sentry
148
- # # sentry-cli releases set-commits $SENTRY_VERSION --auto
149
- #
150
- # # Add the following line BEFORE finalize if sourcemap uploads are needed
151
- # # sentry-cli releases files $SENTRY_VERSION upload-sourcemaps build/
package/.travis/wiki.sh DELETED
@@ -1,28 +0,0 @@
1
- #!/bin/sh -e
2
-
3
- setup_git() {
4
- git config --global user.email "travis@travis-ci.org"
5
- git config --global user.name "Travis CI"
6
- }
7
-
8
- update_wiki() {
9
- rm -rf ioBroker.zigbee.wiki
10
- git clone https://${GH_TOKEN}@github.com/ioBroker/ioBroker.zigbee.wiki.git
11
- npm run docgen ioBroker.zigbee.wiki
12
- cd ioBroker.zigbee.wiki
13
- git add -A
14
- git diff-index --quiet HEAD || git commit -m "Travis CI: update wiki"
15
- git push origin
16
- cd ..
17
- rm -rf ioBroker.zigbee.wiki
18
- }
19
-
20
- # Only update wiki if on master branch and not pull request
21
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]
22
- then
23
- echo "Updating wiki!"
24
- setup_git
25
- update_wiki
26
- else
27
- echo "Not updating wiki, triggered by pull request or not on master branch"
28
- fi
@@ -1,244 +0,0 @@
1
- /*global $, location, socket, document, window, io, alert, load, systemDictionary, systemLang, translateAll*/
2
- const path = location.pathname;
3
- const parts = path.split('/');
4
- parts.splice(-3);
5
-
6
- const socket = io.connect('/', { path: parts.join('/') + '/socket.io' });
7
- var query = (window.location.search || '').replace(/^\?/, '').replace(/#.*$/, '');
8
- var args = {};
9
- let theme = null;
10
-
11
- // parse parameters
12
- query.trim().split('&').filter(function (t) { return t.trim(); }).forEach(function (b, i) {
13
- const parts = b.split('=');
14
- if (!i && parts.length === 1 && !isNaN(parseInt(b, 10))) {
15
- args.instance = parseInt(b, 10);
16
- }
17
- var name = parts[0];
18
- args[name] = parts.length === 2 ? parts[1] : true;
19
-
20
- if (name === 'instance') {
21
- args.instance = parseInt(args.instance, 10) || 0;
22
- }
23
-
24
- if (args[name] === 'true') {
25
- args[name] = true;
26
- } else if (args[name] === 'false') {
27
- args[name] = false;
28
- }
29
- });
30
-
31
- var instance = args.instance;
32
-
33
- let common = null; // common information of adapter
34
- const host = null; // host object on which the adapter runs
35
- const changed = false;
36
- let systemConfig;
37
- let certs = [];
38
- let adapter = '';
39
- const onChangeSupported = false;
40
-
41
- const tmp = window.location.pathname.split('/');
42
- adapter = tmp[tmp.length - 2];
43
- const _adapterInstance = 'system.adapter.' + adapter + '.' + instance;
44
-
45
- $(document).ready(function () {
46
- 'use strict';
47
- loadSystemConfig(function () {
48
- if (typeof translateAll === 'function') translateAll();
49
- loadSettings(prepareTooltips);
50
- });
51
- });
52
-
53
-
54
- // Read language settings
55
- function loadSystemConfig(callback) {
56
- socket.emit('getObject', 'system.config', function (err, res) {
57
- if (!err && res && res.common) {
58
- systemLang = res.common.language || systemLang;
59
- systemConfig = res;
60
- }
61
- socket.emit('getObject', 'system.certificates', function (err, res) {
62
- if (!err && res) {
63
- if (res.native && res.native.certificates) {
64
- certs = [];
65
- for (const c in res.native.certificates) {
66
- if (res.native.certificates.hasOwnProperty(c) && !res.native.certificates[c]) continue;
67
- const _cert = {
68
- name: c,
69
- type: (res.native.certificates[c].substring(0, '-----BEGIN RSA PRIVATE KEY'.length) === '-----BEGIN RSA PRIVATE KEY' || res.native.certificates[c].substring(0, '-----BEGIN PRIVATE KEY'.length) === '-----BEGIN PRIVATE KEY') ? 'private' : 'public'
70
- };
71
- if (_cert.type === 'public') {
72
- const m = res.native.certificates[c].split('-----END CERTIFICATE-----');
73
- let count = 0;
74
- for (let _m = 0; _m < m.length; _m++) {
75
- if (m[_m].replace(/[\r\n|\r|\n]+/, '').trim()) count++;
76
- }
77
- if (count > 1) _cert.type = 'chained';
78
- }
79
-
80
- certs.push(_cert);
81
- }
82
- }
83
- }
84
- if (callback) callback();
85
- });
86
- });
87
- }
88
-
89
- function loadSettings(callback) {
90
- socket.emit('getObject', _adapterInstance, function (err, res) {
91
- if (!err && res && res.native) {
92
- $('.adapter-instance').html(adapter + '.' + instance);
93
- $('.adapter-config').html('system.adapter.' + adapter + '.' + instance);
94
- common = res.common;
95
- if (res.common && res.common.name) $('.adapter-name').html(res.common.name);
96
- if (typeof load === 'undefined') {
97
- alert('Please implement save function in your admin/index.html');
98
- } else {
99
- // detect, that we are now in react container (themeNames = ['dark', 'blue', 'colored', 'light'])
100
-
101
- const _query = query.split('&');
102
-
103
- for (var q = 0; q < _query.length; q++) {
104
- if (_query[q].indexOf('react=') !== -1) {
105
- $('.adapter-container').addClass('react-' + _query[q].substring(6));
106
- theme = 'react-' + _query[q].substring(6);
107
- }
108
- }
109
-
110
- load(res.native, onChange);
111
- }
112
- if (typeof callback === 'function') {
113
- callback();
114
- }
115
- } else {
116
- if (typeof callback === 'function') {
117
- callback();
118
- }
119
- alert('error loading settings for ' + _adapterInstance + '\n\n' + err);
120
- }
121
- });
122
- }
123
-
124
- function prepareTooltips() {
125
- $('.admin-icon').each(function () {
126
- let id = $(this).data('id');
127
- if (!id) {
128
- let $prev = $(this).prev();
129
- let $input = $prev.find('input');
130
- if (!$input.length) $input = $prev.find('select');
131
- if (!$input.length) $input = $prev.find('textarea');
132
-
133
- if (!$input.length) {
134
- $prev = $prev.parent();
135
- $input = $prev.find('input');
136
- if (!$input.length) $input = $prev.find('select');
137
- if (!$input.length) $input = $prev.find('textarea');
138
- }
139
- if ($input.length) id = $input.attr('id');
140
- }
141
-
142
- if (!id) return;
143
-
144
- let tooltip = '';
145
- if (systemDictionary['tooltip_' + id]) {
146
- tooltip = systemDictionary['tooltip_' + id][systemLang] || systemDictionary['tooltip_' + id].en;
147
- }
148
-
149
- let icon = '';
150
- let link = $(this).data('link');
151
- if (link) {
152
- if (link === true) {
153
- if (common.readme) {
154
- link = common.readme + '#' + id;
155
- } else {
156
- link = 'https://github.com/ioBroker/ioBroker.' + common.name + '#' + id;
157
- }
158
- }
159
- if (!link.match('^https?:\/\/')) {
160
- if (common.readme) {
161
- link = common.readme + '#' + link;
162
- } else {
163
- link = 'https://github.com/ioBroker/ioBroker.' + common.name + '#' + link;
164
- }
165
- }
166
- icon += '<a class="admin-tooltip-link" target="config_help" href="' + link + '" title="' + (tooltip || systemDictionary.htooltip[systemLang]) + '"><img class="admin-tooltip-icon" src="../../img/info.png" /></a>';
167
- } else if (tooltip) {
168
- icon += '<img class="admin-tooltip-icon" title="' + tooltip + '" src="../../img/info.png"/>';
169
- }
170
-
171
- if (icon) {
172
- $(this).html(icon);
173
- }
174
- });
175
- $('.admin-text').each(function () {
176
- let id = $(this).data('id');
177
- if (!id) {
178
- let $prev = $(this).prev();
179
- let $input = $prev.find('input');
180
- if (!$input.length) $input = $prev.find('select');
181
- if (!$input.length) $input = $prev.find('textarea');
182
- if (!$input.length) {
183
- $prev = $prev.parent();
184
- $input = $prev.find('input');
185
- if (!$input.length) $input = $prev.find('select');
186
- if (!$input.length) $input = $prev.find('textarea');
187
- }
188
- if ($input.length) id = $input.attr('id');
189
- }
190
-
191
- if (!id) return;
192
-
193
- // check if translation for this exist
194
- if (systemDictionary['info_' + id]) {
195
- $(this).html('<span class="admin-tooltip-text">' + (systemDictionary['info_' + id][systemLang] || systemDictionary['info_' + id].en) + '</span>');
196
- }
197
- });
198
- }
199
-
200
-
201
- function sendTo(_adapter_instance, command, message, callback) {
202
- socket.emit('sendTo', (_adapter_instance || adapter + '.' + instance), command, message, callback);
203
- }
204
-
205
- function sendToHost(host, command, message, callback) {
206
- socket.emit('sendToHost', host || common.host, command, message, callback);
207
- }
208
-
209
- function onChange(isChanged) {
210
- //
211
- }
212
-
213
- function showMessage(message, title, icon) {
214
- var $dialogMessage;
215
- // noinspection JSJQueryEfficiency
216
- $dialogMessage = $('#dialog-message');
217
- if (!$dialogMessage.length) {
218
- $('body').append(
219
- '<div class="m"><div id="dialog-message" class="modal modal-fixed-footer">' +
220
- ' <div class="modal-content">' +
221
- ' <h6 class="dialog-title title"></h6>' +
222
- ' <p><i class="large material-icons dialog-icon"></i><span class="dialog-text"></span></p>' +
223
- ' </div>' +
224
- ' <div class="modal-footer">' +
225
- ' <a class="modal-action modal-close waves-effect waves-green btn-flat translate">Ok</a>' +
226
- ' </div>' +
227
- '</div></div>');
228
- $dialogMessage = $('#dialog-message');
229
- }
230
- if (icon) {
231
- $dialogMessage.find('.dialog-icon')
232
- .show()
233
- .html(icon);
234
- } else {
235
- $dialogMessage.find('.dialog-icon').hide();
236
- }
237
- if (title) {
238
- $dialogMessage.find('.dialog-title').html(title).show();
239
- } else {
240
- $dialogMessage.find('.dialog-title').hide();
241
- }
242
- $dialogMessage.find('.dialog-text').html(message);
243
- $dialogMessage.modal().modal('open');
244
- }