iobroker.loxone 2.2.3 → 3.0.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 +183 -183
- package/README.md +23 -1
- package/admin/words.js +18 -18
- package/build/controls/AalEmergency.js +2 -2
- package/build/controls/AalEmergency.js.map +1 -1
- package/build/controls/AalSmartAlarm.js +2 -2
- package/build/controls/AalSmartAlarm.js.map +1 -1
- package/build/controls/Alarm.js +2 -2
- package/build/controls/Alarm.js.map +1 -1
- package/build/controls/AlarmClock.js +2 -2
- package/build/controls/AlarmClock.js.map +1 -1
- package/build/controls/AudioZone.js +2 -2
- package/build/controls/AudioZone.js.map +1 -1
- package/build/controls/CentralAlarm.js +3 -3
- package/build/controls/CentralAlarm.js.map +1 -1
- package/build/controls/CentralAudioZone.js +1 -1
- package/build/controls/CentralAudioZone.js.map +1 -1
- package/build/controls/CentralGate.js +3 -3
- package/build/controls/CentralGate.js.map +1 -1
- package/build/controls/CentralJalousie.js +4 -4
- package/build/controls/CentralJalousie.js.map +1 -1
- package/build/controls/CentralLightController.js +1 -1
- package/build/controls/CentralLightController.js.map +1 -1
- package/build/controls/Daytimer.js +1 -1
- package/build/controls/Daytimer.js.map +1 -1
- package/build/controls/Dimmer.js +2 -2
- package/build/controls/Dimmer.js.map +1 -1
- package/build/controls/EIBDimmer.js +2 -2
- package/build/controls/EIBDimmer.js.map +1 -1
- package/build/controls/Gate.js +9 -14
- package/build/controls/Gate.js.map +1 -1
- package/build/controls/Hourcounter.js +2 -2
- package/build/controls/Hourcounter.js.map +1 -1
- package/build/controls/IRCV2Daytimer.js +9 -0
- package/build/controls/IRCV2Daytimer.js.map +1 -0
- package/build/controls/IRoomControllerV2.js +105 -6
- package/build/controls/IRoomControllerV2.js.map +1 -1
- package/build/controls/Intercom.js +1 -1
- package/build/controls/Intercom.js.map +1 -1
- package/build/controls/Jalousie.js +10 -13
- package/build/controls/Jalousie.js.map +1 -1
- package/build/controls/LightController.js +3 -3
- package/build/controls/LightController.js.map +1 -1
- package/build/controls/LightControllerV2.js +2 -2
- package/build/controls/LightControllerV2.js.map +1 -1
- package/build/controls/MailBox.js +2 -2
- package/build/controls/MailBox.js.map +1 -1
- package/build/controls/Meter.js +1 -1
- package/build/controls/Meter.js.map +1 -1
- package/build/controls/Pushbutton.js +3 -6
- package/build/controls/Pushbutton.js.map +1 -1
- package/build/controls/Radio.js +1 -4
- package/build/controls/Radio.js.map +1 -1
- package/build/controls/Remote.js +36 -0
- package/build/controls/Remote.js.map +1 -0
- package/build/controls/SmokeAlarm.js +2 -2
- package/build/controls/SmokeAlarm.js.map +1 -1
- package/build/controls/Switch.js +2 -5
- package/build/controls/Switch.js.map +1 -1
- package/build/controls/TimedSwitch.js +3 -3
- package/build/controls/TimedSwitch.js.map +1 -1
- package/build/controls/Unknown.js +1 -2
- package/build/controls/Unknown.js.map +1 -1
- package/build/loxone-handler-base.js +4 -4
- package/build/loxone-handler-base.js.map +1 -1
- package/build/main.js +410 -96
- package/build/main.js.map +1 -1
- package/build/weather-server-handler.js +4 -4
- package/build/weather-server-handler.js.map +1 -1
- package/io-package.json +298 -332
- package/package.json +40 -30
- package/build/lib/tools.js +0 -96
- package/build/lib/tools.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.loxone",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Communicates with a Loxone Miniserver.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "UncleSamSwiss",
|
|
7
7
|
"email": "samuel.weibel@gmail.com"
|
|
8
8
|
},
|
|
9
|
+
"contributors": [
|
|
10
|
+
{
|
|
11
|
+
"name": "Robin Rainton",
|
|
12
|
+
"email": "robin@rainton.com"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
9
15
|
"homepage": "https://github.com/UncleSamSwiss/ioBroker.loxone",
|
|
10
16
|
"license": "Apache-2.0",
|
|
11
17
|
"keywords": [
|
|
@@ -18,46 +24,49 @@
|
|
|
18
24
|
"url": "https://github.com/UncleSamSwiss/ioBroker.loxone"
|
|
19
25
|
},
|
|
20
26
|
"dependencies": {
|
|
21
|
-
"@iobroker/adapter-core": "^2.
|
|
22
|
-
"@sentry/node": "^
|
|
23
|
-
"axios": "^
|
|
27
|
+
"@iobroker/adapter-core": "^2.6.7",
|
|
28
|
+
"@sentry/node": "^7.45.0",
|
|
29
|
+
"axios": "^1.3.4",
|
|
24
30
|
"color-convert": "^2.0.1",
|
|
25
31
|
"form-data": "^4.0.0",
|
|
26
|
-
"
|
|
32
|
+
"lxcommunicator": "^1.1.1",
|
|
27
33
|
"queue-fifo": "*",
|
|
28
|
-
"sprintf-js": "^1.1.2"
|
|
34
|
+
"sprintf-js": "^1.1.2",
|
|
35
|
+
"uuid": "^9.0.0"
|
|
29
36
|
},
|
|
30
37
|
"devDependencies": {
|
|
31
|
-
"@alcalzone/release-script": "^
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
38
|
+
"@alcalzone/release-script": "^3.5.9",
|
|
39
|
+
"@alcalzone/release-script-plugin-iobroker": "^3.5.9",
|
|
40
|
+
"@alcalzone/release-script-plugin-license": "^3.5.9",
|
|
41
|
+
"@alcalzone/release-script-plugin-manual-review": "^3.5.9",
|
|
42
|
+
"@iobroker/adapter-dev": "^1.2.0",
|
|
43
|
+
"@iobroker/testing": "^4.1.0",
|
|
44
|
+
"@types/chai": "^4.3.4",
|
|
45
|
+
"@types/chai-as-promised": "^7.1.5",
|
|
36
46
|
"@types/color-convert": "^2.0.0",
|
|
37
|
-
"@types/
|
|
38
|
-
"@types/
|
|
39
|
-
"@types/node": "^15.14.1",
|
|
47
|
+
"@types/mocha": "^10.0.1",
|
|
48
|
+
"@types/node": "^18.14.2",
|
|
40
49
|
"@types/proxyquire": "^1.3.28",
|
|
41
|
-
"@types/sinon": "^10.0.
|
|
42
|
-
"@types/sinon-chai": "^3.2.
|
|
50
|
+
"@types/sinon": "^10.0.11",
|
|
51
|
+
"@types/sinon-chai": "^3.2.9",
|
|
43
52
|
"@types/sprintf-js": "^1.1.2",
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/
|
|
46
|
-
"
|
|
53
|
+
"@types/uuid": "^9.0.1",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
55
|
+
"@typescript-eslint/parser": "^5.54.0",
|
|
56
|
+
"chai": "^4.3.7",
|
|
47
57
|
"chai-as-promised": "^7.1.1",
|
|
48
|
-
"eslint": "^
|
|
49
|
-
"eslint-config-prettier": "^8.
|
|
50
|
-
"eslint-plugin-prettier": "^
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"prettier": "^2.3.2",
|
|
58
|
+
"eslint": "^8.35.0",
|
|
59
|
+
"eslint-config-prettier": "^8.6.0",
|
|
60
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
61
|
+
"mocha": "^10.2.0",
|
|
62
|
+
"prettier": "^2.8.4",
|
|
54
63
|
"proxyquire": "^2.1.3",
|
|
55
|
-
"rimraf": "^
|
|
56
|
-
"sinon": "^
|
|
64
|
+
"rimraf": "^4.1.2",
|
|
65
|
+
"sinon": "^15.0.3",
|
|
57
66
|
"sinon-chai": "^3.7.0",
|
|
58
|
-
"source-map-support": "^0.5.
|
|
59
|
-
"ts-node": "^10.
|
|
60
|
-
"typescript": "^4.
|
|
67
|
+
"source-map-support": "^0.5.21",
|
|
68
|
+
"ts-node": "^10.9.1",
|
|
69
|
+
"typescript": "^4.9.5"
|
|
61
70
|
},
|
|
62
71
|
"main": "build/main.js",
|
|
63
72
|
"scripts": {
|
|
@@ -73,6 +82,7 @@
|
|
|
73
82
|
"test": "npm run test:ts && npm run test:package",
|
|
74
83
|
"check": "tsc --noEmit",
|
|
75
84
|
"lint": "eslint --ext .ts src/",
|
|
85
|
+
"translate": "translate-adapter",
|
|
76
86
|
"release": "release-script"
|
|
77
87
|
},
|
|
78
88
|
"bugs": {
|
package/build/lib/tools.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.translateText = exports.isArray = exports.isObject = void 0;
|
|
4
|
-
const axios_1 = require("axios");
|
|
5
|
-
/**
|
|
6
|
-
* Tests whether the given variable is a real object and not an Array
|
|
7
|
-
* @param it The variable to test
|
|
8
|
-
*/
|
|
9
|
-
function isObject(it) {
|
|
10
|
-
// This is necessary because:
|
|
11
|
-
// typeof null === 'object'
|
|
12
|
-
// typeof [] === 'object'
|
|
13
|
-
// [] instanceof Object === true
|
|
14
|
-
return Object.prototype.toString.call(it) === '[object Object]';
|
|
15
|
-
}
|
|
16
|
-
exports.isObject = isObject;
|
|
17
|
-
/**
|
|
18
|
-
* Tests whether the given variable is really an Array
|
|
19
|
-
* @param it The variable to test
|
|
20
|
-
*/
|
|
21
|
-
function isArray(it) {
|
|
22
|
-
if (Array.isArray != null)
|
|
23
|
-
return Array.isArray(it);
|
|
24
|
-
return Object.prototype.toString.call(it) === '[object Array]';
|
|
25
|
-
}
|
|
26
|
-
exports.isArray = isArray;
|
|
27
|
-
/**
|
|
28
|
-
* Translates text using the Google Translate API
|
|
29
|
-
* @param text The text to translate
|
|
30
|
-
* @param targetLang The target languate
|
|
31
|
-
* @param yandexApiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers
|
|
32
|
-
*/
|
|
33
|
-
async function translateText(text, targetLang, yandexApiKey) {
|
|
34
|
-
if (targetLang === 'en') {
|
|
35
|
-
return text;
|
|
36
|
-
}
|
|
37
|
-
else if (!text) {
|
|
38
|
-
return '';
|
|
39
|
-
}
|
|
40
|
-
if (yandexApiKey) {
|
|
41
|
-
return translateYandex(text, targetLang, yandexApiKey);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return translateGoogle(text, targetLang);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.translateText = translateText;
|
|
48
|
-
/**
|
|
49
|
-
* Translates text with Yandex API
|
|
50
|
-
* @param text The text to translate
|
|
51
|
-
* @param targetLang The target languate
|
|
52
|
-
* @param apiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers
|
|
53
|
-
*/
|
|
54
|
-
async function translateYandex(text, targetLang, apiKey) {
|
|
55
|
-
var _a;
|
|
56
|
-
if (targetLang === 'zh-cn') {
|
|
57
|
-
targetLang = 'zh';
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;
|
|
61
|
-
const response = await axios_1.default({ url, timeout: 15000 });
|
|
62
|
-
if (isArray((_a = response.data) === null || _a === void 0 ? void 0 : _a.text)) {
|
|
63
|
-
return response.data.text[0];
|
|
64
|
-
}
|
|
65
|
-
throw new Error('Invalid response for translate request');
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Translates text with Google API
|
|
73
|
-
* @param text The text to translate
|
|
74
|
-
* @param targetLang The target languate
|
|
75
|
-
*/
|
|
76
|
-
async function translateGoogle(text, targetLang) {
|
|
77
|
-
var _a;
|
|
78
|
-
try {
|
|
79
|
-
const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;
|
|
80
|
-
const response = await axios_1.default({ url, timeout: 15000 });
|
|
81
|
-
if (isArray(response.data)) {
|
|
82
|
-
// we got a valid response
|
|
83
|
-
return response.data[0][0][0];
|
|
84
|
-
}
|
|
85
|
-
throw new Error('Invalid response for translate request');
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
if (((_a = e.response) === null || _a === void 0 ? void 0 : _a.status) === 429) {
|
|
89
|
-
throw new Error(`Could not translate to "${targetLang}": Rate-limited by Google Translate`);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=tools.js.map
|
package/build/lib/tools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/lib/tools.ts"],"names":[],"mappings":";;;AAAA,iCAA0B;AAE1B;;;GAGG;AACH,SAAgB,QAAQ,CAAC,EAAW;IAChC,6BAA6B;IAC7B,2BAA2B;IAC3B,yBAAyB;IACzB,gCAAgC;IAChC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,iBAAiB,CAAC;AACpE,CAAC;AAND,4BAMC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,EAAW;IAC/B,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpD,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,gBAAgB,CAAC;AACnE,CAAC;AAHD,0BAGC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,IAAY,EAAE,UAAkB,EAAE,YAAqB;IACvF,IAAI,UAAU,KAAK,IAAI,EAAE;QACrB,OAAO,IAAI,CAAC;KACf;SAAM,IAAI,CAAC,IAAI,EAAE;QACd,OAAO,EAAE,CAAC;KACb;IACD,IAAI,YAAY,EAAE;QACd,OAAO,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;KAC1D;SAAM;QACH,OAAO,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;KAC5C;AACL,CAAC;AAXD,sC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