iobroker.hydrawise 0.2.8 → 0.3.3

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 CHANGED
@@ -39,6 +39,24 @@ 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.3.3 (2024-04-22)
43
+
44
+ - (SentiQ) updated dependencies
45
+
46
+ ### 0.3.2 (2024-04-19)
47
+
48
+ - (SentiQ) added default value to parameter `apiInterval`
49
+ - (SentiQ) added translations
50
+
51
+ ### 0.3.1 (2024-04-18)
52
+
53
+ - (SentiQ) removed parameter `apiKey` in method call
54
+
55
+ ### 0.3.0 (2024-04-18)
56
+
57
+ - (SentiQ) added api interval to settings
58
+ - (SentiQ) changed interval of schedule endpoint from 5 minutes to 1 minute
59
+
42
60
  ### 0.2.8 (2024-04-08)
43
61
 
44
62
  - (SentiQ) fixed tier and license
@@ -166,7 +184,7 @@ You can see all controller information, schedules and sensors. It is also possib
166
184
 
167
185
  MIT License
168
186
 
169
- Copyright (c) 2024 SentiQ <fischer.yves@web.de>
187
+ Copyright (c) 2024 SentiQ <yves.nuesser@proton.me>
170
188
 
171
189
  Permission is hereby granted, free of charge, to any person obtaining a copy
172
190
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Adaptereinstellungen für hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "API-Intervall (in Sekunden)",
3
+ "api key": "API-Schlüssel",
4
+ "how to get token": "So erhalten Sie ein Token"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Adapter settings for hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "API interval (in seconds)",
3
+ "api key": "API-Key",
4
+ "how to get token": "How to get a token"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Ajustes del adaptador para hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "Intervalo API (en segundos)",
3
+ "api key": "Clave API",
4
+ "how to get token": "Como conseguir ficha"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Paramètres d'adaptateur pour hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "Intervalle API (en secondes)",
3
+ "api key": "Clé API",
4
+ "how to get token": "Comment obtenir un jeton"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Impostazioni dell'adattatore per hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "Intervallo API (in secondi)",
3
+ "api key": "Chiave API",
4
+ "how to get token": "Come ottenere il gettone"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Adapterinstellingen voor hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "API-interval (in seconden)",
3
+ "api key": "API sleutel",
4
+ "how to get token": "Hoe een token te verkrijgen"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Ustawienia adaptera dla hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "Interwał API (w sekundach)",
3
+ "api key": "Klucz API",
4
+ "how to get token": "Jak zdobyć token"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Configurações do adaptador para hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "Intervalo de API (em segundos)",
3
+ "api key": "Chave API",
4
+ "how to get token": "Como obter token"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "Настройки адаптера для hydrawise",
3
- "apiKey": "API-Key"
2
+ "api interval": "Интервал API секундах)",
3
+ "api key": "API-ключ",
4
+ "how to get token": "Как получить токен"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "параметри адаптера гідра",
3
- "apiKey": "API-Key"
2
+ "api interval": "Інтервал API (у секундах)",
3
+ "api key": "API-ключ",
4
+ "how to get token": "Як отримати токен"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
- "hydrawise adapter settings": "hydrawise的适配器设置",
3
- "apiKey": "API-Key"
2
+ "api interval": "API 间隔(以秒为单位)",
3
+ "api key": "API密钥",
4
+ "how to get token": "如何获取代币"
4
5
  }
@@ -1,11 +1,20 @@
1
1
  {
2
- "i18n": true,
3
- "type": "panel",
4
- "items": {
5
- "apiKey": {
6
- "type": "text",
7
- "label": "API-Key",
8
- "newLine": true
9
- }
10
- }
2
+ "i18n": true,
3
+ "type": "panel",
4
+ "items": {
5
+ "apiKey": {
6
+ "type": "text",
7
+ "label": "api key",
8
+ "newLine": true,
9
+ "help": "how to get token",
10
+ "helpLink": "https://github.com/SentiQ/ioBroker.hydrawise/blob/main/README.md#documentation"
11
+ },
12
+ "apiInterval": {
13
+ "type": "number",
14
+ "label": "api interval",
15
+ "newLine": true,
16
+ "default": 60,
17
+ "min": 15
18
+ }
19
+ }
11
20
  }
package/admin/words.js ADDED
@@ -0,0 +1,14 @@
1
+ /*global systemDictionary:true */
2
+ /*
3
+ +===================== DO NOT MODIFY ======================+
4
+ | This file was generated by translate-adapter, please use |
5
+ | `translate-adapter adminLanguages2words` to update it. |
6
+ +===================== DO NOT MODIFY ======================+
7
+ */
8
+ 'use strict';
9
+
10
+ systemDictionary = {
11
+ "api interval": { "en": "API interval (in seconds)", "de": "API-Intervall (in Sekunden)", "ru": "Интервал API (в секундах)", "pt": "Intervalo de API (em segundos)", "nl": "API-interval (in seconden)", "fr": "Intervalle API (en secondes)", "it": "Intervallo API (in secondi)", "es": "Intervalo API (en segundos)", "pl": "Interwał API (w sekundach)", "uk": "Інтервал API (у секундах)", "zh-cn": "API 间隔(以秒为单位)"},
12
+ "api key": { "en": "API-Key", "de": "API-Schlüssel", "ru": "API-ключ", "pt": "Chave API", "nl": "API sleutel", "fr": "Clé API", "it": "Chiave API", "es": "Clave API", "pl": "Klucz API", "uk": "API-ключ", "zh-cn": "API密钥"},
13
+ "how to get token": { "en": "How to get a token", "de": "So erhalten Sie ein Token", "ru": "Как получить токен", "pt": "Como obter token", "nl": "Hoe een token te verkrijgen", "fr": "Comment obtenir un jeton", "it": "Come ottenere il gettone", "es": "Como conseguir ficha", "pl": "Jak zdobyć token", "uk": "Як отримати токен", "zh-cn": "如何获取代币"},
14
+ };
package/build/main.js CHANGED
@@ -40,23 +40,25 @@ class Hydrawise extends utils.Adapter {
40
40
  }
41
41
  async onReady() {
42
42
  if (!this.config.apiKey) {
43
- this.log.error("No API-Key definded!");
43
+ this.log.error("No API-Key defined!");
44
44
  } else {
45
45
  this.setStateChangedAsync("info.connection", false, true);
46
- await this.GetStatusSchedule(this.config.apiKey);
47
- await this.GetCustomerDetails(this.config.apiKey);
46
+ await this.GetStatusSchedule();
47
+ nextpollSchedule = this.setInterval(async () => {
48
+ await this.GetStatusSchedule();
49
+ }, this.config.apiInterval * 1e3);
50
+ await this.GetCustomerDetails();
51
+ nextpollCustomer = this.setInterval(
52
+ async () => {
53
+ await this.GetCustomerDetails();
54
+ },
55
+ 5 * 60 * 1e3
56
+ );
48
57
  await this.subscribeStatesAsync("*");
49
58
  }
50
59
  }
51
- async GetStatusSchedule(apiKey) {
60
+ async GetStatusSchedule() {
52
61
  return new Promise((resolve, reject) => {
53
- nextpollSchedule = nextpollSchedule || this.setTimeout(
54
- () => {
55
- nextpollSchedule = null;
56
- this.GetStatusSchedule(apiKey);
57
- },
58
- 5 * 60 * 1e3
59
- );
60
62
  this.buildRequest("statusschedule.php", { api_key: this.config.apiKey }).then(async (response) => {
61
63
  if ((response == null ? void 0 : response.status) === 200) {
62
64
  const content = response.data;
@@ -308,11 +310,7 @@ class Hydrawise extends utils.Adapter {
308
310
  },
309
311
  native: {}
310
312
  });
311
- this.setStateChangedAsync(
312
- `schedule.sensors.${sensor.input}.${key}`,
313
- sensor[key],
314
- true
315
- );
313
+ this.setStateChangedAsync(`schedule.sensors.${sensor.input}.${key}`, sensor[key], true);
316
314
  }
317
315
  }
318
316
  }
@@ -320,14 +318,11 @@ class Hydrawise extends utils.Adapter {
320
318
  resolve(response.status);
321
319
  }).catch((error) => {
322
320
  var _a;
321
+ this.clearInterval(nextpollSchedule);
323
322
  if (((_a = error.response) == null ? void 0 : _a.status) === 429) {
324
- nextpollSchedule = nextpollSchedule || this.setTimeout(
325
- () => {
326
- nextpollSchedule = null;
327
- this.GetStatusSchedule(apiKey);
328
- },
329
- 5 * 60 * 1e3
330
- );
323
+ nextpollSchedule = this.setInterval(async () => {
324
+ await this.GetStatusSchedule();
325
+ }, this.config.apiInterval * 1e3);
331
326
  } else {
332
327
  this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);
333
328
  this.setStateChangedAsync("info.connection", false, true);
@@ -336,15 +331,8 @@ class Hydrawise extends utils.Adapter {
336
331
  });
337
332
  });
338
333
  }
339
- async GetCustomerDetails(apiKey) {
334
+ async GetCustomerDetails() {
340
335
  return new Promise((resolve, reject) => {
341
- nextpollCustomer = nextpollCustomer || this.setTimeout(
342
- () => {
343
- nextpollCustomer = null;
344
- this.GetCustomerDetails(apiKey);
345
- },
346
- 5 * 60 * 1e3
347
- );
348
336
  this.buildRequest("customerdetails.php", { api_key: this.config.apiKey }).then(async (response) => {
349
337
  if ((response == null ? void 0 : response.status) === 200) {
350
338
  const content = response.data;
@@ -391,11 +379,7 @@ class Hydrawise extends utils.Adapter {
391
379
  const t = new Date(controller[key] * 1e3);
392
380
  controller[key] = t.toString();
393
381
  }
394
- this.setStateChangedAsync(
395
- `customer.controllers.${controller.name}.${key}`,
396
- controller[key],
397
- true
398
- );
382
+ this.setStateChangedAsync(`customer.controllers.${controller.name}.${key}`, controller[key], true);
399
383
  }
400
384
  }
401
385
  }
@@ -403,10 +387,10 @@ class Hydrawise extends utils.Adapter {
403
387
  }).catch((error) => {
404
388
  var _a;
405
389
  if (((_a = error.response) == null ? void 0 : _a.status) === 429) {
406
- nextpollCustomer = nextpollCustomer || this.setTimeout(
407
- () => {
408
- nextpollCustomer = null;
409
- this.GetCustomerDetails(apiKey);
390
+ this.clearInterval(nextpollCustomer);
391
+ nextpollCustomer = this.setInterval(
392
+ async () => {
393
+ await this.GetCustomerDetails();
410
394
  },
411
395
  5 * 60 * 1e3
412
396
  );
@@ -436,9 +420,7 @@ class Hydrawise extends utils.Adapter {
436
420
  resolve(response);
437
421
  }).catch((error) => {
438
422
  if (error.response) {
439
- this.log.warn(
440
- `received ${error.response.status} response from ${url} with content: ${JSON.stringify(error.response.data)}`
441
- );
423
+ this.log.warn(`received ${error.response.status} response from ${url} with content: ${JSON.stringify(error.response.data)}`);
442
424
  } else if (error.request) {
443
425
  if (error.code === lastErrorCode) {
444
426
  this.log.debug(error.message);
@@ -464,8 +446,8 @@ class Hydrawise extends utils.Adapter {
464
446
  */
465
447
  onUnload(callback) {
466
448
  try {
467
- this.clearTimeout(nextpollSchedule);
468
- this.clearTimeout(nextpollCustomer);
449
+ this.clearInterval(nextpollSchedule);
450
+ this.clearInterval(nextpollCustomer);
469
451
  callback();
470
452
  } catch (e) {
471
453
  callback();
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;\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: \"button.start\",\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;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,aAAa,WAAW;AAE7B,QAAI,OAAO;AACV,UAAI,KAAK;AACR,cAAM,iBAAiB,MAAM,KAAK,cAAc,MAAM,CAAC,IAAI,KAAK;AAChE,YAAI,kBAAkB,eAAe,KAAK;AACzC,eAAK,cAAc,MAAM,CAAC,IAAI,WAAW,eAAe,KAAK,KAAK;AAClE,wBAAc,KAAK;AAAA,YAClB,MAAM;AACL,mBAAK,cAAc,IAAI,OAAO,KAAK;AAAA,YACpC;AAAA,YACC,eAAe,MAAiB;AAAA,UAClC;AAAA,QACD;AAAA,MACD,OAAO;AACN,aAAK,cAAc,MAAM,CAAC,IAAI,YAAY,MAAM,KAAK;AAAA,MACtD;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 public constructor(options: Partial<utils.AdapterOptions> = {}) {\n super({\n ...options,\n name: 'hydrawise',\n });\n\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n private async onReady(): Promise<void> {\n if (!this.config.apiKey) {\n this.log.error('No API-Key defined!');\n } else {\n this.setStateChangedAsync('info.connection', false, true);\n\n await this.GetStatusSchedule();\n\n nextpollSchedule = this.setInterval(async () => {\n await this.GetStatusSchedule();\n }, this.config.apiInterval * 1000);\n\n await this.GetCustomerDetails();\n\n nextpollCustomer = this.setInterval(\n async () => {\n await this.GetCustomerDetails();\n },\n 5 * 60 * 1000,\n );\n\n await this.subscribeStatesAsync('*');\n }\n }\n\n private async GetStatusSchedule(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.buildRequest('statusschedule.php', { api_key: this.config.apiKey })\n .then(async (response) => {\n if (response?.status === 200) {\n const content = response.data;\n\n this.setStateChangedAsync('info.connection', true, true);\n\n await this.setObjectNotExistsAsync('schedule.stopall', {\n type: 'state',\n common: {\n name: {\n en: 'stop all zones',\n de: 'alle Zonen stoppen',\n ru: '\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B',\n pt: 'parar todas as zonas',\n nl: 'stop alle zones',\n fr: 'arr\u00EAter toutes les zones',\n it: 'fermare tutte le zone',\n es: 'detener todas las zonas',\n pl: 'zatrzymuj\u0105 wszystkie strefy',\n uk: '\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438',\n 'zh-cn': '\u505C\u6B62\u6240\u6709\u5730\u533A',\n },\n type: 'boolean',\n role: 'button.stop',\n read: false,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync('schedule.runall', {\n type: 'state',\n common: {\n name: {\n en: 'run all zones for x seconds',\n de: 'alle Zonen f\u00FCr x Sekunden ausf\u00FChren',\n ru: '\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 pt: 'executar todas as zonas por x segundos',\n nl: 'ren alle zones voor x seconden',\n fr: 'ex\u00E9cuter toutes les zones pendant x secondes',\n it: 'eseguire tutte le zone per x secondi',\n es: 'ejecutar todas las zonas durante x segundos',\n pl: 'wszystkie strefy startuj\u0105 dla x sekundy',\n uk: '\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 'zh-cn': '\u8DD1\u9053\u533A',\n },\n type: 'number',\n role: 'level',\n unit: 'seconds',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync('schedule.suspendall', {\n type: 'state',\n common: {\n name: {\n en: 'suspend all zones for x seconds',\n de: 'alle Zonen f\u00FCr x Sekunden aussetzen',\n ru: '\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 pt: 'suspender todas as zonas por x segundos',\n nl: 'vertaling:',\n fr: 'suspendre toutes les zones pendant x secondes',\n it: 'sospendere tutte le zone per x secondi',\n es: 'suspender todas las zonas durante x segundos',\n pl: 'wszystkie strefy zawieszenia dla x sekundy',\n uk: '\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 'zh-cn': '\u505C\u6B62\u6240\u6709\u00D7\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n for (let key in content) {\n key = this.name2id(key);\n\n if (key !== 'relays' && key !== 'sensors' && key !== 'expanders' && !Number.isNaN(key)) {\n await this.setObjectNotExistsAsync(`schedule.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'message' ? 'string' : 'number',\n role: key === 'message' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n this.setStateChangedAsync(`schedule.${key}`, content[key], true);\n\n if (key === 'time') {\n await this.setObjectNotExistsAsync('schedule.timestr', {\n type: 'state',\n common: {\n name: 'last api call',\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n\n const t = new Date(content[key] * 1000);\n\n this.setStateChangedAsync('schedule.timestr', t.toString(), true);\n }\n }\n }\n\n for (const relay of content.relays) {\n const name = relay.relay;\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}`, {\n type: 'channel',\n common: {\n name: name.toString(),\n },\n native: {},\n });\n\n RELAYS[relay.relay] = relay.relay_id;\n\n for (let key in relay) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'name' || key === 'timestr' ? 'string' : 'number',\n role: key === 'name' || key === 'timestr' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (key === 'timestr') {\n const t = new Date();\n t.setSeconds(t.getSeconds() + relay.time);\n relay[key] = t.toString();\n }\n\n this.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);\n }\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {\n type: 'state',\n common: {\n name: {\n en: 'stop zone',\n de: 'Zone stoppen',\n ru: '\u0437\u043E\u043D\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438',\n pt: 'zona de paragem',\n nl: 'stop zone',\n fr: \"zone d ' arr\u00EAt\",\n it: 'zona di sosta',\n es: 'zona de parada',\n pl: 'strefa stopu',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0443\u043F\u0438\u043D\u043A\u0438',\n 'zh-cn': '\u505C\u6B62\u5730\u533A',\n },\n type: 'boolean',\n role: 'button.stop',\n read: false,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runZone`, {\n type: 'state',\n common: {\n name: {\n en: 'run zone for x seconds',\n de: 'Zone f\u00FCr x Sekunden starten',\n ru: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'zona de execu\u00E7\u00E3o por x segundos',\n nl: 'ren zone voor x seconden',\n fr: 'zone de course pour x secondes',\n it: 'zona di corsa per x secondi',\n es: 'zona de ejecuci\u00F3n por x segundos',\n pl: 'strefa x sekundy',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u00D7\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.suspendZone`, {\n type: 'state',\n common: {\n name: {\n en: 'suspend zone for x seconds',\n de: 'Zone f\u00FCr x Sekunden aussetzen',\n ru: '\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 pt: 'zona de suspens\u00E3o por x segundos',\n nl: 'quality over quantity (qoq) releases vertaling:',\n fr: 'zone de suspension pour x secondes',\n it: 'zona di sospensione per x secondi',\n es: 'zona de suspensi\u00F3n por x segundos',\n pl: 'strefa zawies\u0142a na x sekundy',\n uk: '\u0437\u043E\u043D\u0430 \u043F\u0456\u0434\u0432\u0456\u0441\u043A\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u505C\u6B62x\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runDefault`, {\n type: 'state',\n common: {\n name: {\n en: 'run zone for default time',\n de: 'Zone mit Standardlaufzeit starten',\n 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',\n pt: 'fuso de execu\u00E7\u00E3o para o tempo padr\u00E3o',\n nl: 'run zone for default time',\n fr: 'run zone for default time',\n it: 'run zone per il tempo predefinito',\n es: 'zona de ejecuci\u00F3n por tiempo predeterminado',\n pl: 'strefa czasu domy\u015Blnego',\n 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',\n 'zh-cn': 'a. \u6682\u505C\u65F6\u95F4\u533A',\n },\n type: 'boolean',\n role: 'button.start',\n read: true,\n write: true,\n },\n native: {},\n });\n }\n\n for (const sensor of content.sensors) {\n await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}`, {\n type: 'channel',\n common: {\n name: 'sensors',\n },\n native: {},\n });\n\n for (let key in sensor) {\n if (key !== 'relays') {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: 'number',\n role: 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n this.setStateChangedAsync(`schedule.sensors.${sensor.input}.${key}`, sensor[key], true);\n }\n }\n }\n }\n\n resolve(response.status);\n })\n .catch((error) => {\n this.clearInterval(nextpollSchedule);\n\n if (error.response?.status === 429) {\n nextpollSchedule = this.setInterval(async () => {\n await this.GetStatusSchedule();\n }, this.config.apiInterval * 1000);\n } else {\n this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n this.setStateChangedAsync('info.connection', false, true);\n\n reject(error);\n }\n });\n });\n }\n\n private async GetCustomerDetails(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.buildRequest('customerdetails.php', { api_key: this.config.apiKey })\n .then(async (response) => {\n if (response?.status === 200) {\n const content = response.data;\n\n this.setStateChangedAsync('info.connection', true, true);\n\n for (let key in content) {\n if (key !== 'controllers' && !Number.isNaN(key)) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`customer.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'message' || key === 'current_controller' ? 'string' : 'number',\n role: key === 'message' || key === 'current_controller' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n this.setStateChangedAsync(`customer.${key}`, content[key], true);\n }\n }\n\n for (const controller of content.controllers) {\n await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}`, {\n type: 'channel',\n common: {\n name: controller.name,\n },\n native: {},\n });\n\n for (let key in controller) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key !== 'controller_id' ? 'string' : 'number',\n role: key !== 'controller_id' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (key === 'last_contact') {\n const t = new Date(controller[key] * 1000);\n controller[key] = t.toString();\n }\n\n this.setStateChangedAsync(`customer.controllers.${controller.name}.${key}`, controller[key], true);\n }\n }\n }\n\n resolve(response.status);\n })\n .catch((error) => {\n if (error.response?.status === 429) {\n this.clearInterval(nextpollCustomer);\n\n nextpollCustomer = this.setInterval(\n async () => {\n await this.GetCustomerDetails();\n },\n 5 * 60 * 1000,\n );\n } else {\n this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n this.setStateChangedAsync('info.connection', false, true);\n\n reject(error);\n }\n });\n });\n }\n\n buildRequest(service: string, params: any): Promise<any> {\n return new Promise((resolve, reject) => {\n const url = `/api/v1/${service}`;\n let lastErrorCode = 0;\n\n if (params.api_key) {\n try {\n axios({\n method: 'GET',\n baseURL: hydrawise_url,\n url: url,\n timeout: 30000,\n responseType: 'json',\n params: params,\n })\n .then((response) => {\n // no error - clear up reminder\n lastErrorCode = 0;\n\n resolve(response);\n })\n .catch((error) => {\n if (error.response) {\n // The request was made and the server responded with a status code\n\n this.log.warn(`received ${error.response.status} response from ${url} with content: ${JSON.stringify(error.response.data)}`);\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n // http.ClientRequest in node.js\n\n // avoid spamming of the same error when stuck in a reconnection loop\n if (error.code === lastErrorCode) {\n this.log.debug(error.message);\n } else {\n this.log.info(`error ${error.code} from ${url}: ${error.message}`);\n lastErrorCode = error.code;\n }\n } else {\n // Something happened in setting up the request that triggered an Error\n this.log.error(error.message);\n }\n\n reject(error);\n });\n } catch (error) {\n reject(error);\n }\n } else {\n reject('API key is not configured');\n }\n });\n }\n\n /**\n * Is called when adapter shuts down - callback has to be called under any circumstances!\n */\n private onUnload(callback: () => void): void {\n try {\n this.clearInterval(nextpollSchedule);\n this.clearInterval(nextpollCustomer);\n\n callback();\n } catch (e) {\n callback();\n }\n }\n\n /**\n * Is called if a subscribed state changes\n */\n private onStateChange(id: string, state: ioBroker.State | null | undefined): void {\n if (state && !state.ack) {\n if (id.indexOf('stopall') !== -1) {\n this.buildRequest('setzone.php', { api_key: this.config.apiKey, action: 'stopall' });\n } else if (id.indexOf('stop') !== -1) {\n const relay = id.match(/.*schedule\\.(.*)\\.stopZone/);\n\n if (relay && relay?.length > 1) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'stop',\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n if (id.indexOf('runall') !== -1 && (state.val || state.val === 0)) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'runall',\n period_id: 999,\n custom: state.val,\n });\n } else if (id.indexOf('runZone') !== -1 && (state.val || state.val === 0)) {\n const relay = id.match(/.*schedule\\.(.*)\\.runZone/);\n\n if (relay && relay?.length > 1) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'run',\n period_id: 999,\n custom: state.val,\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n\n if (id.indexOf('runDefault') !== -1 && state.val !== null) {\n this.initRunDefault(id, state.val as boolean);\n }\n\n if (id.indexOf('suspendall') !== -1 && (state.val || state.val === 0)) {\n const num = state.val as number;\n\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'suspendall',\n period_id: 999,\n custom: Math.trunc((state.ts + num) / 1000),\n });\n } else if (id.indexOf('suspend') !== -1 && (state.val || state.val === 0)) {\n const num = state.val as number;\n const relay = id.match(/.*schedule\\.(.*)\\.suspendZone/);\n\n if (relay && relay?.length > 1) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'suspend',\n period_id: 999,\n custom: Math.trunc((state.ts + num) / 1000),\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n }\n }\n\n async initRunDefault(id: string, run: boolean): Promise<void> {\n const relay = id.match(/(.*schedule.*\\.)runDefault/);\n\n this.clearTimeout(resetSwitch);\n\n if (relay) {\n if (run) {\n const defaultRunTime = await this.getStateAsync(relay[1] + 'run');\n if (defaultRunTime && defaultRunTime.val) {\n this.setStateAsync(relay[1] + 'runZone', defaultRunTime.val, false);\n resetSwitch = this.setTimeout(\n () => {\n this.setStateAsync(id, false, false);\n },\n (defaultRunTime.val as number) * 1000,\n );\n }\n } else {\n this.setStateAsync(relay[1] + 'stopZone', true, false);\n }\n }\n }\n\n name2id(pName: string): string {\n return (pName || '').replace(this.FORBIDDEN_CHARS, '_');\n }\n}\n\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial<utils.AdapterOptions> | undefined) => new Hydrawise(options);\n} else {\n // otherwise start the instance directly\n (() => 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,EAC3B,YAAY,UAAyC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e,KAAK;AACtC,eAAK,cAAc,MAAM,CAAC,IAAI,WAAW,eAAe,KAAK,KAAK;AAClE,wBAAc,KAAK;AAAA,YACf,MAAM;AACF,mBAAK,cAAc,IAAI,OAAO,KAAK;AAAA,YACvC;AAAA,YACC,eAAe,MAAiB;AAAA,UACrC;AAAA,QACJ;AAAA,MACJ,OAAO;AACH,aAAK,cAAc,MAAM,CAAC,IAAI,YAAY,MAAM,KAAK;AAAA,MACzD;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,QAAQ,OAAuB;AAC3B,YAAQ,SAAS,IAAI,QAAQ,KAAK,iBAAiB,GAAG;AAAA,EAC1D;AACJ;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAEzB,SAAO,UAAU,CAAC,YAAuD,IAAI,UAAU,OAAO;AAClG,OAAO;AAEH,GAAC,MAAM,IAAI,UAAU,GAAG;AAC5B;",
6
6
  "names": ["axios"]
7
7
  }
package/io-package.json CHANGED
@@ -1,8 +1,60 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "hydrawise",
4
- "version": "0.2.8",
4
+ "version": "0.3.3",
5
5
  "news": {
6
+ "0.3.3": {
7
+ "en": "updated dependencies",
8
+ "de": "aktualisierte abhängigkeiten",
9
+ "ru": "обновленные зависимости",
10
+ "pt": "dependências atualizadas",
11
+ "nl": "bijgewerkte afhankelijkheden",
12
+ "fr": "dépendances actualisées",
13
+ "it": "dipendenze aggiornate",
14
+ "es": "dependencias actualizadas",
15
+ "pl": "zaktualizowane zależności",
16
+ "uk": "оновлені залежності",
17
+ "zh-cn": "更新的依赖关系"
18
+ },
19
+ "0.3.2": {
20
+ "en": "added default value to parameter `apiInterval`\nadded translations",
21
+ "de": "standardwert zum Parameter `apiInterval `\nübersetzungen",
22
+ "ru": "добавленное значение по умолчанию для параметра `apiInterval \"\nдобавленные переводы",
23
+ "pt": "valor padrão adicionado ao parâmetro `apiInterval \"\ntraduções adicionadas",
24
+ "nl": "toegevoegde standaardwaarde aan parameter Wat\ntoegevoegde vertalingen",
25
+ "fr": "valeur ajoutée par défaut au paramètre `apiInterval \"\ntraductions ajoutées",
26
+ "it": "valore predefinito aggiunto al parametro `apiInterval #\ntraduzioni aggiunte",
27
+ "es": "valor predeterminado añadido al parámetro `apiInterval `\ntraducciones adicionales",
28
+ "pl": "domyślna wartość dodana do parametru 'apiInterval'\ndodane tłumaczenia",
29
+ "uk": "додано значення за замовчуванням до параметра `apiInterval й\nдодано переклади",
30
+ "zh-cn": "添加参数“ apiInterval” 的默认值 `\n增加翻译"
31
+ },
32
+ "0.3.1": {
33
+ "en": "removed parameter `apiKey` in method call",
34
+ "de": "entfernter Parameter `apiKey` im Methodenaufruf",
35
+ "ru": "удаленный параметр `apiKey' в вызове метода",
36
+ "pt": "parâmetro removido `apiKey` na chamada do método",
37
+ "nl": "verwijderde parameter ",
38
+ "fr": "paramètre supprimé `apiKey` dans l'appel de méthode",
39
+ "it": "parametro rimosso `apiKey` nella chiamata metodo",
40
+ "es": "parámetro eliminado `apiKey` en llamada de método",
41
+ "pl": "usunięty parametr 'apiKey' w wywołaniu metody",
42
+ "uk": "видалити параметр `apiKey` в методі виклику",
43
+ "zh-cn": "方法调用中已删除参数“ apiKey ”"
44
+ },
45
+ "0.3.0": {
46
+ "en": "added api interval to settings\nchanged interval of schedule endpoint from 5 minutes to 1 minute",
47
+ "de": "api intervall zu den einstellungen hinzugefügt\ngeändertes intervall von zeitplan endpunkt von 5 minuten bis 1 minute",
48
+ "ru": "добавлен интервал api в настройки\nизмененный интервал конечной точки расписания с 5 минут до 1 минуты",
49
+ "pt": "adicionado intervalo api para configurações\nintervalo alterado de cronograma ponto final de 5 minutos a 1 minuto",
50
+ "nl": "api-interval toegevoegd aan instellingen\nveranderde interval van het eindpunt van het schema van 5 minuten tot 1 minuut",
51
+ "fr": "l'intervalle api ajouté aux paramètres\nchangement de l'intervalle de 5 minutes à 1 minute",
52
+ "it": "intervallo api aggiunto alle impostazioni\nintervallo modificato di endpoint programmato da 5 minuti a 1 minuto",
53
+ "es": "añadir intervalo api a la configuración\ncambio de intervalo de tiempo de 5 minutos a 1 minuto",
54
+ "pl": "dodany interwał api do ustawień\nzmiana odstępu między punktem końcowym schematu z 5 minut do 1 minuty",
55
+ "uk": "додано інтервал api для налаштувань\nзмінений інтервал графіка кінцевої точки від 5 хвилин до 1 хвилини",
56
+ "zh-cn": "在设置中添加 api 间隔\n时间表终点从5分钟改为1分钟"
57
+ },
6
58
  "0.2.8": {
7
59
  "en": "fixed tier and license",
8
60
  "de": "festwert und lizenz",
@@ -41,58 +93,6 @@
41
93
  "pl": "stały typ 'runDomyślne'",
42
94
  "uk": "фіксований тип `runDefault й",
43
95
  "zh-cn": "固定类型“runDefault” `"
44
- },
45
- "0.2.5": {
46
- "en": "NodeJS >= 18.x and js-controller >= 5 is required",
47
- "de": "NodeJS >= 18.x und js-Controller >= 5 ist erforderlich",
48
- "ru": "NodeJS >= 18.x и js-контроллер >= 5 требуется",
49
- "pt": "NodeJS >= 18.x e js-controller >= 5 é necessário",
50
- "nl": "Voor de toepassing van de onderverdelingen 870190 tot en met 870290 wordt onder post 8702 verstaan: 5 is vereist",
51
- "fr": "NodeJS >= 18.x et js-controller >= 5 est nécessaire",
52
- "it": "NodeJS >= 18.x e js-controller 5 è richiesto",
53
- "es": "NodeJS >= 18.x y js-controller Se requiere 5",
54
- "pl": "NodeJS > = 18.x i kontroler js- > = 5 jest wymagane",
55
- "uk": "NodeJS >= 18.x та js-controller >= 5 обов'язково",
56
- "zh-cn": "节点JS18x和js控制器QQ 需要5个"
57
- },
58
- "0.2.4": {
59
- "en": "updated dependencies",
60
- "de": "aktualisierte abhängigkeiten",
61
- "ru": "обновленные зависимости",
62
- "pt": "dependências atualizadas",
63
- "nl": "bijgewerkte afhankelijkheden",
64
- "fr": "dépendances actualisées",
65
- "it": "dipendenze aggiornate",
66
- "es": "dependencias actualizadas",
67
- "pl": "zaktualizowane zależności",
68
- "uk": "оновлені залежності",
69
- "zh-cn": "更新的依赖关系"
70
- },
71
- "0.2.3": {
72
- "en": "NodeJS 16.x is required\nupdated dependencies",
73
- "de": "NodeJS 16.x ist erforderlich\naktualisierte abhängigkeiten",
74
- "ru": "NodeJS 16.x требуется\nобновленные зависимости",
75
- "pt": "NodeJS 16.x é necessário\ndependências atualizadas",
76
- "nl": "NodeJS 16.x is vereist\nvertaling:",
77
- "fr": "NodeJS 16.x est nécessaire\ndépendances actualisées",
78
- "it": "NodeJS 16.x è richiesto\ndipendenze aggiornate",
79
- "es": "NodeJS 16.x es necesario\ndependencias actualizadas",
80
- "pl": "NodeJS 16 (ang.)\nzależności aktualizacji",
81
- "uk": "NodeJS 16.x обов'язковий\nоновлені залежності",
82
- "zh-cn": "不需要16.JS16x。\n二. 最新依赖"
83
- },
84
- "0.2.2": {
85
- "en": "fixed versions",
86
- "de": "feste versionen",
87
- "ru": "фиксированные версии",
88
- "pt": "versões fixas",
89
- "nl": "vertaling:",
90
- "fr": "versions fixes",
91
- "it": "versioni fisse",
92
- "es": "versiones fijas",
93
- "pl": "wersja stała",
94
- "uk": "фіксовані версії",
95
- "zh-cn": "固定版本"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -163,7 +163,8 @@
163
163
  ]
164
164
  },
165
165
  "native": {
166
- "apiKey": ""
166
+ "apiKey": "",
167
+ "apiInterval": 60
167
168
  },
168
169
  "encryptedNative": [
169
170
  "apiKey"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.hydrawise",
3
- "version": "0.2.8",
3
+ "version": "0.3.3",
4
4
  "description": "Adapter to control the Hydrawise irrigation control system",
5
5
  "author": {
6
6
  "name": "SentiQ",
@@ -23,7 +23,7 @@
23
23
  "node": ">=18"
24
24
  },
25
25
  "dependencies": {
26
- "@iobroker/adapter-core": "^3.0.6",
26
+ "@iobroker/adapter-core": "^3.1.4",
27
27
  "axios": "^1.6.8"
28
28
  },
29
29
  "devDependencies": {
@@ -32,7 +32,7 @@
32
32
  "@alcalzone/release-script-plugin-license": "^3.5.9",
33
33
  "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
34
34
  "@iobroker/adapter-dev": "^1.3.0",
35
- "@iobroker/testing": "^4.1.0",
35
+ "@iobroker/testing": "^4.1.3",
36
36
  "@tsconfig/node16": "^16.1.0",
37
37
  "@types/chai": "^4.3.4",
38
38
  "@types/chai-as-promised": "^7.1.5",