iobroker.hydrawise 0.1.2 → 0.2.2
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/README.md +8 -0
- package/build/main.js +50 -3
- package/build/main.js.map +2 -2
- package/io-package.json +27 -27
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -39,6 +39,14 @@ You can see all controller information, schedules and sensors. It is also possib
|
|
|
39
39
|
Placeholder for the next version (at the beginning of the line):
|
|
40
40
|
### **WORK IN PROGRESS**
|
|
41
41
|
-->
|
|
42
|
+
### 0.2.2 (2023-09-22)
|
|
43
|
+
|
|
44
|
+
- (SentiQ) fixed versions
|
|
45
|
+
|
|
46
|
+
### 0.2.0 (2023-09-22)
|
|
47
|
+
|
|
48
|
+
- (SentiQ) added button to run zone for default runtime
|
|
49
|
+
|
|
42
50
|
### 0.1.2 (2023-08-22)
|
|
43
51
|
|
|
44
52
|
- (SentiQ) added link to api docu
|
package/build/main.js
CHANGED
|
@@ -22,6 +22,7 @@ var import_axios = __toESM(require("axios"));
|
|
|
22
22
|
const hydrawise_url = "https://api.hydrawise.com";
|
|
23
23
|
let nextpollSchedule = null;
|
|
24
24
|
let nextpollCustomer = null;
|
|
25
|
+
let resetSwitch = null;
|
|
25
26
|
const RELAYS = Object;
|
|
26
27
|
class Hydrawise extends utils.Adapter {
|
|
27
28
|
constructor(options = {}) {
|
|
@@ -128,7 +129,7 @@ class Hydrawise extends utils.Adapter {
|
|
|
128
129
|
});
|
|
129
130
|
for (let key in content) {
|
|
130
131
|
key = this.name2id(key);
|
|
131
|
-
if (key !== "relays" && key !== "sensors" && key !== "expanders") {
|
|
132
|
+
if (key !== "relays" && key !== "sensors" && key !== "expanders" && !Number.isNaN(key)) {
|
|
132
133
|
await this.setObjectNotExistsAsync(`schedule.${key}`, {
|
|
133
134
|
type: "state",
|
|
134
135
|
common: {
|
|
@@ -257,6 +258,29 @@ class Hydrawise extends utils.Adapter {
|
|
|
257
258
|
},
|
|
258
259
|
native: {}
|
|
259
260
|
});
|
|
261
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runDefault`, {
|
|
262
|
+
type: "state",
|
|
263
|
+
common: {
|
|
264
|
+
name: {
|
|
265
|
+
en: "run zone for default time",
|
|
266
|
+
de: "Zone mit Standardlaufzeit starten",
|
|
267
|
+
ru: "\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0434\u043B\u044F \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E",
|
|
268
|
+
pt: "fuso de execu\xE7\xE3o para o tempo padr\xE3o",
|
|
269
|
+
nl: "run zone for default time",
|
|
270
|
+
fr: "run zone for default time",
|
|
271
|
+
it: "run zone per il tempo predefinito",
|
|
272
|
+
es: "zona de ejecuci\xF3n por tiempo predeterminado",
|
|
273
|
+
pl: "strefa czasu domy\u015Blnego",
|
|
274
|
+
uk: "\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C",
|
|
275
|
+
"zh-cn": "a. \u6682\u505C\u65F6\u95F4\u533A"
|
|
276
|
+
},
|
|
277
|
+
type: "boolean",
|
|
278
|
+
role: "switch.power",
|
|
279
|
+
read: true,
|
|
280
|
+
write: true
|
|
281
|
+
},
|
|
282
|
+
native: {}
|
|
283
|
+
});
|
|
260
284
|
}
|
|
261
285
|
for (const sensor of content.sensors) {
|
|
262
286
|
await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}`, {
|
|
@@ -322,7 +346,7 @@ class Hydrawise extends utils.Adapter {
|
|
|
322
346
|
const content = response.data;
|
|
323
347
|
this.setStateChangedAsync("info.connection", true, true);
|
|
324
348
|
for (let key in content) {
|
|
325
|
-
if (key !== "controllers") {
|
|
349
|
+
if (key !== "controllers" && !Number.isNaN(key)) {
|
|
326
350
|
key = this.name2id(key);
|
|
327
351
|
await this.setObjectNotExistsAsync(`customer.${key}`, {
|
|
328
352
|
type: "state",
|
|
@@ -461,7 +485,7 @@ class Hydrawise extends utils.Adapter {
|
|
|
461
485
|
period_id: 999,
|
|
462
486
|
custom: state.val
|
|
463
487
|
});
|
|
464
|
-
} else if (id.indexOf("
|
|
488
|
+
} else if (id.indexOf("runZone") !== -1 && (state.val || state.val === 0)) {
|
|
465
489
|
const relay = id.match(/.*schedule\.(.*)\.runZone/);
|
|
466
490
|
if (relay && (relay == null ? void 0 : relay.length) > 1) {
|
|
467
491
|
this.buildRequest("setzone.php", {
|
|
@@ -473,6 +497,9 @@ class Hydrawise extends utils.Adapter {
|
|
|
473
497
|
});
|
|
474
498
|
}
|
|
475
499
|
}
|
|
500
|
+
if (id.indexOf("runDefault") !== -1 && state.val !== null) {
|
|
501
|
+
this.initRunDefault(id, state.val);
|
|
502
|
+
}
|
|
476
503
|
if (id.indexOf("suspendall") !== -1 && (state.val || state.val === 0)) {
|
|
477
504
|
const num = state.val;
|
|
478
505
|
this.buildRequest("setzone.php", {
|
|
@@ -496,6 +523,26 @@ class Hydrawise extends utils.Adapter {
|
|
|
496
523
|
}
|
|
497
524
|
}
|
|
498
525
|
}
|
|
526
|
+
async initRunDefault(id, run) {
|
|
527
|
+
const relay = id.match(/(.*schedule.*\.)runDefault/);
|
|
528
|
+
this.clearTimeout(resetSwitch);
|
|
529
|
+
if (relay) {
|
|
530
|
+
if (run) {
|
|
531
|
+
const defaultRunTime = await this.getStateAsync(relay[1] + "run");
|
|
532
|
+
if (defaultRunTime && defaultRunTime.val) {
|
|
533
|
+
this.setStateAsync(relay[1] + "runZone", defaultRunTime.val, false);
|
|
534
|
+
resetSwitch = this.setTimeout(
|
|
535
|
+
() => {
|
|
536
|
+
this.setStateAsync(id, false, false);
|
|
537
|
+
},
|
|
538
|
+
defaultRunTime.val * 1e3
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
} else {
|
|
542
|
+
this.setStateAsync(relay[1] + "stopZone", true, false);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
499
546
|
name2id(pName) {
|
|
500
547
|
return (pName || "").replace(this.FORBIDDEN_CHARS, "_");
|
|
501
548
|
}
|
package/build/main.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/main.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.3.0\n */\n\n// The adapter-core module gives you access to the core ioBroker functions\n// you need to create an adapter\nimport * as utils from \"@iobroker/adapter-core\";\nimport axios from \"axios\";\n\nconst hydrawise_url = \"https://api.hydrawise.com\";\nlet nextpollSchedule: any = null;\nlet nextpollCustomer: any = null;\nconst RELAYS: any = Object;\n\nclass Hydrawise extends utils.Adapter {\n\tpublic constructor(options: Partial<utils.AdapterOptions> = {}) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tname: \"hydrawise\",\n\t\t});\n\n\t\tthis.on(\"ready\", this.onReady.bind(this));\n\t\tthis.on(\"stateChange\", this.onStateChange.bind(this));\n\t\tthis.on(\"unload\", this.onUnload.bind(this));\n\t}\n\n\tprivate async onReady(): Promise<void> {\n\t\tif (!this.config.apiKey) {\n\t\t\tthis.log.error(\"No API-Key definded!\");\n\t\t} else {\n\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\tawait this.GetStatusSchedule(this.config.apiKey);\n\n\t\t\tawait this.GetCustomerDetails(this.config.apiKey);\n\n\t\t\tawait this.subscribeStatesAsync(\"*\");\n\t\t}\n\t}\n\n\tprivate async GetStatusSchedule(apiKey: string): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tnextpollSchedule =\n\t\t\t\tnextpollSchedule ||\n\t\t\t\tthis.setTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tnextpollSchedule = null;\n\t\t\t\t\t\tthis.GetStatusSchedule(apiKey);\n\t\t\t\t\t},\n\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t);\n\n\t\t\tthis.buildRequest(\"statusschedule.php\", { api_key: this.config.apiKey })\n\t\t\t\t.then(async (response) => {\n\t\t\t\t\tif (response?.status === 200) {\n\t\t\t\t\t\tconst content = response.data;\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", true, true);\n\n\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.stopall\", {\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\ten: \"stop all zones\",\n\t\t\t\t\t\t\t\t\tde: \"alle Zonen stoppen\",\n\t\t\t\t\t\t\t\t\tru: \"\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B\",\n\t\t\t\t\t\t\t\t\tpt: \"parar todas as zonas\",\n\t\t\t\t\t\t\t\t\tnl: \"stop alle zones\",\n\t\t\t\t\t\t\t\t\tfr: \"arr\u00EAter toutes les zones\",\n\t\t\t\t\t\t\t\t\tit: \"fermare tutte le zone\",\n\t\t\t\t\t\t\t\t\tes: \"detener todas las zonas\",\n\t\t\t\t\t\t\t\t\tpl: \"zatrzymuj\u0105 wszystkie strefy\",\n\t\t\t\t\t\t\t\t\tuk: \"\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438\",\n\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62\u6240\u6709\u5730\u533A\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\t\t\trole: \"button.stop\",\n\t\t\t\t\t\t\t\tread: false,\n\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.runall\", {\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\ten: \"run all zones for x seconds\",\n\t\t\t\t\t\t\t\t\tde: \"alle Zonen f\u00FCr x Sekunden ausf\u00FChren\",\n\t\t\t\t\t\t\t\t\tru: \"\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\tpt: \"executar todas as zonas por x segundos\",\n\t\t\t\t\t\t\t\t\tnl: \"ren alle zones voor x seconden\",\n\t\t\t\t\t\t\t\t\tfr: \"ex\u00E9cuter toutes les zones pendant x secondes\",\n\t\t\t\t\t\t\t\t\tit: \"eseguire tutte le zone per x secondi\",\n\t\t\t\t\t\t\t\t\tes: \"ejecutar todas las zonas durante x segundos\",\n\t\t\t\t\t\t\t\t\tpl: \"wszystkie strefy startuj\u0105 dla x sekundy\",\n\t\t\t\t\t\t\t\t\tuk: \"\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u8DD1\u9053\u533A\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\tunit: \"seconds\",\n\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.suspendall\", {\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\ten: \"suspend all zones for x seconds\",\n\t\t\t\t\t\t\t\t\tde: \"alle Zonen f\u00FCr x Sekunden aussetzen\",\n\t\t\t\t\t\t\t\t\tru: \"\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\tpt: \"suspender todas as zonas por x segundos\",\n\t\t\t\t\t\t\t\t\tnl: \"vertaling:\",\n\t\t\t\t\t\t\t\t\tfr: \"suspendre toutes les zones pendant x secondes\",\n\t\t\t\t\t\t\t\t\tit: \"sospendere tutte le zone per x secondi\",\n\t\t\t\t\t\t\t\t\tes: \"suspender todas las zonas durante x segundos\",\n\t\t\t\t\t\t\t\t\tpl: \"wszystkie strefy zawieszenia dla x sekundy\",\n\t\t\t\t\t\t\t\t\tuk: \"\u043F\u0440\u0438\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62\u6240\u6709\u00D7\u4E8C\u533A\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tfor (let key in content) {\n\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\tif (key !== \"relays\" && key !== \"sensors\" && key !== \"expanders\") {\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key === \"message\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key === \"message\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(`schedule.${key}`, content[key], true);\n\n\t\t\t\t\t\t\t\tif (key === \"time\") {\n\t\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.timestr\", {\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\t\tname: \"last api call\",\n\t\t\t\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t\t\t\t\trole: \"text\",\n\t\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\tconst t = new Date(content[key] * 1000);\n\n\t\t\t\t\t\t\t\t\tthis.setStateChangedAsync(\"schedule.timestr\", t.toString(), true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const relay of content.relays) {\n\t\t\t\t\t\t\tconst name = relay.relay;\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}`, {\n\t\t\t\t\t\t\t\ttype: \"channel\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: name.toString(),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tRELAYS[relay.relay] = relay.relay_id;\n\n\t\t\t\t\t\t\tfor (let key in relay) {\n\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key === \"name\" || key === \"timestr\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key === \"name\" || key === \"timestr\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tif (key === \"timestr\") {\n\t\t\t\t\t\t\t\t\tconst t = new Date();\n\t\t\t\t\t\t\t\t\tt.setSeconds(t.getSeconds() + relay.time);\n\t\t\t\t\t\t\t\t\trelay[key] = t.toString();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {\n\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\t\ten: \"stop zone\",\n\t\t\t\t\t\t\t\t\t\tde: \"Zone stoppen\",\n\t\t\t\t\t\t\t\t\t\tru: \"\u0437\u043E\u043D\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438\",\n\t\t\t\t\t\t\t\t\t\tpt: \"zona de paragem\",\n\t\t\t\t\t\t\t\t\t\tnl: \"stop zone\",\n\t\t\t\t\t\t\t\t\t\tfr: \"zone d ' arr\u00EAt\",\n\t\t\t\t\t\t\t\t\t\tit: \"zona di sosta\",\n\t\t\t\t\t\t\t\t\t\tes: \"zona de parada\",\n\t\t\t\t\t\t\t\t\t\tpl: \"strefa stopu\",\n\t\t\t\t\t\t\t\t\t\tuk: \"\u0437\u043E\u043D\u0430 \u0437\u0443\u043F\u0438\u043D\u043A\u0438\",\n\t\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62\u5730\u533A\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\t\t\t\trole: \"button.stop\",\n\t\t\t\t\t\t\t\t\tread: false,\n\t\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.runZone`, {\n\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\t\ten: \"run zone for x seconds\",\n\t\t\t\t\t\t\t\t\t\tde: \"Zone f\u00FCr x Sekunden starten\",\n\t\t\t\t\t\t\t\t\t\tru: \"\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\t\tpt: \"zona de execu\u00E7\u00E3o por x segundos\",\n\t\t\t\t\t\t\t\t\t\tnl: \"ren zone voor x seconden\",\n\t\t\t\t\t\t\t\t\t\tfr: \"zone de course pour x secondes\",\n\t\t\t\t\t\t\t\t\t\tit: \"zona di corsa per x secondi\",\n\t\t\t\t\t\t\t\t\t\tes: \"zona de ejecuci\u00F3n por x segundos\",\n\t\t\t\t\t\t\t\t\t\tpl: \"strefa x sekundy\",\n\t\t\t\t\t\t\t\t\t\tuk: \"\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u00D7\u4E8C\u533A\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.suspendZone`, {\n\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\t\ten: \"suspend zone for x seconds\",\n\t\t\t\t\t\t\t\t\t\tde: \"Zone f\u00FCr x Sekunden aussetzen\",\n\t\t\t\t\t\t\t\t\t\tru: \"\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\t\tpt: \"zona de suspens\u00E3o por x segundos\",\n\t\t\t\t\t\t\t\t\t\tnl: \"quality over quantity (qoq) releases vertaling:\",\n\t\t\t\t\t\t\t\t\t\tfr: \"zone de suspension pour x secondes\",\n\t\t\t\t\t\t\t\t\t\tit: \"zona di sospensione per x secondi\",\n\t\t\t\t\t\t\t\t\t\tes: \"zona de suspensi\u00F3n por x segundos\",\n\t\t\t\t\t\t\t\t\t\tpl: \"strefa zawies\u0142a na x sekundy\",\n\t\t\t\t\t\t\t\t\t\tuk: \"\u0437\u043E\u043D\u0430 \u043F\u0456\u0434\u0432\u0456\u0441\u043A\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62x\u4E8C\u533A\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const sensor of content.sensors) {\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}`, {\n\t\t\t\t\t\t\t\ttype: \"channel\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: \"sensors\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tfor (let key in sensor) {\n\t\t\t\t\t\t\t\tif (key !== \"relays\") {\n\t\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}.${key}`, {\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\t\t\trole: \"value\",\n\t\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\tthis.setStateChangedAsync(\n\t\t\t\t\t\t\t\t\t\t`schedule.sensors.${sensor.input}.${key}`,\n\t\t\t\t\t\t\t\t\t\tsensor[key],\n\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(response.status);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tif (error.response?.status === 429) {\n\t\t\t\t\t\tnextpollSchedule =\n\t\t\t\t\t\t\tnextpollSchedule ||\n\t\t\t\t\t\t\tthis.setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tnextpollSchedule = null;\n\t\t\t\t\t\t\t\t\tthis.GetStatusSchedule(apiKey);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t}\n\n\tprivate async GetCustomerDetails(apiKey: string): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tnextpollCustomer =\n\t\t\t\tnextpollCustomer ||\n\t\t\t\tthis.setTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tnextpollCustomer = null;\n\t\t\t\t\t\tthis.GetCustomerDetails(apiKey);\n\t\t\t\t\t},\n\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t);\n\n\t\t\tthis.buildRequest(\"customerdetails.php\", { api_key: this.config.apiKey })\n\t\t\t\t.then(async (response) => {\n\t\t\t\t\tif (response?.status === 200) {\n\t\t\t\t\t\tconst content = response.data;\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", true, true);\n\n\t\t\t\t\t\tfor (let key in content) {\n\t\t\t\t\t\t\tif (key !== \"controllers\") {\n\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`customer.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key === \"message\" || key === \"current_controller\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key === \"message\" || key === \"current_controller\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(`customer.${key}`, content[key], true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const controller of content.controllers) {\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`customer.controllers.${controller.name}`, {\n\t\t\t\t\t\t\t\ttype: \"channel\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: controller.name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tfor (let key in controller) {\n\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`customer.controllers.${controller.name}.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key !== \"controller_id\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key !== \"controller_id\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tif (key === \"last_contact\") {\n\t\t\t\t\t\t\t\t\tconst t = new Date(controller[key] * 1000);\n\t\t\t\t\t\t\t\t\tcontroller[key] = t.toString();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(\n\t\t\t\t\t\t\t\t\t`customer.controllers.${controller.name}.${key}`,\n\t\t\t\t\t\t\t\t\tcontroller[key],\n\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(response.status);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tif (error.response?.status === 429) {\n\t\t\t\t\t\tnextpollCustomer =\n\t\t\t\t\t\t\tnextpollCustomer ||\n\t\t\t\t\t\t\tthis.setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tnextpollCustomer = null;\n\t\t\t\t\t\t\t\t\tthis.GetCustomerDetails(apiKey);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t}\n\n\tbuildRequest(service: string, params: any): Promise<any> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst url = `/api/v1/${service}`;\n\t\t\tlet lastErrorCode = 0;\n\n\t\t\tif (params.api_key) {\n\t\t\t\ttry {\n\t\t\t\t\taxios({\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\tbaseURL: hydrawise_url,\n\t\t\t\t\t\turl: url,\n\t\t\t\t\t\ttimeout: 30000,\n\t\t\t\t\t\tresponseType: \"json\",\n\t\t\t\t\t\tparams: params,\n\t\t\t\t\t})\n\t\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\t\t// no error - clear up reminder\n\t\t\t\t\t\t\tlastErrorCode = 0;\n\n\t\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tif (error.response) {\n\t\t\t\t\t\t\t\t// The request was made and the server responded with a status code\n\n\t\t\t\t\t\t\t\tthis.log.warn(\n\t\t\t\t\t\t\t\t\t`received ${\n\t\t\t\t\t\t\t\t\t\terror.response.status\n\t\t\t\t\t\t\t\t\t} response from ${url} with content: ${JSON.stringify(error.response.data)}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (error.request) {\n\t\t\t\t\t\t\t\t// The request was made but no response was received\n\t\t\t\t\t\t\t\t// `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n\t\t\t\t\t\t\t\t// http.ClientRequest in node.js\n\n\t\t\t\t\t\t\t\t// avoid spamming of the same error when stuck in a reconnection loop\n\t\t\t\t\t\t\t\tif (error.code === lastErrorCode) {\n\t\t\t\t\t\t\t\t\tthis.log.debug(error.message);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.log.info(`error ${error.code} from ${url}: ${error.message}`);\n\t\t\t\t\t\t\t\t\tlastErrorCode = error.code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Something happened in setting up the request that triggered an Error\n\t\t\t\t\t\t\t\tthis.log.error(error.message);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treject(\"API key is not configured\");\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Is called when adapter shuts down - callback has to be called under any circumstances!\n\t */\n\tprivate onUnload(callback: () => void): void {\n\t\ttry {\n\t\t\tthis.clearTimeout(nextpollSchedule);\n\t\t\tthis.clearTimeout(nextpollCustomer);\n\n\t\t\tcallback();\n\t\t} catch (e) {\n\t\t\tcallback();\n\t\t}\n\t}\n\n\t/**\n\t * Is called if a subscribed state changes\n\t */\n\tprivate onStateChange(id: string, state: ioBroker.State | null | undefined): void {\n\t\tif (state && !state.ack) {\n\t\t\tif (id.indexOf(\"stopall\") !== -1) {\n\t\t\t\tthis.buildRequest(\"setzone.php\", { api_key: this.config.apiKey, action: \"stopall\" });\n\t\t\t} else if (id.indexOf(\"stop\") !== -1) {\n\t\t\t\tconst relay = id.match(/.*schedule\\.(.*)\\.stopZone/);\n\n\t\t\t\tif (relay && relay?.length > 1) {\n\t\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\t\taction: \"stop\",\n\t\t\t\t\t\trelay_id: RELAYS[relay[1]],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (id.indexOf(\"runall\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\taction: \"runall\",\n\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\tcustom: state.val,\n\t\t\t\t});\n\t\t\t} else if (id.indexOf(\"run\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tconst relay = id.match(/.*schedule\\.(.*)\\.runZone/);\n\n\t\t\t\tif (relay && relay?.length > 1) {\n\t\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\t\taction: \"run\",\n\t\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\t\tcustom: state.val,\n\t\t\t\t\t\trelay_id: RELAYS[relay[1]],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (id.indexOf(\"suspendall\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tconst num = state.val as number;\n\n\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\taction: \"suspendall\",\n\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\tcustom: Math.trunc((state.ts + num) / 1000),\n\t\t\t\t});\n\t\t\t} else if (id.indexOf(\"suspend\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tconst num = state.val as number;\n\t\t\t\tconst relay = id.match(/.*schedule\\.(.*)\\.suspendZone/);\n\n\t\t\t\tif (relay && relay?.length > 1) {\n\t\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\t\taction: \"suspend\",\n\t\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\t\tcustom: Math.trunc((state.ts + num) / 1000),\n\t\t\t\t\t\trelay_id: RELAYS[relay[1]],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tname2id(pName: string): string {\n\t\treturn (pName || \"\").replace(this.FORBIDDEN_CHARS, \"_\");\n\t}\n}\n\nif (require.main !== module) {\n\t// Export the constructor in compact mode\n\tmodule.exports = (options: Partial<utils.AdapterOptions> | undefined) => new Hydrawise(options);\n} else {\n\t// otherwise start the instance directly\n\t(() => new Hydrawise())();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAMA,YAAuB;AACvB,mBAAkB;AAElB,MAAM,gBAAgB;AACt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+BAAO,UAAS,GAAG;AAC/B,eAAK,aAAa,eAAe;AAAA,YAChC,SAAS,KAAK,OAAO;AAAA,YACrB,QAAQ;AAAA,YACR,WAAW;AAAA,YACX,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,GAAI;AAAA,YAC1C,UAAU,OAAO,MAAM;AAAA,UACxB,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,QAAQ,OAAuB;AAC9B,YAAQ,SAAS,IAAI,QAAQ,KAAK,iBAAiB,GAAG;AAAA,EACvD;AACD;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAE5B,SAAO,UAAU,CAAC,YAAuD,IAAI,UAAU,OAAO;AAC/F,OAAO;AAEN,GAAC,MAAM,IAAI,UAAU,GAAG;AACzB;",
|
|
4
|
+
"sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.3.0\n */\n\n// The adapter-core module gives you access to the core ioBroker functions\n// you need to create an adapter\nimport * as utils from \"@iobroker/adapter-core\";\nimport axios from \"axios\";\n\nconst hydrawise_url = \"https://api.hydrawise.com\";\nlet nextpollSchedule: any = null;\nlet nextpollCustomer: any = null;\nlet resetSwitch: any = null;\nconst RELAYS: any = Object;\n\nclass Hydrawise extends utils.Adapter {\n\tpublic constructor(options: Partial<utils.AdapterOptions> = {}) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tname: \"hydrawise\",\n\t\t});\n\n\t\tthis.on(\"ready\", this.onReady.bind(this));\n\t\tthis.on(\"stateChange\", this.onStateChange.bind(this));\n\t\tthis.on(\"unload\", this.onUnload.bind(this));\n\t}\n\n\tprivate async onReady(): Promise<void> {\n\t\tif (!this.config.apiKey) {\n\t\t\tthis.log.error(\"No API-Key definded!\");\n\t\t} else {\n\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\tawait this.GetStatusSchedule(this.config.apiKey);\n\n\t\t\tawait this.GetCustomerDetails(this.config.apiKey);\n\n\t\t\tawait this.subscribeStatesAsync(\"*\");\n\t\t}\n\t}\n\n\tprivate async GetStatusSchedule(apiKey: string): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tnextpollSchedule =\n\t\t\t\tnextpollSchedule ||\n\t\t\t\tthis.setTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tnextpollSchedule = null;\n\t\t\t\t\t\tthis.GetStatusSchedule(apiKey);\n\t\t\t\t\t},\n\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t);\n\n\t\t\tthis.buildRequest(\"statusschedule.php\", { api_key: this.config.apiKey })\n\t\t\t\t.then(async (response) => {\n\t\t\t\t\tif (response?.status === 200) {\n\t\t\t\t\t\tconst content = response.data;\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", true, true);\n\n\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.stopall\", {\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\ten: \"stop all zones\",\n\t\t\t\t\t\t\t\t\tde: \"alle Zonen stoppen\",\n\t\t\t\t\t\t\t\t\tru: \"\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B\",\n\t\t\t\t\t\t\t\t\tpt: \"parar todas as zonas\",\n\t\t\t\t\t\t\t\t\tnl: \"stop alle zones\",\n\t\t\t\t\t\t\t\t\tfr: \"arr\u00EAter toutes les zones\",\n\t\t\t\t\t\t\t\t\tit: \"fermare tutte le zone\",\n\t\t\t\t\t\t\t\t\tes: \"detener todas las zonas\",\n\t\t\t\t\t\t\t\t\tpl: \"zatrzymuj\u0105 wszystkie strefy\",\n\t\t\t\t\t\t\t\t\tuk: \"\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438\",\n\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62\u6240\u6709\u5730\u533A\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\t\t\trole: \"button.stop\",\n\t\t\t\t\t\t\t\tread: false,\n\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.runall\", {\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\ten: \"run all zones for x seconds\",\n\t\t\t\t\t\t\t\t\tde: \"alle Zonen f\u00FCr x Sekunden ausf\u00FChren\",\n\t\t\t\t\t\t\t\t\tru: \"\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\tpt: \"executar todas as zonas por x segundos\",\n\t\t\t\t\t\t\t\t\tnl: \"ren alle zones voor x seconden\",\n\t\t\t\t\t\t\t\t\tfr: \"ex\u00E9cuter toutes les zones pendant x secondes\",\n\t\t\t\t\t\t\t\t\tit: \"eseguire tutte le zone per x secondi\",\n\t\t\t\t\t\t\t\t\tes: \"ejecutar todas las zonas durante x segundos\",\n\t\t\t\t\t\t\t\t\tpl: \"wszystkie strefy startuj\u0105 dla x sekundy\",\n\t\t\t\t\t\t\t\t\tuk: \"\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u8DD1\u9053\u533A\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\tunit: \"seconds\",\n\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.suspendall\", {\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\ten: \"suspend all zones for x seconds\",\n\t\t\t\t\t\t\t\t\tde: \"alle Zonen f\u00FCr x Sekunden aussetzen\",\n\t\t\t\t\t\t\t\t\tru: \"\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\tpt: \"suspender todas as zonas por x segundos\",\n\t\t\t\t\t\t\t\t\tnl: \"vertaling:\",\n\t\t\t\t\t\t\t\t\tfr: \"suspendre toutes les zones pendant x secondes\",\n\t\t\t\t\t\t\t\t\tit: \"sospendere tutte le zone per x secondi\",\n\t\t\t\t\t\t\t\t\tes: \"suspender todas las zonas durante x segundos\",\n\t\t\t\t\t\t\t\t\tpl: \"wszystkie strefy zawieszenia dla x sekundy\",\n\t\t\t\t\t\t\t\t\tuk: \"\u043F\u0440\u0438\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62\u6240\u6709\u00D7\u4E8C\u533A\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tfor (let key in content) {\n\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\tif (key !== \"relays\" && key !== \"sensors\" && key !== \"expanders\" && !Number.isNaN(key)) {\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key === \"message\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key === \"message\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(`schedule.${key}`, content[key], true);\n\n\t\t\t\t\t\t\t\tif (key === \"time\") {\n\t\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(\"schedule.timestr\", {\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\t\tname: \"last api call\",\n\t\t\t\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t\t\t\t\trole: \"text\",\n\t\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\tconst t = new Date(content[key] * 1000);\n\n\t\t\t\t\t\t\t\t\tthis.setStateChangedAsync(\"schedule.timestr\", t.toString(), true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const relay of content.relays) {\n\t\t\t\t\t\t\tconst name = relay.relay;\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}`, {\n\t\t\t\t\t\t\t\ttype: \"channel\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: name.toString(),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tRELAYS[relay.relay] = relay.relay_id;\n\n\t\t\t\t\t\t\tfor (let key in relay) {\n\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key === \"name\" || key === \"timestr\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key === \"name\" || key === \"timestr\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tif (key === \"timestr\") {\n\t\t\t\t\t\t\t\t\tconst t = new Date();\n\t\t\t\t\t\t\t\t\tt.setSeconds(t.getSeconds() + relay.time);\n\t\t\t\t\t\t\t\t\trelay[key] = t.toString();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {\n\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\t\ten: \"stop zone\",\n\t\t\t\t\t\t\t\t\t\tde: \"Zone stoppen\",\n\t\t\t\t\t\t\t\t\t\tru: \"\u0437\u043E\u043D\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438\",\n\t\t\t\t\t\t\t\t\t\tpt: \"zona de paragem\",\n\t\t\t\t\t\t\t\t\t\tnl: \"stop zone\",\n\t\t\t\t\t\t\t\t\t\tfr: \"zone d ' arr\u00EAt\",\n\t\t\t\t\t\t\t\t\t\tit: \"zona di sosta\",\n\t\t\t\t\t\t\t\t\t\tes: \"zona de parada\",\n\t\t\t\t\t\t\t\t\t\tpl: \"strefa stopu\",\n\t\t\t\t\t\t\t\t\t\tuk: \"\u0437\u043E\u043D\u0430 \u0437\u0443\u043F\u0438\u043D\u043A\u0438\",\n\t\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62\u5730\u533A\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\t\t\t\trole: \"button.stop\",\n\t\t\t\t\t\t\t\t\tread: false,\n\t\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.runZone`, {\n\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\t\ten: \"run zone for x seconds\",\n\t\t\t\t\t\t\t\t\t\tde: \"Zone f\u00FCr x Sekunden starten\",\n\t\t\t\t\t\t\t\t\t\tru: \"\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\t\tpt: \"zona de execu\u00E7\u00E3o por x segundos\",\n\t\t\t\t\t\t\t\t\t\tnl: \"ren zone voor x seconden\",\n\t\t\t\t\t\t\t\t\t\tfr: \"zone de course pour x secondes\",\n\t\t\t\t\t\t\t\t\t\tit: \"zona di corsa per x secondi\",\n\t\t\t\t\t\t\t\t\t\tes: \"zona de ejecuci\u00F3n por x segundos\",\n\t\t\t\t\t\t\t\t\t\tpl: \"strefa x sekundy\",\n\t\t\t\t\t\t\t\t\t\tuk: \"\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u00D7\u4E8C\u533A\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.suspendZone`, {\n\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\t\ten: \"suspend zone for x seconds\",\n\t\t\t\t\t\t\t\t\t\tde: \"Zone f\u00FCr x Sekunden aussetzen\",\n\t\t\t\t\t\t\t\t\t\tru: \"\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B\",\n\t\t\t\t\t\t\t\t\t\tpt: \"zona de suspens\u00E3o por x segundos\",\n\t\t\t\t\t\t\t\t\t\tnl: \"quality over quantity (qoq) releases vertaling:\",\n\t\t\t\t\t\t\t\t\t\tfr: \"zone de suspension pour x secondes\",\n\t\t\t\t\t\t\t\t\t\tit: \"zona di sospensione per x secondi\",\n\t\t\t\t\t\t\t\t\t\tes: \"zona de suspensi\u00F3n por x segundos\",\n\t\t\t\t\t\t\t\t\t\tpl: \"strefa zawies\u0142a na x sekundy\",\n\t\t\t\t\t\t\t\t\t\tuk: \"\u0437\u043E\u043D\u0430 \u043F\u0456\u0434\u0432\u0456\u0441\u043A\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434\",\n\t\t\t\t\t\t\t\t\t\t\"zh-cn\": \"\u505C\u6B62x\u4E8C\u533A\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\trole: \"level\",\n\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.relay}.runDefault`, {\n\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t\t\t\ten: \"run zone for default time\",\n\t\t\t\t\t\t\t\t\t\tde: \"Zone mit Standardlaufzeit starten\",\n\t\t\t\t\t\t\t\t\t\tru: \"\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0434\u043B\u044F \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E\",\n\t\t\t\t\t\t\t\t\t\tpt: \"fuso de execu\u00E7\u00E3o para o tempo padr\u00E3o\",\n\t\t\t\t\t\t\t\t\t\tnl: \"run zone for default time\",\n\t\t\t\t\t\t\t\t\t\tfr: \"run zone for default time\",\n\t\t\t\t\t\t\t\t\t\tit: \"run zone per il tempo predefinito\",\n\t\t\t\t\t\t\t\t\t\tes: \"zona de ejecuci\u00F3n por tiempo predeterminado\",\n\t\t\t\t\t\t\t\t\t\tpl: \"strefa czasu domy\u015Blnego\",\n\t\t\t\t\t\t\t\t\t\tuk: \"\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C\",\n\t\t\t\t\t\t\t\t\t\t\"zh-cn\": \"a. \u6682\u505C\u65F6\u95F4\u533A\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\twrite: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const sensor of content.sensors) {\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}`, {\n\t\t\t\t\t\t\t\ttype: \"channel\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: \"sensors\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tfor (let key in sensor) {\n\t\t\t\t\t\t\t\tif (key !== \"relays\") {\n\t\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}.${key}`, {\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\t\t\t\t\t\trole: \"value\",\n\t\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\tthis.setStateChangedAsync(\n\t\t\t\t\t\t\t\t\t\t`schedule.sensors.${sensor.input}.${key}`,\n\t\t\t\t\t\t\t\t\t\tsensor[key],\n\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(response.status);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tif (error.response?.status === 429) {\n\t\t\t\t\t\tnextpollSchedule =\n\t\t\t\t\t\t\tnextpollSchedule ||\n\t\t\t\t\t\t\tthis.setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tnextpollSchedule = null;\n\t\t\t\t\t\t\t\t\tthis.GetStatusSchedule(apiKey);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t}\n\n\tprivate async GetCustomerDetails(apiKey: string): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tnextpollCustomer =\n\t\t\t\tnextpollCustomer ||\n\t\t\t\tthis.setTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tnextpollCustomer = null;\n\t\t\t\t\t\tthis.GetCustomerDetails(apiKey);\n\t\t\t\t\t},\n\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t);\n\n\t\t\tthis.buildRequest(\"customerdetails.php\", { api_key: this.config.apiKey })\n\t\t\t\t.then(async (response) => {\n\t\t\t\t\tif (response?.status === 200) {\n\t\t\t\t\t\tconst content = response.data;\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", true, true);\n\n\t\t\t\t\t\tfor (let key in content) {\n\t\t\t\t\t\t\tif (key !== \"controllers\" && !Number.isNaN(key)) {\n\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`customer.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key === \"message\" || key === \"current_controller\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key === \"message\" || key === \"current_controller\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(`customer.${key}`, content[key], true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const controller of content.controllers) {\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`customer.controllers.${controller.name}`, {\n\t\t\t\t\t\t\t\ttype: \"channel\",\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: controller.name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tfor (let key in controller) {\n\t\t\t\t\t\t\t\tkey = this.name2id(key);\n\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`customer.controllers.${controller.name}.${key}`, {\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\t\ttype: key !== \"controller_id\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key !== \"controller_id\" ? \"text\" : \"value\",\n\t\t\t\t\t\t\t\t\t\tread: true,\n\t\t\t\t\t\t\t\t\t\twrite: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tif (key === \"last_contact\") {\n\t\t\t\t\t\t\t\t\tconst t = new Date(controller[key] * 1000);\n\t\t\t\t\t\t\t\t\tcontroller[key] = t.toString();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.setStateChangedAsync(\n\t\t\t\t\t\t\t\t\t`customer.controllers.${controller.name}.${key}`,\n\t\t\t\t\t\t\t\t\tcontroller[key],\n\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(response.status);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tif (error.response?.status === 429) {\n\t\t\t\t\t\tnextpollCustomer =\n\t\t\t\t\t\t\tnextpollCustomer ||\n\t\t\t\t\t\t\tthis.setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tnextpollCustomer = null;\n\t\t\t\t\t\t\t\t\tthis.GetCustomerDetails(apiKey);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t5 * 60 * 1000,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n\t\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t}\n\n\tbuildRequest(service: string, params: any): Promise<any> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst url = `/api/v1/${service}`;\n\t\t\tlet lastErrorCode = 0;\n\n\t\t\tif (params.api_key) {\n\t\t\t\ttry {\n\t\t\t\t\taxios({\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\tbaseURL: hydrawise_url,\n\t\t\t\t\t\turl: url,\n\t\t\t\t\t\ttimeout: 30000,\n\t\t\t\t\t\tresponseType: \"json\",\n\t\t\t\t\t\tparams: params,\n\t\t\t\t\t})\n\t\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\t\t// no error - clear up reminder\n\t\t\t\t\t\t\tlastErrorCode = 0;\n\n\t\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tif (error.response) {\n\t\t\t\t\t\t\t\t// The request was made and the server responded with a status code\n\n\t\t\t\t\t\t\t\tthis.log.warn(\n\t\t\t\t\t\t\t\t\t`received ${\n\t\t\t\t\t\t\t\t\t\terror.response.status\n\t\t\t\t\t\t\t\t\t} response from ${url} with content: ${JSON.stringify(error.response.data)}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (error.request) {\n\t\t\t\t\t\t\t\t// The request was made but no response was received\n\t\t\t\t\t\t\t\t// `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n\t\t\t\t\t\t\t\t// http.ClientRequest in node.js\n\n\t\t\t\t\t\t\t\t// avoid spamming of the same error when stuck in a reconnection loop\n\t\t\t\t\t\t\t\tif (error.code === lastErrorCode) {\n\t\t\t\t\t\t\t\t\tthis.log.debug(error.message);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.log.info(`error ${error.code} from ${url}: ${error.message}`);\n\t\t\t\t\t\t\t\t\tlastErrorCode = error.code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Something happened in setting up the request that triggered an Error\n\t\t\t\t\t\t\t\tthis.log.error(error.message);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treject(\"API key is not configured\");\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Is called when adapter shuts down - callback has to be called under any circumstances!\n\t */\n\tprivate onUnload(callback: () => void): void {\n\t\ttry {\n\t\t\tthis.clearTimeout(nextpollSchedule);\n\t\t\tthis.clearTimeout(nextpollCustomer);\n\n\t\t\tcallback();\n\t\t} catch (e) {\n\t\t\tcallback();\n\t\t}\n\t}\n\n\t/**\n\t * Is called if a subscribed state changes\n\t */\n\tprivate onStateChange(id: string, state: ioBroker.State | null | undefined): void {\n\t\tif (state && !state.ack) {\n\t\t\tif (id.indexOf(\"stopall\") !== -1) {\n\t\t\t\tthis.buildRequest(\"setzone.php\", { api_key: this.config.apiKey, action: \"stopall\" });\n\t\t\t} else if (id.indexOf(\"stop\") !== -1) {\n\t\t\t\tconst relay = id.match(/.*schedule\\.(.*)\\.stopZone/);\n\n\t\t\t\tif (relay && relay?.length > 1) {\n\t\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\t\taction: \"stop\",\n\t\t\t\t\t\trelay_id: RELAYS[relay[1]],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (id.indexOf(\"runall\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\taction: \"runall\",\n\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\tcustom: state.val,\n\t\t\t\t});\n\t\t\t} else if (id.indexOf(\"runZone\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tconst relay = id.match(/.*schedule\\.(.*)\\.runZone/);\n\n\t\t\t\tif (relay && relay?.length > 1) {\n\t\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\t\taction: \"run\",\n\t\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\t\tcustom: state.val,\n\t\t\t\t\t\trelay_id: RELAYS[relay[1]],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (id.indexOf(\"runDefault\") !== -1 && state.val !== null) {\n\t\t\t\tthis.initRunDefault(id, state.val as boolean);\n\t\t\t}\n\n\t\t\tif (id.indexOf(\"suspendall\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tconst num = state.val as number;\n\n\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\taction: \"suspendall\",\n\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\tcustom: Math.trunc((state.ts + num) / 1000),\n\t\t\t\t});\n\t\t\t} else if (id.indexOf(\"suspend\") !== -1 && (state.val || state.val === 0)) {\n\t\t\t\tconst num = state.val as number;\n\t\t\t\tconst relay = id.match(/.*schedule\\.(.*)\\.suspendZone/);\n\n\t\t\t\tif (relay && relay?.length > 1) {\n\t\t\t\t\tthis.buildRequest(\"setzone.php\", {\n\t\t\t\t\t\tapi_key: this.config.apiKey,\n\t\t\t\t\t\taction: \"suspend\",\n\t\t\t\t\t\tperiod_id: 999,\n\t\t\t\t\t\tcustom: Math.trunc((state.ts + num) / 1000),\n\t\t\t\t\t\trelay_id: RELAYS[relay[1]],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tasync initRunDefault(id: string, run: boolean) {\n\t\tconst relay = id.match(/(.*schedule.*\\.)runDefault/);\n\n\t\tthis.clearTimeout(resetSwitch);\n\n\t\tif (relay) {\n\t\t\tif (run) {\n\t\t\t\tconst defaultRunTime = await this.getStateAsync(relay[1] + \"run\");\n\t\t\t\tif (defaultRunTime && defaultRunTime.val) {\n\t\t\t\t\tthis.setStateAsync(relay[1] + \"runZone\", defaultRunTime.val, false);\n\t\t\t\t\tresetSwitch = this.setTimeout(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tthis.setStateAsync(id, false, false);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(defaultRunTime.val as number) * 1000,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.setStateAsync(relay[1] + \"stopZone\", true, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tname2id(pName: string): string {\n\t\treturn (pName || \"\").replace(this.FORBIDDEN_CHARS, \"_\");\n\t}\n}\n\nif (require.main !== module) {\n\t// Export the constructor in compact mode\n\tmodule.exports = (options: Partial<utils.AdapterOptions> | undefined) => new Hydrawise(options);\n} else {\n\t// otherwise start the instance directly\n\t(() => new Hydrawise())();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAMA,YAAuB;AACvB,mBAAkB;AAElB,MAAM,gBAAgB;AACtB,IAAI,mBAAwB;AAC5B,IAAI,mBAAwB;AAC5B,IAAI,cAAmB;AACvB,MAAM,SAAc;AAEpB,MAAM,kBAAkB,MAAM,QAAQ;AAAA,EAC9B,YAAY,UAAyC,CAAC,GAAG;AAC/D,UAAM;AAAA,MACL,GAAG;AAAA,MACH,MAAM;AAAA,IACP,CAAC;AAED,SAAK,GAAG,SAAS,KAAK,QAAQ,KAAK,IAAI,CAAC;AACxC,SAAK,GAAG,eAAe,KAAK,cAAc,KAAK,IAAI,CAAC;AACpD,SAAK,GAAG,UAAU,KAAK,SA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O;AAC/F,OAAO;AAEN,GAAC,MAAM,IAAI,UAAU,GAAG;AACzB;",
|
|
6
6
|
"names": ["axios"]
|
|
7
7
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "hydrawise",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.2.2": {
|
|
7
|
+
"en": "fixed versions",
|
|
8
|
+
"de": "feste versionen",
|
|
9
|
+
"ru": "фиксированные версии",
|
|
10
|
+
"pt": "versões fixas",
|
|
11
|
+
"nl": "vertaling:",
|
|
12
|
+
"fr": "versions fixes",
|
|
13
|
+
"it": "versioni fisse",
|
|
14
|
+
"es": "versiones fijas",
|
|
15
|
+
"pl": "wersja stała",
|
|
16
|
+
"uk": "фіксовані версії",
|
|
17
|
+
"zh-cn": "固定版本"
|
|
18
|
+
},
|
|
19
|
+
"0.2.1": {
|
|
20
|
+
"en": "added button to run zone for default runtime",
|
|
21
|
+
"de": "Schaltfläche zum Ausführen der Zone für Standardlaufzeit",
|
|
22
|
+
"ru": "добавлена кнопка для запуска зоны для по умолчанию runtime",
|
|
23
|
+
"pt": "botão adicionado para executar a zona para o tempo de execução padrão",
|
|
24
|
+
"nl": "voegde knop toe om zone te runnen voor mishandeling",
|
|
25
|
+
"fr": "bouton ajouté pour la zone de course par défaut",
|
|
26
|
+
"it": "pulsante aggiunto per eseguire la zona per runtime predefinito",
|
|
27
|
+
"es": "botón añadido para ejecutar la zona por defecto",
|
|
28
|
+
"pl": "przycisk",
|
|
29
|
+
"uk": "додана кнопка для запуску зони за замовчуванням",
|
|
30
|
+
"zh-cn": "增拨但停顿区"
|
|
31
|
+
},
|
|
6
32
|
"0.1.2": {
|
|
7
33
|
"en": "added link to api docu",
|
|
8
34
|
"de": "link zu api docu",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "adaptacja adaptatora",
|
|
68
94
|
"uk": "фіксований аварійний адаптер",
|
|
69
95
|
"zh-cn": "b. 固定适应器"
|
|
70
|
-
},
|
|
71
|
-
"0.0.16": {
|
|
72
|
-
"en": "added more information to README\nencrypted apiKey\nremoved logging of apiKey\nadded filtering of invalid characters in ids\nadded check of ack flag\nfixed roles\nfixed error message\nremoved usage of clearTimeout",
|
|
73
|
-
"de": "weitere Informationen zu README\nverschlüsselt api Schlüssel\nentfernte Protokollierung von api Schlüssel\nfiltern von ungültigen zeichen in ids\nzusätzlicher check von ack flag\nfeste rollen\nfeste fehlermeldung\nentfernte Verwendung von klar Zeit",
|
|
74
|
-
"ru": "добавлена дополнительная информация для README\nзашифрованный api Ключ\nудалили логирование api Ключ\nдобавлена фильтрация недействительных символов в ids\nдобавлена проверка флага ack\nфиксированные роли\nфиксированное сообщение об ошибке\nудаленное использование ясно Тайм-аут",
|
|
75
|
-
"pt": "adicionado mais informações para LERME\napi criptografado Chaveiro\nlog removido de api Chaveiro\nadicionado filtragem de caracteres inválidos em ids\nadicionado check of ack flag\npapéis fixos\nmensagem de erro fixo\nuso removido de claro Timeout",
|
|
76
|
-
"nl": "voegde meer informatie toe aan\ngecodeerde api Sleutel\nverwijderde logging Sleutel\nvoegde toegevoegd van invalide personages in id\nvertaling:\ngerepareerde rollen\nvergissing\nverwijder het gebruik Time-out",
|
|
77
|
-
"fr": "ajouté plus d'informations à README\ncrypté api Key\nenlèvement de l ' api Key\nfiltrage des caractères invalides dans les ids\nvérification supplémentaire du drapeau ack\nrôles fixes\nmessage d ' erreur\nl ' utilisation supprimée Timeout",
|
|
78
|
-
"it": "maggiori informazioni su README\napi crittografato Chiave\nlogging rimosso di api Chiave\nfiltraggio aggiunto di caratteri non validi in ids\ncontrollo aggiunto della bandiera di ack\nruoli fissi\nmessaggio di errore fisso\nuso rimosso di chiaro Tempo",
|
|
79
|
-
"es": "añadir más información a README\nencriptado api Clave\nextracción de registro de api Clave\nfiltro añadido de caracteres inválidos en ids\ncheque añadido de la bandera de la cubierta\nfunciones fijas\nmensaje de error fijo\nuso eliminado de clara Timeout",
|
|
80
|
-
"pl": "dodano więcej informacji na temat README\nszyfrowanie api Key\nusunięta logika api Key\ndodał filtrowanie nieprawidłowych postaci w idsach\ndodać się do flagi\nrola stała\nbłędy\nusunąć Timeout",
|
|
81
|
-
"uk": "додано більше інформації\nзашифрований api Головна\nвидалений загін апі Головна\nдодано фільтрування недійсних символів у ids\nдодано перевірку ack прапора\nфіксовані ролі\nфіксоване повідомлення про помилку\nвидалення використання прозорого Розклад",
|
|
82
|
-
"zh-cn": "d. 增加中小企业的更多信息\n加密处 关键\n拆除管道 关键\n添加过滤剂中的无效性\n进一步检查旗帜\n固定作用\n固定错误信息\n删除明确用途 时限"
|
|
83
|
-
},
|
|
84
|
-
"0.0.15": {
|
|
85
|
-
"en": "updated dependencies",
|
|
86
|
-
"de": "aktualisierte abhängigkeiten",
|
|
87
|
-
"ru": "обновленные зависимости",
|
|
88
|
-
"pt": "dependências atualizadas",
|
|
89
|
-
"nl": "vertaling:",
|
|
90
|
-
"fr": "dépendances actualisées",
|
|
91
|
-
"it": "dipendenze aggiornate",
|
|
92
|
-
"es": "dependencias actualizadas",
|
|
93
|
-
"pl": "zależności aktualizacji",
|
|
94
|
-
"uk": "оновлені залежності",
|
|
95
|
-
"zh-cn": "二. 最新依赖"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.hydrawise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Adapter to control the Hydrawise irrigation control system",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SentiQ",
|
|
@@ -42,21 +42,21 @@
|
|
|
42
42
|
"@types/sinon-chai": "^3.2.9",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
44
44
|
"@typescript-eslint/parser": "^5.60.1",
|
|
45
|
-
"chai": "^4.3.
|
|
45
|
+
"chai": "^4.3.8",
|
|
46
46
|
"chai-as-promised": "^7.1.1",
|
|
47
|
-
"eslint": "^8.
|
|
48
|
-
"eslint-config-prettier": "^
|
|
47
|
+
"eslint": "^8.48.0",
|
|
48
|
+
"eslint-config-prettier": "^9.0.0",
|
|
49
49
|
"eslint-plugin-prettier": "^5.0.0",
|
|
50
50
|
"mocha": "^10.2.0",
|
|
51
51
|
"nyc": "^15.1.0",
|
|
52
|
-
"prettier": "^3.0.
|
|
52
|
+
"prettier": "^3.0.3",
|
|
53
53
|
"proxyquire": "^2.1.3",
|
|
54
54
|
"rimraf": "^5.0.1",
|
|
55
55
|
"sinon": "^15.2.0",
|
|
56
56
|
"sinon-chai": "^3.7.0",
|
|
57
57
|
"source-map-support": "^0.5.21",
|
|
58
58
|
"ts-node": "^10.9.1",
|
|
59
|
-
"typescript": "~5.
|
|
59
|
+
"typescript": "~5.2.2"
|
|
60
60
|
},
|
|
61
61
|
"main": "build/main.js",
|
|
62
62
|
"files": [
|