iobroker.hydrawise 0.0.9 → 0.0.10
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 +5 -0
- package/build/main.js +35 -22
- package/build/main.js.map +2 -2
- package/io-package.json +14 -14
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
[](https://nodei.co/npm/iobroker.hydrawise/)
|
|
11
11
|
|
|
12
12
|
## Changelog
|
|
13
|
+
### 0.0.10 (2023-06-27)
|
|
14
|
+
|
|
15
|
+
- (SentiQ) fixed adapter crash
|
|
16
|
+
- (SentiQ) changed value of `timestr` to date string format
|
|
17
|
+
|
|
13
18
|
### 0.0.9 (2023-05-25)
|
|
14
19
|
|
|
15
20
|
- (SentiQ) added more translations
|
package/build/main.js
CHANGED
|
@@ -141,29 +141,34 @@ class Hydrawise extends utils.Adapter {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
for (const relay of content.relays) {
|
|
144
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
144
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}`, {
|
|
145
145
|
type: "channel",
|
|
146
146
|
common: {
|
|
147
|
-
name: relay.
|
|
147
|
+
name: relay.relay
|
|
148
148
|
},
|
|
149
149
|
native: {}
|
|
150
150
|
});
|
|
151
|
-
RELAYS[relay.
|
|
151
|
+
RELAYS[relay.relay] = relay.relay_id;
|
|
152
152
|
for (const key in relay) {
|
|
153
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
153
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.${key}`, {
|
|
154
154
|
type: "state",
|
|
155
155
|
common: {
|
|
156
156
|
name: key,
|
|
157
|
-
type: key === "name" ? "string" : "number",
|
|
158
|
-
role: key === "name" ? "text" : "value",
|
|
157
|
+
type: key === "name" || key === "timestr" ? "string" : "number",
|
|
158
|
+
role: key === "name" || key === "timestr" ? "text" : "value",
|
|
159
159
|
read: true,
|
|
160
160
|
write: false
|
|
161
161
|
},
|
|
162
162
|
native: {}
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
if (key === "timestr") {
|
|
165
|
+
const t = new Date();
|
|
166
|
+
t.setSeconds(t.getSeconds() + relay.time);
|
|
167
|
+
relay[key] = t.toString();
|
|
168
|
+
}
|
|
169
|
+
this.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);
|
|
165
170
|
}
|
|
166
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
171
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {
|
|
167
172
|
type: "state",
|
|
168
173
|
common: {
|
|
169
174
|
name: {
|
|
@@ -186,7 +191,7 @@ class Hydrawise extends utils.Adapter {
|
|
|
186
191
|
},
|
|
187
192
|
native: {}
|
|
188
193
|
});
|
|
189
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
194
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runZone`, {
|
|
190
195
|
type: "state",
|
|
191
196
|
common: {
|
|
192
197
|
name: {
|
|
@@ -209,7 +214,7 @@ class Hydrawise extends utils.Adapter {
|
|
|
209
214
|
},
|
|
210
215
|
native: {}
|
|
211
216
|
});
|
|
212
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
217
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.suspendZone`, {
|
|
213
218
|
type: "state",
|
|
214
219
|
common: {
|
|
215
220
|
name: {
|
|
@@ -265,9 +270,16 @@ class Hydrawise extends utils.Adapter {
|
|
|
265
270
|
}
|
|
266
271
|
resolve(response.status);
|
|
267
272
|
}).catch((error) => {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
273
|
+
if (error.response.status === 429) {
|
|
274
|
+
nextpollSchedule = nextpollSchedule || this.setTimeout(() => {
|
|
275
|
+
nextpollSchedule = null;
|
|
276
|
+
this.GetStatusSchedule(apiKey);
|
|
277
|
+
}, 60 * 5e3);
|
|
278
|
+
} else {
|
|
279
|
+
this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);
|
|
280
|
+
this.setStateChangedAsync("info.connection", false, true);
|
|
281
|
+
reject(error);
|
|
282
|
+
}
|
|
271
283
|
});
|
|
272
284
|
});
|
|
273
285
|
}
|
|
@@ -327,9 +339,16 @@ class Hydrawise extends utils.Adapter {
|
|
|
327
339
|
}
|
|
328
340
|
resolve(response.status);
|
|
329
341
|
}).catch((error) => {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
342
|
+
if (error.response.status === 429) {
|
|
343
|
+
nextpollCustomer = nextpollCustomer || this.setTimeout(() => {
|
|
344
|
+
nextpollCustomer = null;
|
|
345
|
+
this.GetCustomerDetails(apiKey);
|
|
346
|
+
}, 60 * 5e3);
|
|
347
|
+
} else {
|
|
348
|
+
this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);
|
|
349
|
+
this.setStateChangedAsync("info.connection", false, true);
|
|
350
|
+
reject(error);
|
|
351
|
+
}
|
|
333
352
|
});
|
|
334
353
|
});
|
|
335
354
|
}
|
|
@@ -338,7 +357,6 @@ class Hydrawise extends utils.Adapter {
|
|
|
338
357
|
const url = `/api/v1/${service}`;
|
|
339
358
|
let lastErrorCode = 0;
|
|
340
359
|
if (params.api_key) {
|
|
341
|
-
this.log.debug(`sending GET request to "${url}" with params: ${JSON.stringify(params)}`);
|
|
342
360
|
(0, import_axios.default)({
|
|
343
361
|
method: "GET",
|
|
344
362
|
baseURL: hydrawise_url,
|
|
@@ -347,11 +365,6 @@ class Hydrawise extends utils.Adapter {
|
|
|
347
365
|
responseType: "json",
|
|
348
366
|
params
|
|
349
367
|
}).then((response) => {
|
|
350
|
-
this.log.debug(
|
|
351
|
-
`received ${response.status} response from "${url}" with content: ${JSON.stringify(
|
|
352
|
-
response.data
|
|
353
|
-
)}`
|
|
354
|
-
);
|
|
355
368
|
lastErrorCode = 0;
|
|
356
369
|
resolve(response);
|
|
357
370
|
}).catch((error) => {
|
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.log.info(\"config apiKey: \" + this.config.apiKey);\n\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\tnextpollSchedule = null;\n\t\t\t\t\tthis.GetStatusSchedule(apiKey);\n\t\t\t\t}, 60000);\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\",\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: \"value\",\n\t\t\t\t\t\t\t\tunit: \"seconds\",\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.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: \"value\",\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\tfor (const key in content) {\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\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\tawait this.setObjectNotExistsAsync(`schedule.${relay.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: relay.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\tRELAYS[relay.name] = relay.relay_id;\n\n\t\t\t\t\t\t\tfor (const key in relay) {\n\t\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(`schedule.${relay.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 === \"name\" ? \"string\" : \"number\",\n\t\t\t\t\t\t\t\t\t\trole: key === \"name\" ? \"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.${relay.name}.${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.name}.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\",\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.name}.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: \"value\",\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.name}.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: \"value\",\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\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 (const key in sensor) {\n\t\t\t\t\t\t\t\tif (key !== \"relays\") {\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\tthis.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\t\t\treject(error);\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\tnextpollCustomer = null;\n\t\t\t\t\tthis.GetCustomerDetails(apiKey);\n\t\t\t\t}, 60 * 5000);\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 (const key in content) {\n\t\t\t\t\t\t\tif (key !== \"controllers\") {\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\" ? \"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(`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 (const key in controller) {\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\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\tthis.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n\t\t\t\t\tthis.setStateChangedAsync(\"info.connection\", false, true);\n\n\t\t\t\t\treject(error);\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\tthis.log.debug(`sending GET request to \"${url}\" with params: ${JSON.stringify(params)}`);\n\n\t\t\t\taxios({\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tbaseURL: hydrawise_url,\n\t\t\t\t\turl: url,\n\t\t\t\t\ttimeout: 3000,\n\t\t\t\t\tresponseType: \"json\",\n\t\t\t\t\tparams: params,\n\t\t\t\t})\n\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\tthis.log.debug(\n\t\t\t\t\t\t\t`received ${response.status} response from \"${url}\" with content: ${JSON.stringify(\n\t\t\t\t\t\t\t\tresponse.data,\n\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// no error - clear up reminder\n\t\t\t\t\t\tlastErrorCode = 0;\n\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (error.response) {\n\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\tthis.log.warn(\n\t\t\t\t\t\t\t\t`received ${error.response.status} response from ${url} with content: ${JSON.stringify(\n\t\t\t\t\t\t\t\t\terror.response.data,\n\t\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (error.request) {\n\t\t\t\t\t\t\t// The request was made but no response was received\n\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// http.ClientRequest in node.js\n\n\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\tif (error.code === lastErrorCode) {\n\t\t\t\t\t\t\t\tthis.log.debug(error.message);\n\t\t\t\t\t\t\t} else {\n\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\tlastErrorCode = error.code;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\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\tthis.log.error(error.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treject(\"Device IP 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\tclearTimeout(nextpollSchedule);\n\t\t\tclearTimeout(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) {\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} else {\n\t\t\t// The state was deleted\n\t\t\tthis.log.info(`state ${id} deleted`);\n\t\t}\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,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,SAAS,KAAK,IAAI,CAAC;AAAA,EAC3C;AAAA,EAEA,MAAc,UAAyB;AACtC,QAAI,CAAC,KAAK,OAAO,QAAQ;AACxB,WAAK,IAAI,MAAM,sBAAsB;AAAA,IACtC,OAAO;AACN,WAAK,IAAI,KAAK,oBAAoB,KAAK,OAAO,MAAM;AAEpD,WAAK,qBAAqB,mBAAmB,OAAO,IAAI;AAExD,YAAM,KAAK,kBAAkB,KAAK,OAAO,MAAM;AAE/C,YAAM,KAAK,mBAAmB,KAAK,OAAO,MAAM;AAEhD,YAAM,KAAK,qBAAqB,GAAG;AAAA,IACpC;AAAA,EACD;AAAA,EAEA,MAAc,kBAAkB,QAA+B;AAC9D,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACvC,yBACC,oBACA,KAAK,WAAW,M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AAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,SAAS;AAAA,cACV;AAAA,cACA,MAAM;AAAA,cACN,MAAM;AAAA,cACN,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA,QAAQ,CAAC;AAAA,UACV,CAAC;AAED,qBAAW,OAAO,SAAS;AAC1B,gBAAI,QAAQ,YAAY,QAAQ,aAAa,QAAQ,aAAa;AACjE,oBAAM,KAAK,wBAAwB,YAAY,OAAO;AAAA,gBACrD,MAAM;AAAA,gBACN,QAAQ;AAAA,kBACP,MAAM;AAAA,kBACN,MAAM,QAAQ,YAAY,WAAW;AAAA,kBACrC,MAAM,QAAQ,YAAY,SAAS;AAAA,kBACnC,MAAM;AAAA,kBACN,OAAO;AAAA,gBACR;AAAA,gBACA,QAAQ,CAAC;AAAA,cACV,CAAC;AAED,mBAAK,qBAAqB,YAAY,OAAO,QAAQ,MAAM,IAAI;AAAA,YAChE;AAAA,UACD;AAEA,qBAAW,SAAS,QAAQ,QAAQ;AACnC,kBAAM,KAAK,wBAAwB,YAAY,MAAM,
|
|
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.log.info(\"config apiKey: \" + this.config.apiKey);\n\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\tnextpollSchedule = null;\n\t\t\t\t\tthis.GetStatusSchedule(apiKey);\n\t\t\t\t}, 60000);\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\",\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: \"value\",\n\t\t\t\t\t\t\t\tunit: \"seconds\",\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.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: \"value\",\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\tfor (const key in content) {\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\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\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: relay.relay,\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 (const key in relay) {\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\",\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: \"value\",\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}.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: \"value\",\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\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 (const key in sensor) {\n\t\t\t\t\t\t\t\tif (key !== \"relays\") {\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\tnextpollSchedule = null;\n\t\t\t\t\t\t\t\tthis.GetStatusSchedule(apiKey);\n\t\t\t\t\t\t\t}, 60 * 5000);\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\tnextpollCustomer = null;\n\t\t\t\t\tthis.GetCustomerDetails(apiKey);\n\t\t\t\t}, 60 * 5000);\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 (const key in content) {\n\t\t\t\t\t\t\tif (key !== \"controllers\") {\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\" ? \"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(`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 (const key in controller) {\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\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\tnextpollCustomer = null;\n\t\t\t\t\t\t\t\tthis.GetCustomerDetails(apiKey);\n\t\t\t\t\t\t\t}, 60 * 5000);\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\taxios({\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tbaseURL: hydrawise_url,\n\t\t\t\t\turl: url,\n\t\t\t\t\ttimeout: 3000,\n\t\t\t\t\tresponseType: \"json\",\n\t\t\t\t\tparams: params,\n\t\t\t\t})\n\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\t// no error - clear up reminder\n\t\t\t\t\t\tlastErrorCode = 0;\n\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (error.response) {\n\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\tthis.log.warn(\n\t\t\t\t\t\t\t\t`received ${error.response.status} response from ${url} with content: ${JSON.stringify(\n\t\t\t\t\t\t\t\t\terror.response.data,\n\t\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (error.request) {\n\t\t\t\t\t\t\t// The request was made but no response was received\n\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// http.ClientRequest in node.js\n\n\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\tif (error.code === lastErrorCode) {\n\t\t\t\t\t\t\t\tthis.log.debug(error.message);\n\t\t\t\t\t\t\t} else {\n\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\tlastErrorCode = error.code;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\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\tthis.log.error(error.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treject(\"Device IP 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\tclearTimeout(nextpollSchedule);\n\t\t\tclearTimeout(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) {\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} else {\n\t\t\t// The state was deleted\n\t\t\tthis.log.info(`state ${id} deleted`);\n\t\t}\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,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,SAAS,KAAK,IAAI,CAAC;AAAA,EAC3C;AAAA,EAEA,MAAc,UAAyB;AACtC,QAAI,CAAC,KAAK,OAAO,QAAQ;AACxB,WAAK,IAAI,MAAM,sBAAsB;AAAA,IACtC,OAAO;AACN,WAAK,IAAI,KAAK,oBAAoB,KAAK,OAAO,MAAM;AAEpD,WAAK,qBAAqB,mBAAmB,OAAO,IAAI;AAExD,YAAM,KAAK,kBAAkB,KAAK,OAAO,MAAM;AAE/C,YAAM,KAAK,mBAAmB,KAAK,OAAO,MAAM;AAEhD,YAAM,KAAK,qBAAqB,GAAG;AAAA,IACpC;AAAA,EACD;AAAA,EAEA,MAAc,kBAAkB,QAA+B;AAC9D,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACvC,yBACC,oBACA,KAAK,WAAW,MAAM;AACrB,2BAAmB;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
7
7
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "hydrawise",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.10",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.0.10": {
|
|
7
|
+
"en": "fixed adapter crash\nchanged value of `timestr` to date string format",
|
|
8
|
+
"de": "fester adapterabsturz\ngeänderter wert von timestr zu date string format",
|
|
9
|
+
"ru": "фиксированный адаптер аварии\nизмененное значение timestr к формату строк",
|
|
10
|
+
"pt": "travamento do adaptador fixo\nvalor alterado de timestr para formato de cadeia de data",
|
|
11
|
+
"nl": "vertaling:\nveranderde waarde van tijdstip om te daten",
|
|
12
|
+
"fr": "crash de l'adaptateur fixe\nvaleur modifiée de timestr to date chaîne format",
|
|
13
|
+
"it": "arresto dell'adattatore fisso\nvalore cambiato di timestr in formato stringa data",
|
|
14
|
+
"es": "choque de adaptador fijo\ncambio de valor del formato de la cadena de tiempo a la fecha",
|
|
15
|
+
"pl": "adaptacja adaptatora\nzmieniona wartość czasu do daty formatu tekstowego",
|
|
16
|
+
"uk": "фіксований аварійний адаптер\nзмінено значення таймера до формата рядка",
|
|
17
|
+
"zh-cn": "b. 固定适应器\n迄今格式的变动"
|
|
18
|
+
},
|
|
6
19
|
"0.0.9": {
|
|
7
20
|
"en": "added more translations",
|
|
8
21
|
"de": "weitere übersetzungen",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "testować",
|
|
81
94
|
"uk": "тестування",
|
|
82
95
|
"zh-cn": "试验"
|
|
83
|
-
},
|
|
84
|
-
"0.0.3": {
|
|
85
|
-
"en": "added zone controls and Ukrainian language",
|
|
86
|
-
"de": "zusätzliche zonensteuerung",
|
|
87
|
-
"ru": "добавленный контроль зоны",
|
|
88
|
-
"pt": "controles de zona adicionados",
|
|
89
|
-
"nl": "vertaling:",
|
|
90
|
-
"fr": "contrôles des zones ajoutées",
|
|
91
|
-
"it": "comandi di zona aggiunti",
|
|
92
|
-
"es": "controles de zonas",
|
|
93
|
-
"pl": "kontrola strefy",
|
|
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.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Adapter to control the Hydrawise irrigation control system",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SentiQ",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"@types/chai": "^4.3.4",
|
|
37
37
|
"@types/chai-as-promised": "^7.1.5",
|
|
38
38
|
"@types/mocha": "^10.0.1",
|
|
39
|
-
"@types/node": "^20.2.
|
|
39
|
+
"@types/node": "^20.2.5",
|
|
40
40
|
"@types/proxyquire": "^1.3.28",
|
|
41
41
|
"@types/sinon": "^10.0.13",
|
|
42
42
|
"@types/sinon-chai": "^3.2.9",
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
44
|
-
"@typescript-eslint/parser": "^5.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
44
|
+
"@typescript-eslint/parser": "^5.59.8",
|
|
45
45
|
"chai": "^4.3.7",
|
|
46
46
|
"chai-as-promised": "^7.1.1",
|
|
47
47
|
"eslint": "^8.31.0",
|