iobroker.hydrawise 0.0.8 → 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/LICENSE +1 -1
- package/README.md +11 -2
- package/build/main.js +114 -30
- package/build/main.js.map +2 -2
- package/io-package.json +29 -30
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2023
|
|
3
|
+
Copyright (c) 2023 SentiQ <fischer.yves@web.de>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -10,9 +10,18 @@
|
|
|
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
|
+
|
|
18
|
+
### 0.0.9 (2023-05-25)
|
|
19
|
+
|
|
20
|
+
- (SentiQ) added more translations
|
|
21
|
+
|
|
13
22
|
### 0.0.8 (2023-05-25)
|
|
14
23
|
|
|
15
|
-
- (SentiQ)
|
|
24
|
+
- (SentiQ) improved log messages
|
|
16
25
|
|
|
17
26
|
### 0.0.7 (2023-05-25)
|
|
18
27
|
|
|
@@ -46,7 +55,7 @@
|
|
|
46
55
|
|
|
47
56
|
MIT License
|
|
48
57
|
|
|
49
|
-
Copyright (c) 2023
|
|
58
|
+
Copyright (c) 2023 SentiQ <fischer.yves@web.de>
|
|
50
59
|
|
|
51
60
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
52
61
|
of this software and associated documentation files (the "Software"), to deal
|
package/build/main.js
CHANGED
|
@@ -57,7 +57,19 @@ class Hydrawise extends utils.Adapter {
|
|
|
57
57
|
await this.setObjectNotExistsAsync("schedule.stopall", {
|
|
58
58
|
type: "state",
|
|
59
59
|
common: {
|
|
60
|
-
name:
|
|
60
|
+
name: {
|
|
61
|
+
en: "stop all zones",
|
|
62
|
+
de: "alle Zonen stoppen",
|
|
63
|
+
ru: "\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B",
|
|
64
|
+
pt: "parar todas as zonas",
|
|
65
|
+
nl: "stop alle zones",
|
|
66
|
+
fr: "arr\xEAter toutes les zones",
|
|
67
|
+
it: "fermare tutte le zone",
|
|
68
|
+
es: "detener todas las zonas",
|
|
69
|
+
pl: "zatrzymuj\u0105 wszystkie strefy",
|
|
70
|
+
uk: "\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438",
|
|
71
|
+
"zh-cn": "\u505C\u6B62\u6240\u6709\u5730\u533A"
|
|
72
|
+
},
|
|
61
73
|
type: "boolean",
|
|
62
74
|
role: "button",
|
|
63
75
|
read: false,
|
|
@@ -68,9 +80,22 @@ class Hydrawise extends utils.Adapter {
|
|
|
68
80
|
await this.setObjectNotExistsAsync("schedule.runall", {
|
|
69
81
|
type: "state",
|
|
70
82
|
common: {
|
|
71
|
-
name:
|
|
83
|
+
name: {
|
|
84
|
+
en: "run all zones for x seconds",
|
|
85
|
+
de: "alle Zonen f\xFCr x Sekunden ausf\xFChren",
|
|
86
|
+
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",
|
|
87
|
+
pt: "executar todas as zonas por x segundos",
|
|
88
|
+
nl: "ren alle zones voor x seconden",
|
|
89
|
+
fr: "ex\xE9cuter toutes les zones pendant x secondes",
|
|
90
|
+
it: "eseguire tutte le zone per x secondi",
|
|
91
|
+
es: "ejecutar todas las zonas durante x segundos",
|
|
92
|
+
pl: "wszystkie strefy startuj\u0105 dla x sekundy",
|
|
93
|
+
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",
|
|
94
|
+
"zh-cn": "\u8DD1\u9053\u533A"
|
|
95
|
+
},
|
|
72
96
|
type: "number",
|
|
73
97
|
role: "value",
|
|
98
|
+
unit: "seconds",
|
|
74
99
|
read: false,
|
|
75
100
|
write: true
|
|
76
101
|
},
|
|
@@ -79,7 +104,19 @@ class Hydrawise extends utils.Adapter {
|
|
|
79
104
|
await this.setObjectNotExistsAsync("schedule.suspendall", {
|
|
80
105
|
type: "state",
|
|
81
106
|
common: {
|
|
82
|
-
name:
|
|
107
|
+
name: {
|
|
108
|
+
en: "suspend all zones for x seconds",
|
|
109
|
+
de: "alle Zonen f\xFCr x Sekunden aussetzen",
|
|
110
|
+
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",
|
|
111
|
+
pt: "suspender todas as zonas por x segundos",
|
|
112
|
+
nl: "vertaling:",
|
|
113
|
+
fr: "suspendre toutes les zones pendant x secondes",
|
|
114
|
+
it: "sospendere tutte le zone per x secondi",
|
|
115
|
+
es: "suspender todas las zonas durante x segundos",
|
|
116
|
+
pl: "wszystkie strefy zawieszenia dla x sekundy",
|
|
117
|
+
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",
|
|
118
|
+
"zh-cn": "\u505C\u6B62\u6240\u6709\xD7\u4E8C\u533A"
|
|
119
|
+
},
|
|
83
120
|
type: "number",
|
|
84
121
|
role: "value",
|
|
85
122
|
read: false,
|
|
@@ -104,32 +141,49 @@ class Hydrawise extends utils.Adapter {
|
|
|
104
141
|
}
|
|
105
142
|
}
|
|
106
143
|
for (const relay of content.relays) {
|
|
107
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
144
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}`, {
|
|
108
145
|
type: "channel",
|
|
109
146
|
common: {
|
|
110
|
-
name: relay.
|
|
147
|
+
name: relay.relay
|
|
111
148
|
},
|
|
112
149
|
native: {}
|
|
113
150
|
});
|
|
114
|
-
RELAYS[relay.
|
|
151
|
+
RELAYS[relay.relay] = relay.relay_id;
|
|
115
152
|
for (const key in relay) {
|
|
116
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
153
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.${key}`, {
|
|
117
154
|
type: "state",
|
|
118
155
|
common: {
|
|
119
156
|
name: key,
|
|
120
|
-
type: key === "name" ? "string" : "number",
|
|
121
|
-
role: key === "name" ? "text" : "value",
|
|
157
|
+
type: key === "name" || key === "timestr" ? "string" : "number",
|
|
158
|
+
role: key === "name" || key === "timestr" ? "text" : "value",
|
|
122
159
|
read: true,
|
|
123
160
|
write: false
|
|
124
161
|
},
|
|
125
162
|
native: {}
|
|
126
163
|
});
|
|
127
|
-
|
|
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);
|
|
128
170
|
}
|
|
129
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
171
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {
|
|
130
172
|
type: "state",
|
|
131
173
|
common: {
|
|
132
|
-
name:
|
|
174
|
+
name: {
|
|
175
|
+
en: "stop zone",
|
|
176
|
+
de: "Zone stoppen",
|
|
177
|
+
ru: "\u0437\u043E\u043D\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438",
|
|
178
|
+
pt: "zona de paragem",
|
|
179
|
+
nl: "stop zone",
|
|
180
|
+
fr: "zone d ' arr\xEAt",
|
|
181
|
+
it: "zona di sosta",
|
|
182
|
+
es: "zona de parada",
|
|
183
|
+
pl: "strefa stopu",
|
|
184
|
+
uk: "\u0437\u043E\u043D\u0430 \u0437\u0443\u043F\u0438\u043D\u043A\u0438",
|
|
185
|
+
"zh-cn": "\u505C\u6B62\u5730\u533A"
|
|
186
|
+
},
|
|
133
187
|
type: "boolean",
|
|
134
188
|
role: "button",
|
|
135
189
|
read: false,
|
|
@@ -137,10 +191,22 @@ class Hydrawise extends utils.Adapter {
|
|
|
137
191
|
},
|
|
138
192
|
native: {}
|
|
139
193
|
});
|
|
140
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
194
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runZone`, {
|
|
141
195
|
type: "state",
|
|
142
196
|
common: {
|
|
143
|
-
name:
|
|
197
|
+
name: {
|
|
198
|
+
en: "run zone for x seconds",
|
|
199
|
+
de: "Zone f\xFCr x Sekunden starten",
|
|
200
|
+
ru: "\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B",
|
|
201
|
+
pt: "zona de execu\xE7\xE3o por x segundos",
|
|
202
|
+
nl: "ren zone voor x seconden",
|
|
203
|
+
fr: "zone de course pour x secondes",
|
|
204
|
+
it: "zona di corsa per x secondi",
|
|
205
|
+
es: "zona de ejecuci\xF3n por x segundos",
|
|
206
|
+
pl: "strefa x sekundy",
|
|
207
|
+
uk: "\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434",
|
|
208
|
+
"zh-cn": "\xD7\u4E8C\u533A"
|
|
209
|
+
},
|
|
144
210
|
type: "number",
|
|
145
211
|
role: "value",
|
|
146
212
|
read: false,
|
|
@@ -148,10 +214,22 @@ class Hydrawise extends utils.Adapter {
|
|
|
148
214
|
},
|
|
149
215
|
native: {}
|
|
150
216
|
});
|
|
151
|
-
await this.setObjectNotExistsAsync(`schedule.${relay.
|
|
217
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.relay}.suspendZone`, {
|
|
152
218
|
type: "state",
|
|
153
219
|
common: {
|
|
154
|
-
name:
|
|
220
|
+
name: {
|
|
221
|
+
en: "suspend zone for x seconds",
|
|
222
|
+
de: "Zone f\xFCr x Sekunden aussetzen",
|
|
223
|
+
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",
|
|
224
|
+
pt: "zona de suspens\xE3o por x segundos",
|
|
225
|
+
nl: "quality over quantity (qoq) releases vertaling:",
|
|
226
|
+
fr: "zone de suspension pour x secondes",
|
|
227
|
+
it: "zona di sospensione per x secondi",
|
|
228
|
+
es: "zona de suspensi\xF3n por x segundos",
|
|
229
|
+
pl: "strefa zawies\u0142a na x sekundy",
|
|
230
|
+
uk: "\u0437\u043E\u043D\u0430 \u043F\u0456\u0434\u0432\u0456\u0441\u043A\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434",
|
|
231
|
+
"zh-cn": "\u505C\u6B62x\u4E8C\u533A"
|
|
232
|
+
},
|
|
155
233
|
type: "number",
|
|
156
234
|
role: "value",
|
|
157
235
|
read: false,
|
|
@@ -192,9 +270,16 @@ class Hydrawise extends utils.Adapter {
|
|
|
192
270
|
}
|
|
193
271
|
resolve(response.status);
|
|
194
272
|
}).catch((error) => {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
+
}
|
|
198
283
|
});
|
|
199
284
|
});
|
|
200
285
|
}
|
|
@@ -254,9 +339,16 @@ class Hydrawise extends utils.Adapter {
|
|
|
254
339
|
}
|
|
255
340
|
resolve(response.status);
|
|
256
341
|
}).catch((error) => {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
+
}
|
|
260
352
|
});
|
|
261
353
|
});
|
|
262
354
|
}
|
|
@@ -265,7 +357,6 @@ class Hydrawise extends utils.Adapter {
|
|
|
265
357
|
const url = `/api/v1/${service}`;
|
|
266
358
|
let lastErrorCode = 0;
|
|
267
359
|
if (params.api_key) {
|
|
268
|
-
this.log.debug(`sending GET request to "${url}" with params: ${JSON.stringify(params)}`);
|
|
269
360
|
(0, import_axios.default)({
|
|
270
361
|
method: "GET",
|
|
271
362
|
baseURL: hydrawise_url,
|
|
@@ -274,11 +365,6 @@ class Hydrawise extends utils.Adapter {
|
|
|
274
365
|
responseType: "json",
|
|
275
366
|
params
|
|
276
367
|
}).then((response) => {
|
|
277
|
-
this.log.debug(
|
|
278
|
-
`received ${response.status} response from "${url}" with content: ${JSON.stringify(
|
|
279
|
-
response.data
|
|
280
|
-
)}`
|
|
281
|
-
);
|
|
282
368
|
lastErrorCode = 0;
|
|
283
369
|
resolve(response);
|
|
284
370
|
}).catch((error) => {
|
|
@@ -316,8 +402,6 @@ class Hydrawise extends utils.Adapter {
|
|
|
316
402
|
}
|
|
317
403
|
onStateChange(id, state) {
|
|
318
404
|
if (state) {
|
|
319
|
-
console.log("state", state);
|
|
320
|
-
this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`);
|
|
321
405
|
if (id.indexOf("stopall") !== -1) {
|
|
322
406
|
this.buildRequest("setzone.php", { api_key: this.config.apiKey, action: "stopall" });
|
|
323
407
|
} else if (id.indexOf("stop") !== -1) {
|
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: \"stopall\",\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: \"runall for x seconds\",\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\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: \"suspendall for x seconds\",\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: \"stop zone\",\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: \"run zone for x seconds\",\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: \"suspend zone for x seconds\",\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\tconsole.log(\"state\", state);\n\n\t\t\t// The state was changed\n\t\t\tthis.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n\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> | undef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AmB,MAAM,IAAI;AAEvD,gBAAM,KAAK,wBAAwB,oBAAoB;AAAA,YACtD,MAAM;AAAA,YACN,QAAQ;AAAA,cACP,MAAM;AAAA,
|
|
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,U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Q,GAAG,MAAM,+BAA+B;AAEtD,YAAI,UAAS,+BAAO,UAAS,GAAG;AAC/B,eAAK,aAAa,eAAe;AAAA,YAChC,SAAS,KAAK,OAAO;AAAA,YACrB,QAAQ;AAAA,YACR,WAAW;AAAA,YACX,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,GAAI;AAAA,YAC1C,UAAU,OAAO,MAAM;AAAA,UACxB,CAAC;AAAA,QACF;AAAA,MACD;AAAA,IACD,OAAO;AAEN,WAAK,IAAI,KAAK,SAAS,YAAY;AAAA,IACpC;AAAA,EACD;AACD;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAE5B,SAAO,UAAU,CAAC,YAAuD,IAAI,UAAU,OAAO;AAC/F,OAAO;AAEN,GAAC,MAAM,IAAI,UAAU,GAAG;AACzB;",
|
|
6
6
|
"names": ["axios"]
|
|
7
7
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "hydrawise",
|
|
4
|
-
"version": "0.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
|
+
},
|
|
19
|
+
"0.0.9": {
|
|
20
|
+
"en": "added more translations",
|
|
21
|
+
"de": "weitere übersetzungen",
|
|
22
|
+
"ru": "добавлены больше переводов",
|
|
23
|
+
"pt": "adicionado mais traduções",
|
|
24
|
+
"nl": "vertaling:",
|
|
25
|
+
"fr": "ajouté plus de traductions",
|
|
26
|
+
"it": "aggiunto più traduzioni",
|
|
27
|
+
"es": "añadido más traducciones",
|
|
28
|
+
"pl": "dodano więcej tłumaczeń",
|
|
29
|
+
"uk": "додано більше перекладів",
|
|
30
|
+
"zh-cn": "增加的翻译"
|
|
31
|
+
},
|
|
6
32
|
"0.0.8": {
|
|
7
33
|
"en": "improving log messages",
|
|
8
34
|
"de": "verbesserung der log-nachrichten",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "testować",
|
|
68
94
|
"uk": "тестування",
|
|
69
95
|
"zh-cn": "试验"
|
|
70
|
-
},
|
|
71
|
-
"0.0.3": {
|
|
72
|
-
"en": "added zone controls and Ukrainian language",
|
|
73
|
-
"de": "zusätzliche zonensteuerung",
|
|
74
|
-
"ru": "добавленный контроль зоны",
|
|
75
|
-
"pt": "controles de zona adicionados",
|
|
76
|
-
"nl": "vertaling:",
|
|
77
|
-
"fr": "contrôles des zones ajoutées",
|
|
78
|
-
"it": "comandi di zona aggiunti",
|
|
79
|
-
"es": "controles de zonas",
|
|
80
|
-
"pl": "kontrola strefy",
|
|
81
|
-
"uk": "додано контроль зони",
|
|
82
|
-
"zh-cn": "附加区管制"
|
|
83
|
-
},
|
|
84
|
-
"0.0.2": {
|
|
85
|
-
"en": "Refactoring",
|
|
86
|
-
"de": "Herstellung",
|
|
87
|
-
"ru": "Рефакторинг",
|
|
88
|
-
"pt": "Refactoring",
|
|
89
|
-
"nl": "Refactor",
|
|
90
|
-
"fr": "Refactoring",
|
|
91
|
-
"it": "Refactoring",
|
|
92
|
-
"es": "Refactoring",
|
|
93
|
-
"pl": "Refaktor",
|
|
94
|
-
"uk": "Рефакторинг",
|
|
95
|
-
"zh-cn": "评 注"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -122,7 +122,6 @@
|
|
|
122
122
|
"zh-cn": "Adapter to control the Hydrawise irrigation control system"
|
|
123
123
|
},
|
|
124
124
|
"authors": [
|
|
125
|
-
"aDabbelju <aike.wernicke@gmx.de>",
|
|
126
125
|
"SentiQ <fischer.yves@web.de>"
|
|
127
126
|
],
|
|
128
127
|
"keywords": [
|
|
@@ -137,8 +136,8 @@
|
|
|
137
136
|
"main": "build/main.js",
|
|
138
137
|
"icon": "hydrawise.jpg",
|
|
139
138
|
"enabled": true,
|
|
140
|
-
"extIcon": "https://raw.githubusercontent.com/
|
|
141
|
-
"readme": "https://github.com/
|
|
139
|
+
"extIcon": "https://raw.githubusercontent.com/SentiQ/ioBroker.hydrawise/main/admin/hydrawise.jpg",
|
|
140
|
+
"readme": "https://github.com/SentiQ/ioBroker.hydrawise/blob/main/README.md",
|
|
142
141
|
"loglevel": "info",
|
|
143
142
|
"mode": "daemon",
|
|
144
143
|
"type": "garden",
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
-
"name": "
|
|
7
|
-
"email": "
|
|
6
|
+
"name": "SentiQ",
|
|
7
|
+
"email": "fischer.yves@web.de"
|
|
8
8
|
},
|
|
9
|
-
"homepage": "https://github.com/
|
|
9
|
+
"homepage": "https://github.com/SentiQ/ioBroker.hydrawise",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"hydrawise",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git@github.com:
|
|
20
|
+
"url": "git@github.com:SentiQ/ioBroker.hydrawise.git"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">= 14.5.0"
|
|
@@ -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",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"instrument": true
|
|
108
108
|
},
|
|
109
109
|
"bugs": {
|
|
110
|
-
"url": "https://github.com/
|
|
110
|
+
"url": "https://github.com/SentiQ/ioBroker.hydrawise/issues"
|
|
111
111
|
},
|
|
112
112
|
"readmeFilename": "README.md"
|
|
113
113
|
}
|