iobroker.zigbee 1.7.6 → 1.8.1
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/LICENSE +21 -21
- package/README.md +368 -381
- package/admin/admin.js +2951 -2927
- package/admin/i18n/de/translations.json +108 -0
- package/admin/i18n/en/translations.json +108 -0
- package/admin/i18n/es/translations.json +102 -0
- package/admin/i18n/fr/translations.json +108 -0
- package/admin/i18n/it/translations.json +102 -0
- package/admin/i18n/nl/translations.json +108 -0
- package/admin/i18n/pl/translations.json +108 -0
- package/admin/i18n/pt/translations.json +102 -0
- package/admin/i18n/ru/translations.json +108 -0
- package/admin/i18n/uk/translations.json +108 -0
- package/admin/i18n/zh-cn/translations.json +102 -0
- package/admin/img/philips_hue_lom001.png +0 -0
- package/admin/index.html +159 -159
- package/admin/index_m.html +1161 -1161
- package/admin/moment.min.js +1 -1
- package/admin/shuffle.min.js +2 -2
- package/admin/tab_m.html +985 -944
- package/admin/vis-network.min.css +1 -1
- package/admin/vis-network.min.js +27 -27
- package/admin/words.js +110 -110
- package/docs/de/img/CC2531.png +0 -0
- package/docs/de/img/CC2538_CC2592_PA.PNG +0 -0
- package/docs/de/img/CC2591.png +0 -0
- package/docs/de/img/boards.jpg +0 -0
- package/docs/de/img/cc26x2r.PNG +0 -0
- package/docs/de/img/results.jpg +0 -0
- package/docs/de/img/sku_429478_2.png +0 -0
- package/docs/de/img/sku_429601_2.png +0 -0
- package/docs/de/readme.md +27 -0
- package/docs/en/img/CC2531.png +0 -0
- package/docs/en/img/CC2591.png +0 -0
- package/docs/en/img/deconz.png +0 -0
- package/docs/en/img/sku_429478_2.png +0 -0
- package/docs/en/img/sku_429601_2.png +0 -0
- package/docs/en/readme.md +30 -0
- package/docs/flashing_via_arduino_(en).md +110 -0
- package/docs/ru/img/CC2531.png +0 -0
- package/docs/ru/img/CC2591.png +0 -0
- package/docs/ru/img/sku_429478_2.png +0 -0
- package/docs/ru/img/sku_429601_2.png +0 -0
- package/docs/ru/readme.md +28 -0
- package/docs/tutorial/CC2530_20190425.zip +0 -0
- package/docs/tutorial/CC2530_CC2591_20190515.zip +0 -0
- package/docs/tutorial/CC2530_CC2592_20190515.zip +0 -0
- package/docs/tutorial/CC2531_20190425.zip +0 -0
- package/docs/tutorial/adm5_1.PNG +0 -0
- package/docs/tutorial/adm5_2.PNG +0 -0
- package/docs/tutorial/cat.PNG +0 -0
- package/docs/tutorial/groups-1.png +0 -0
- package/docs/tutorial/groups-2.png +0 -0
- package/docs/tutorial/inst.PNG +0 -0
- package/docs/tutorial/reflash-finish.PNG +0 -0
- package/docs/tutorial/reflash-step0.png +0 -0
- package/docs/tutorial/reflash-step1.PNG +0 -0
- package/docs/tutorial/reflash-step2.PNG +0 -0
- package/docs/tutorial/settings.png +0 -0
- package/docs/tutorial/tab-dev-1.png +0 -0
- package/docs/tutorial/zigbee.png +0 -0
- package/docs/tutorial/zigbee15.png +0 -0
- package/io-package.json +335 -370
- package/lib/backup.js +171 -171
- package/lib/binding.js +320 -325
- package/lib/colors.js +465 -460
- package/lib/commands.js +510 -501
- package/lib/developer.js +145 -148
- package/lib/devices.js +3135 -3145
- package/lib/exclude.js +162 -168
- package/lib/exposes.js +828 -804
- package/lib/groups.js +340 -342
- package/lib/json.js +59 -60
- package/lib/networkmap.js +55 -56
- package/lib/ota.js +195 -179
- package/lib/rgb.js +297 -255
- package/lib/seriallist.js +48 -37
- package/lib/states.js +6405 -6416
- package/lib/statescontroller.js +693 -670
- package/lib/tools.js +54 -54
- package/lib/utils.js +152 -151
- package/lib/zbBaseExtension.js +36 -36
- package/lib/zbDelayedAction.js +144 -152
- package/lib/zbDeviceAvailability.js +319 -315
- package/lib/zbDeviceConfigure.js +147 -159
- package/lib/zbDeviceEvent.js +48 -49
- package/lib/zigbeecontroller.js +957 -951
- package/main.js +163 -147
- package/package.json +33 -19
- package/support/docgen.js +93 -93
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -37
- package/.github/FUNDING.yml +0 -3
- package/.github/stale.yml +0 -13
- package/.github/workflows/test-and-release.yml +0 -151
- package/.travis/wiki.sh +0 -28
- 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.
|
|
3
|
+
"version": "1.8.1",
|
|
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.
|
|
22
|
-
"zigbee-herdsman-converters": "14.0.
|
|
23
|
-
"@iobroker/adapter-core": "^2.
|
|
24
|
-
"tar": "^6.
|
|
25
|
-
"typescript": "^4.
|
|
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": "
|
|
30
|
-
"@iobroker
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
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": "^
|
|
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
|
-
"
|
|
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
|
-
"
|
|
74
|
-
"
|
|
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/support/docgen.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This script generates the supported devices page.
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
let devices = [...require('zigbee-herdsman-converters').devices];
|
|
7
|
-
|
|
8
|
-
for (const device of devices) {
|
|
9
|
-
if (device.whiteLabel) {
|
|
10
|
-
for (const whiteLabel of device.whiteLabel) {
|
|
11
|
-
const whiteLabelDevice = {
|
|
12
|
-
...device,
|
|
13
|
-
model: whiteLabel.model,
|
|
14
|
-
vendor: whiteLabel.vendor,
|
|
15
|
-
description: whiteLabel.description,
|
|
16
|
-
whiteLabelOf: device,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
delete whiteLabelDevice.whiteLabel;
|
|
20
|
-
|
|
21
|
-
devices.push(whiteLabelDevice);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
devices = new Map(devices.map((d) => [d.model, d]));
|
|
27
|
-
|
|
28
|
-
const Devices = require('../lib/devices');
|
|
29
|
-
let iobDevices = Devices.devices;
|
|
30
|
-
Devices.fillStatesWithExposes('');
|
|
31
|
-
|
|
32
|
-
const iobCount = iobDevices.filter((d) => (!d.exposed)).length;
|
|
33
|
-
iobDevices = new Map(iobDevices.map((d) => d.models.map((m) => [m, d])).flat());
|
|
34
|
-
|
|
35
|
-
const fs = require('fs');
|
|
36
|
-
const outputdir = process.argv[2];
|
|
37
|
-
|
|
38
|
-
if (!outputdir) {
|
|
39
|
-
console.error('Please specify an output directory');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const file = 'Supported-devices.md';
|
|
43
|
-
let text = `*NOTE: Automatically generated by 'npm run docgen'* \n\n` +
|
|
44
|
-
`Currently **${iobDevices.size}**(${iobCount} described in adapter) devices are supported.\n\n` +
|
|
45
|
-
`(⭐EXP) - means that the device is presented automatically, based on the 'exposes' from the zigbee-herdsman-converters.\n\n`;
|
|
46
|
-
|
|
47
|
-
const logDevices = (devmodels) => {
|
|
48
|
-
let result = '';
|
|
49
|
-
|
|
50
|
-
devmodels.forEach((devmodel) => {
|
|
51
|
-
const iobDevice = iobDevices.get(devmodel);
|
|
52
|
-
const device = devices.get(devmodel);
|
|
53
|
-
const pathImg = (iobDevice.icon.startsWith('http')) ? devmodel : iobDevice.icon.replace(new RegExp('img/', 'g'), '').replace(new RegExp('.png', 'g'), '');
|
|
54
|
-
const icon = (iobDevice.icon.startsWith('http')) ? iobDevice.icon : `https://github.com/ioBroker/ioBroker.zigbee/raw/master/admin/${iobDevice.icon}`;
|
|
55
|
-
let brand;
|
|
56
|
-
const models = [];
|
|
57
|
-
let zmodels;
|
|
58
|
-
if (device.zigbeeModel) {
|
|
59
|
-
zmodels = device.zigbeeModel;
|
|
60
|
-
} else {
|
|
61
|
-
zmodels = [devmodel];
|
|
62
|
-
}
|
|
63
|
-
zmodels.forEach((modelId) => {
|
|
64
|
-
const re = /[^\x20-\x7E]+/g;
|
|
65
|
-
const model = modelId.replace(re, ' ');
|
|
66
|
-
const desc = `${device.description} (${device.supports})`;
|
|
67
|
-
const name = `**${device.model}${(iobDevice.exposed) ? ' (⭐EXP)': ''}**<br>`;
|
|
68
|
-
if (brand == undefined) {
|
|
69
|
-
brand= {
|
|
70
|
-
name: name,
|
|
71
|
-
desc: desc,
|
|
72
|
-
pathImg: pathImg,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
models.push(model);
|
|
76
|
-
});
|
|
77
|
-
const modelsStr = models.join(', ');
|
|
78
|
-
result += `| ${brand.name} (${modelsStr}) | ${brand.desc} |  |\n`;
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
return result;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const vendors = Array.from(new Set([...iobDevices.keys()].map((m) => (devices.get(m)) ? devices.get(m).vendor : null)));
|
|
85
|
-
vendors.sort();
|
|
86
|
-
text += '| Model | Description | Picture |\n';
|
|
87
|
-
text += '| ------------- | ------------- | -------------------------- |\n';
|
|
88
|
-
vendors.forEach((vendor) => {
|
|
89
|
-
text += `| | **${vendor}** | |\n`;
|
|
90
|
-
text += logDevices([...iobDevices.keys()].map((m) => devices.get(m)).filter((d) => d && d.vendor === vendor).map((d) => d.model));
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
fs.writeFileSync(outputdir + '/' + file, text);
|
|
1
|
+
/**
|
|
2
|
+
* This script generates the supported devices page.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
let devices = [...require('zigbee-herdsman-converters').devices];
|
|
7
|
+
|
|
8
|
+
for (const device of devices) {
|
|
9
|
+
if (device.whiteLabel) {
|
|
10
|
+
for (const whiteLabel of device.whiteLabel) {
|
|
11
|
+
const whiteLabelDevice = {
|
|
12
|
+
...device,
|
|
13
|
+
model: whiteLabel.model,
|
|
14
|
+
vendor: whiteLabel.vendor,
|
|
15
|
+
description: whiteLabel.description,
|
|
16
|
+
whiteLabelOf: device,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
delete whiteLabelDevice.whiteLabel;
|
|
20
|
+
|
|
21
|
+
devices.push(whiteLabelDevice);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
devices = new Map(devices.map((d) => [d.model, d]));
|
|
27
|
+
|
|
28
|
+
const Devices = require('../lib/devices');
|
|
29
|
+
let iobDevices = Devices.devices;
|
|
30
|
+
Devices.fillStatesWithExposes('');
|
|
31
|
+
|
|
32
|
+
const iobCount = iobDevices.filter((d) => (!d.exposed)).length;
|
|
33
|
+
iobDevices = new Map(iobDevices.map((d) => d.models.map((m) => [m, d])).flat());
|
|
34
|
+
|
|
35
|
+
const fs = require('fs');
|
|
36
|
+
const outputdir = process.argv[2];
|
|
37
|
+
|
|
38
|
+
if (!outputdir) {
|
|
39
|
+
console.error('Please specify an output directory');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const file = 'Supported-devices.md';
|
|
43
|
+
let text = `*NOTE: Automatically generated by 'npm run docgen'* \n\n` +
|
|
44
|
+
`Currently **${iobDevices.size}**(${iobCount} described in adapter) devices are supported.\n\n` +
|
|
45
|
+
`(⭐EXP) - means that the device is presented automatically, based on the 'exposes' from the zigbee-herdsman-converters.\n\n`;
|
|
46
|
+
|
|
47
|
+
const logDevices = (devmodels) => {
|
|
48
|
+
let result = '';
|
|
49
|
+
|
|
50
|
+
devmodels.forEach((devmodel) => {
|
|
51
|
+
const iobDevice = iobDevices.get(devmodel);
|
|
52
|
+
const device = devices.get(devmodel);
|
|
53
|
+
const pathImg = (iobDevice.icon.startsWith('http')) ? devmodel : iobDevice.icon.replace(new RegExp('img/', 'g'), '').replace(new RegExp('.png', 'g'), '');
|
|
54
|
+
const icon = (iobDevice.icon.startsWith('http')) ? iobDevice.icon : `https://github.com/ioBroker/ioBroker.zigbee/raw/master/admin/${iobDevice.icon}`;
|
|
55
|
+
let brand;
|
|
56
|
+
const models = [];
|
|
57
|
+
let zmodels;
|
|
58
|
+
if (device.zigbeeModel) {
|
|
59
|
+
zmodels = device.zigbeeModel;
|
|
60
|
+
} else {
|
|
61
|
+
zmodels = [devmodel];
|
|
62
|
+
}
|
|
63
|
+
zmodels.forEach((modelId) => {
|
|
64
|
+
const re = /[^\x20-\x7E]+/g;
|
|
65
|
+
const model = modelId.replace(re, ' ');
|
|
66
|
+
const desc = `${device.description} (${device.supports})`;
|
|
67
|
+
const name = `**${device.model}${(iobDevice.exposed) ? ' (⭐EXP)': ''}**<br>`;
|
|
68
|
+
if (brand == undefined) {
|
|
69
|
+
brand= {
|
|
70
|
+
name: name,
|
|
71
|
+
desc: desc,
|
|
72
|
+
pathImg: pathImg,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
models.push(model);
|
|
76
|
+
});
|
|
77
|
+
const modelsStr = models.join(', ');
|
|
78
|
+
result += `| ${brand.name} (${modelsStr}) | ${brand.desc} |  |\n`;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return result;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const vendors = Array.from(new Set([...iobDevices.keys()].map((m) => (devices.get(m)) ? devices.get(m).vendor : null)));
|
|
85
|
+
vendors.sort();
|
|
86
|
+
text += '| Model | Description | Picture |\n';
|
|
87
|
+
text += '| ------------- | ------------- | -------------------------- |\n';
|
|
88
|
+
vendors.forEach((vendor) => {
|
|
89
|
+
text += `| | **${vendor}** | |\n`;
|
|
90
|
+
text += logDevices([...iobDevices.keys()].map((m) => devices.get(m)).filter((d) => d && d.vendor === vendor).map((d) => d.model));
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
fs.writeFileSync(outputdir + '/' + file, text);
|
package/.eslintignore
DELETED
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
|
-
}
|
package/.github/FUNDING.yml
DELETED
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
|