iobroker.hydrawise 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 SentiQ <fischer.yves@web.de>
3
+ Copyright (c) 2025 SentiQ <yves.nuesser@proton.me>
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
@@ -25,10 +25,10 @@ You can see all controller information, schedules and sensors. It is also possib
25
25
 
26
26
  ## Documentation
27
27
 
28
- - log into https://app.hydrawise.com/config/account-details
29
- - generate API Key by clicking "Generate API Key" under "Account Settings"
30
- - paste key into adapter settings
31
- - API documentation: https://support.hydrawise.com/hc/en-us/articles/360008965753-Hydrawise-API-Information
28
+ - log into https://app.hydrawise.com/config/account-details
29
+ - generate API Key by clicking "Generate API Key" under "Account Settings"
30
+ - paste key into adapter settings
31
+ - API documentation: https://support.hydrawise.com/hc/en-us/articles/360008965753-Hydrawise-API-Information
32
32
 
33
33
  > **Note**
34
34
  > After updating from 0.0.15 you have to re-enter your API key
@@ -39,6 +39,10 @@ You can see all controller information, schedules and sensors. It is also possib
39
39
  Placeholder for the next version (at the beginning of the line):
40
40
  ### **WORK IN PROGRESS**
41
41
  -->
42
+ ### 1.0.3 (2025-12-05)
43
+
44
+ - (SentiQ) updated dependencies
45
+
42
46
  ### 1.0.2 (2024-09-24)
43
47
 
44
48
  - (SentiQ) fixed issues detected by repository checker
@@ -49,154 +53,154 @@ You can see all controller information, schedules and sensors. It is also possib
49
53
 
50
54
  ### 1.0.0 (2024-04-30)
51
55
 
52
- - (SentiQ) fixed adapter crash after dns not reachable
56
+ - (SentiQ) fixed adapter crash after dns not reachable
53
57
 
54
58
  ### 0.3.3 (2024-04-22)
55
59
 
56
- - (SentiQ) updated dependencies
60
+ - (SentiQ) updated dependencies
57
61
 
58
62
  ### 0.3.2 (2024-04-19)
59
63
 
60
- - (SentiQ) added default value to parameter `apiInterval`
61
- - (SentiQ) added translations
64
+ - (SentiQ) added default value to parameter `apiInterval`
65
+ - (SentiQ) added translations
62
66
 
63
67
  ### 0.3.1 (2024-04-18)
64
68
 
65
- - (SentiQ) removed parameter `apiKey` in method call
69
+ - (SentiQ) removed parameter `apiKey` in method call
66
70
 
67
71
  ### 0.3.0 (2024-04-18)
68
72
 
69
- - (SentiQ) added api interval to settings
70
- - (SentiQ) changed interval of schedule endpoint from 5 minutes to 1 minute
73
+ - (SentiQ) added api interval to settings
74
+ - (SentiQ) changed interval of schedule endpoint from 5 minutes to 1 minute
71
75
 
72
76
  ### 0.2.8 (2024-04-08)
73
77
 
74
- - (SentiQ) fixed tier and license
78
+ - (SentiQ) fixed tier and license
75
79
 
76
80
  ### 0.2.7 (2024-04-08)
77
81
 
78
- - (SentiQ) fixed type of runDefault object
82
+ - (SentiQ) fixed type of runDefault object
79
83
 
80
84
  ### 0.2.6 (2024-04-08)
81
85
 
82
- - (SentiQ) fixed type of `runDefault`
86
+ - (SentiQ) fixed type of `runDefault`
83
87
 
84
88
  ### 0.2.5 (2024-04-07)
85
89
 
86
- - (SentiQ) NodeJS >= 18.x and js-controller >= 5 is required
90
+ - (SentiQ) NodeJS >= 18.x and js-controller >= 5 is required
87
91
 
88
92
  ### 0.2.4 (2024-02-01)
89
93
 
90
- - (SentiQ) updated dependencies
94
+ - (SentiQ) updated dependencies
91
95
 
92
96
  ### 0.2.3 (2023-10-28)
93
97
 
94
- - (SentiQ) NodeJS 16.x is required
95
- - (SentiQ) updated dependencies
98
+ - (SentiQ) NodeJS 16.x is required
99
+ - (SentiQ) updated dependencies
96
100
 
97
101
  ### 0.2.2 (2023-09-22)
98
102
 
99
- - (SentiQ) fixed versions
103
+ - (SentiQ) fixed versions
100
104
 
101
105
  ### 0.2.0 (2023-09-22)
102
106
 
103
- - (SentiQ) added button to run zone for default runtime
107
+ - (SentiQ) added button to run zone for default runtime
104
108
 
105
109
  ### 0.1.2 (2023-08-22)
106
110
 
107
- - (SentiQ) added link to api docu
111
+ - (SentiQ) added link to api docu
108
112
 
109
113
  ### 0.1.1 (2023-08-22)
110
114
 
111
- - (SentiQ) fixed random crash, when api domain can't be resolved by dns
112
- - (SentiQ) added time string of last api call
115
+ - (SentiQ) fixed random crash, when api domain can't be resolved by dns
116
+ - (SentiQ) added time string of last api call
113
117
 
114
118
  ### 0.0.19 (2023-08-05)
115
119
 
116
- - (SentiQ) fixed button roles
120
+ - (SentiQ) fixed button roles
117
121
 
118
122
  ### 0.0.18 (2023-08-05)
119
123
 
120
- - (SentiQ) fixed timeout
124
+ - (SentiQ) fixed timeout
121
125
 
122
126
  ### 0.0.17 (2023-08-03)
123
127
 
124
- - (SentiQ) fixed adapter crash
128
+ - (SentiQ) fixed adapter crash
125
129
 
126
130
  ### 0.0.16 (2023-08-02)
127
131
 
128
- - (SentiQ) added more information to README
129
- - (SentiQ) encrypted apiKey
130
- - (SentiQ) removed logging of apiKey
131
- - (SentiQ) added filtering of invalid characters in ids
132
- - (SentiQ) added check of ack flag
133
- - (SentiQ) fixed roles
134
- - (SentiQ) fixed error message
135
- - (SentiQ) removed usage of clearTimeout
132
+ - (SentiQ) added more information to README
133
+ - (SentiQ) encrypted apiKey
134
+ - (SentiQ) removed logging of apiKey
135
+ - (SentiQ) added filtering of invalid characters in ids
136
+ - (SentiQ) added check of ack flag
137
+ - (SentiQ) fixed roles
138
+ - (SentiQ) fixed error message
139
+ - (SentiQ) removed usage of clearTimeout
136
140
 
137
141
  ### 0.0.15 (2023-06-29)
138
142
 
139
- - (SentiQ) updated dependencies
143
+ - (SentiQ) updated dependencies
140
144
 
141
145
  ### 0.0.14 (2023-06-29)
142
146
 
143
- - (SentiQ) fixing version
147
+ - (SentiQ) fixing version
144
148
 
145
149
  ### 0.0.12 (2023-06-29)
146
150
 
147
- - (SentiQ) changed value of `last_contact` to date string format
151
+ - (SentiQ) changed value of `last_contact` to date string format
148
152
 
149
153
  ### 0.0.11 (2023-06-28)
150
154
 
151
- - (SentiQ) raised timeouts
152
- - (SentiQ) fixed types
155
+ - (SentiQ) raised timeouts
156
+ - (SentiQ) fixed types
153
157
 
154
158
  ### 0.0.10 (2023-06-27)
155
159
 
156
- - (SentiQ) fixed adapter crash
157
- - (SentiQ) changed value of `timestr` to date string format
160
+ - (SentiQ) fixed adapter crash
161
+ - (SentiQ) changed value of `timestr` to date string format
158
162
 
159
163
  ### 0.0.9 (2023-05-25)
160
164
 
161
- - (SentiQ) added more translations
165
+ - (SentiQ) added more translations
162
166
 
163
167
  ### 0.0.8 (2023-05-25)
164
168
 
165
- - (SentiQ) improved log messages
169
+ - (SentiQ) improved log messages
166
170
 
167
171
  ### 0.0.7 (2023-05-25)
168
172
 
169
- - (SentiQ) fixed author
173
+ - (SentiQ) fixed author
170
174
 
171
175
  ### 0.0.6 (2023-05-24)
172
176
 
173
- - (SentiQ) lowered min node version to 14.5.0
177
+ - (SentiQ) lowered min node version to 14.5.0
174
178
 
175
179
  ### 0.0.5 (2023-05-24)
176
180
 
177
- - (SentiQ) updated packages
181
+ - (SentiQ) updated packages
178
182
 
179
183
  ### 0.0.4 (2023-05-24)
180
184
 
181
- - (SentiQ) testing
185
+ - (SentiQ) testing
182
186
 
183
187
  ### 0.0.3 (2023-05-24)
184
188
 
185
- - (SentiQ) added zone controls and Ukrainian language
189
+ - (SentiQ) added zone controls and Ukrainian language
186
190
 
187
191
  ### 0.0.2 (2023-05-23)
188
192
 
189
- - (SentiQ) refactoring code
193
+ - (SentiQ) refactoring code
190
194
 
191
195
  ### 0.0.1 (2023-01-26)
192
196
 
193
- - (aDabbelju) Initial commit by adapter creator
197
+ - (aDabbelju) Initial commit by adapter creator
194
198
 
195
199
  ## License
196
200
 
197
201
  MIT License
198
202
 
199
- Copyright (c) 2024 SentiQ <yves.nuesser@proton.me>
203
+ Copyright (c) 2025 SentiQ <yves.nuesser@proton.me>
200
204
 
201
205
  Permission is hereby granted, free of charge, to any person obtaining a copy
202
206
  of this software and associated documentation files (the "Software"), to deal
@@ -7,14 +7,13 @@
7
7
  "label": "api key",
8
8
  "newLine": true,
9
9
  "help": "how to get token",
10
- "helpLink": "https://github.com/SentiQ/ioBroker.hydrawise/blob/main/README.md#documentation"
10
+ "helpLink": "https://github.com/SentiQ/ioBroker.hydrawise/blob/main/README.md#documentation",
11
+ "xs": 12,
12
+ "sm": 12,
13
+ "md": 6,
14
+ "lg": 4,
15
+ "xl": 4
11
16
  },
12
- "apiInterval": {
13
- "type": "number",
14
- "label": "api interval",
15
- "newLine": true,
16
- "default": 60,
17
- "min": 15
18
- }
17
+ "apiInterval": { "type": "number", "label": "api interval", "newLine": true, "default": 60, "min": 15, "xs": 12, "sm": 12, "md": 6, "lg": 4, "xl": 4 }
19
18
  }
20
19
  }
package/build/main.js CHANGED
@@ -42,7 +42,7 @@ class Hydrawise extends utils.Adapter {
42
42
  if (!this.config.apiKey) {
43
43
  this.log.error("No API-Key defined!");
44
44
  } else {
45
- this.setStateChangedAsync("info.connection", false, true);
45
+ void this.setStateChangedAsync("info.connection", false, true);
46
46
  try {
47
47
  await this.GetStatusSchedule();
48
48
  nextpollSchedule = this.setInterval(async () => {
@@ -66,7 +66,7 @@ class Hydrawise extends utils.Adapter {
66
66
  this.buildRequest("statusschedule.php", { api_key: this.config.apiKey }).then(async (response) => {
67
67
  if ((response == null ? void 0 : response.status) === 200) {
68
68
  const content = response.data;
69
- this.setStateChangedAsync("info.connection", true, true);
69
+ void this.setStateChangedAsync("info.connection", true, true);
70
70
  await this.setObjectNotExistsAsync("schedule.stopall", {
71
71
  type: "state",
72
72
  common: {
@@ -151,7 +151,7 @@ class Hydrawise extends utils.Adapter {
151
151
  },
152
152
  native: {}
153
153
  });
154
- this.setStateChangedAsync(`schedule.${key}`, content[key], true);
154
+ void this.setStateChangedAsync(`schedule.${key}`, content[key], true);
155
155
  if (key === "time") {
156
156
  await this.setObjectNotExistsAsync("schedule.timestr", {
157
157
  type: "state",
@@ -165,7 +165,7 @@ class Hydrawise extends utils.Adapter {
165
165
  native: {}
166
166
  });
167
167
  const t = new Date(content[key] * 1e3);
168
- this.setStateChangedAsync("schedule.timestr", t.toString(), true);
168
+ void this.setStateChangedAsync("schedule.timestr", t.toString(), true);
169
169
  }
170
170
  }
171
171
  }
@@ -197,7 +197,7 @@ class Hydrawise extends utils.Adapter {
197
197
  t.setSeconds(t.getSeconds() + relay.time);
198
198
  relay[key] = t.toString();
199
199
  }
200
- this.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);
200
+ void this.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);
201
201
  }
202
202
  await this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {
203
203
  type: "state",
@@ -314,7 +314,11 @@ class Hydrawise extends utils.Adapter {
314
314
  },
315
315
  native: {}
316
316
  });
317
- this.setStateChangedAsync(`schedule.sensors.${sensor.input}.${key}`, sensor[key], true);
317
+ void this.setStateChangedAsync(
318
+ `schedule.sensors.${sensor.input}.${key}`,
319
+ sensor[key],
320
+ true
321
+ );
318
322
  }
319
323
  }
320
324
  }
@@ -329,8 +333,8 @@ class Hydrawise extends utils.Adapter {
329
333
  }, this.config.apiInterval * 1e3);
330
334
  } else {
331
335
  this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);
332
- this.setStateChangedAsync("info.connection", false, true);
333
- reject(error);
336
+ void this.setStateChangedAsync("info.connection", false, true);
337
+ reject(new Error(error));
334
338
  }
335
339
  });
336
340
  });
@@ -340,7 +344,7 @@ class Hydrawise extends utils.Adapter {
340
344
  this.buildRequest("customerdetails.php", { api_key: this.config.apiKey }).then(async (response) => {
341
345
  if ((response == null ? void 0 : response.status) === 200) {
342
346
  const content = response.data;
343
- this.setStateChangedAsync("info.connection", true, true);
347
+ void this.setStateChangedAsync("info.connection", true, true);
344
348
  for (let key in content) {
345
349
  if (key !== "controllers" && !Number.isNaN(key)) {
346
350
  key = this.name2id(key);
@@ -355,7 +359,7 @@ class Hydrawise extends utils.Adapter {
355
359
  },
356
360
  native: {}
357
361
  });
358
- this.setStateChangedAsync(`customer.${key}`, content[key], true);
362
+ void this.setStateChangedAsync(`customer.${key}`, content[key], true);
359
363
  }
360
364
  }
361
365
  for (const controller of content.controllers) {
@@ -383,7 +387,11 @@ class Hydrawise extends utils.Adapter {
383
387
  const t = new Date(controller[key] * 1e3);
384
388
  controller[key] = t.toString();
385
389
  }
386
- this.setStateChangedAsync(`customer.controllers.${controller.name}.${key}`, controller[key], true);
390
+ void this.setStateChangedAsync(
391
+ `customer.controllers.${controller.name}.${key}`,
392
+ controller[key],
393
+ true
394
+ );
387
395
  }
388
396
  }
389
397
  }
@@ -400,8 +408,8 @@ class Hydrawise extends utils.Adapter {
400
408
  );
401
409
  } else {
402
410
  this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);
403
- this.setStateChangedAsync("info.connection", false, true);
404
- reject(error);
411
+ void this.setStateChangedAsync("info.connection", false, true);
412
+ reject(new Error(error));
405
413
  }
406
414
  });
407
415
  });
@@ -424,7 +432,9 @@ class Hydrawise extends utils.Adapter {
424
432
  resolve(response);
425
433
  }).catch((error) => {
426
434
  if (error.response) {
427
- this.log.warn(`received ${error.response.status} response from ${url} with content: ${JSON.stringify(error.response.data)}`);
435
+ this.log.warn(
436
+ `received ${error.response.status} response from ${url} with content: ${JSON.stringify(error.response.data)}`
437
+ );
428
438
  } else if (error.request) {
429
439
  if (error.code === lastErrorCode) {
430
440
  this.log.debug(error.message);
@@ -435,39 +445,44 @@ class Hydrawise extends utils.Adapter {
435
445
  } else {
436
446
  this.log.error(error.message);
437
447
  }
438
- reject(error);
448
+ reject(new Error(error));
439
449
  });
440
450
  } catch (error) {
441
- reject(error);
451
+ reject(new Error(error));
442
452
  }
443
453
  } else {
444
- reject("API key is not configured");
454
+ reject(new Error("API key is not configured"));
445
455
  }
446
456
  });
447
457
  }
448
458
  /**
449
459
  * Is called when adapter shuts down - callback has to be called under any circumstances!
460
+ *
461
+ * @param callback callback function
450
462
  */
451
463
  onUnload(callback) {
452
464
  try {
453
465
  this.clearInterval(nextpollSchedule);
454
466
  this.clearInterval(nextpollCustomer);
455
467
  callback();
456
- } catch (e) {
468
+ } catch {
457
469
  callback();
458
470
  }
459
471
  }
460
472
  /**
461
473
  * Is called if a subscribed state changes
474
+ *
475
+ * @param id id of the state
476
+ * @param state state object
462
477
  */
463
478
  onStateChange(id, state) {
464
479
  if (state && !state.ack) {
465
480
  if (id.indexOf("stopall") !== -1) {
466
- this.buildRequest("setzone.php", { api_key: this.config.apiKey, action: "stopall" });
481
+ void this.buildRequest("setzone.php", { api_key: this.config.apiKey, action: "stopall" });
467
482
  } else if (id.indexOf("stop") !== -1) {
468
483
  const relay = id.match(/.*schedule\.(.*)\.stopZone/);
469
484
  if (relay && (relay == null ? void 0 : relay.length) > 1) {
470
- this.buildRequest("setzone.php", {
485
+ void this.buildRequest("setzone.php", {
471
486
  api_key: this.config.apiKey,
472
487
  action: "stop",
473
488
  relay_id: RELAYS[relay[1]]
@@ -475,7 +490,7 @@ class Hydrawise extends utils.Adapter {
475
490
  }
476
491
  }
477
492
  if (id.indexOf("runall") !== -1 && (state.val || state.val === 0)) {
478
- this.buildRequest("setzone.php", {
493
+ void this.buildRequest("setzone.php", {
479
494
  api_key: this.config.apiKey,
480
495
  action: "runall",
481
496
  period_id: 999,
@@ -484,7 +499,7 @@ class Hydrawise extends utils.Adapter {
484
499
  } else if (id.indexOf("runZone") !== -1 && (state.val || state.val === 0)) {
485
500
  const relay = id.match(/.*schedule\.(.*)\.runZone/);
486
501
  if (relay && (relay == null ? void 0 : relay.length) > 1) {
487
- this.buildRequest("setzone.php", {
502
+ void this.buildRequest("setzone.php", {
488
503
  api_key: this.config.apiKey,
489
504
  action: "run",
490
505
  period_id: 999,
@@ -494,11 +509,11 @@ class Hydrawise extends utils.Adapter {
494
509
  }
495
510
  }
496
511
  if (id.indexOf("runDefault") !== -1 && state.val !== null) {
497
- this.initRunDefault(id, state.val);
512
+ void this.initRunDefault(id, state.val);
498
513
  }
499
514
  if (id.indexOf("suspendall") !== -1 && (state.val || state.val === 0)) {
500
515
  const num = state.val;
501
- this.buildRequest("setzone.php", {
516
+ void this.buildRequest("setzone.php", {
502
517
  api_key: this.config.apiKey,
503
518
  action: "suspendall",
504
519
  period_id: 999,
@@ -508,7 +523,7 @@ class Hydrawise extends utils.Adapter {
508
523
  const num = state.val;
509
524
  const relay = id.match(/.*schedule\.(.*)\.suspendZone/);
510
525
  if (relay && (relay == null ? void 0 : relay.length) > 1) {
511
- this.buildRequest("setzone.php", {
526
+ void this.buildRequest("setzone.php", {
512
527
  api_key: this.config.apiKey,
513
528
  action: "suspend",
514
529
  period_id: 999,
@@ -524,18 +539,18 @@ class Hydrawise extends utils.Adapter {
524
539
  this.clearTimeout(resetSwitch);
525
540
  if (relay) {
526
541
  if (run) {
527
- const defaultRunTime = await this.getStateAsync(relay[1] + "run");
542
+ const defaultRunTime = await this.getStateAsync(`${relay[1]}run`);
528
543
  if (defaultRunTime && defaultRunTime.val) {
529
- this.setStateAsync(relay[1] + "runZone", defaultRunTime.val, false);
544
+ void this.setState(`${relay[1]}runZone`, defaultRunTime.val, false);
530
545
  resetSwitch = this.setTimeout(
531
546
  () => {
532
- this.setStateAsync(id, false, false);
547
+ void this.setState(id, false, false);
533
548
  },
534
549
  defaultRunTime.val * 1e3
535
550
  );
536
551
  }
537
552
  } else {
538
- this.setStateAsync(relay[1] + "stopZone", true, false);
553
+ void this.setState(`${relay[1]}stopZone`, true, false);
539
554
  }
540
555
  }
541
556
  }
package/build/main.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
- "sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.3.0\n */\n\n// The adapter-core module gives you access to the core ioBroker functions\n// you need to create an adapter\nimport * as utils from '@iobroker/adapter-core';\nimport axios from 'axios';\n\nconst hydrawise_url = 'https://api.hydrawise.com';\nlet nextpollSchedule: any = null;\nlet nextpollCustomer: any = null;\nlet resetSwitch: any = null;\nconst RELAYS: any = Object;\n\nclass Hydrawise extends utils.Adapter {\n public constructor(options: Partial<utils.AdapterOptions> = {}) {\n super({\n ...options,\n name: 'hydrawise',\n });\n\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n private async onReady(): Promise<void> {\n if (!this.config.apiKey) {\n this.log.error('No API-Key defined!');\n } else {\n this.setStateChangedAsync('info.connection', false, true);\n\n try {\n await this.GetStatusSchedule();\n\n nextpollSchedule = this.setInterval(async () => {\n await this.GetStatusSchedule();\n }, this.config.apiInterval * 1000);\n\n await this.GetCustomerDetails();\n\n nextpollCustomer = this.setInterval(\n async () => {\n await this.GetCustomerDetails();\n },\n 5 * 60 * 1000,\n );\n } catch (error: any) {\n this.log.error(error.toString());\n }\n\n await this.subscribeStatesAsync('*');\n }\n }\n\n private async GetStatusSchedule(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.buildRequest('statusschedule.php', { api_key: this.config.apiKey })\n .then(async (response) => {\n if (response?.status === 200) {\n const content = response.data;\n\n this.setStateChangedAsync('info.connection', true, true);\n\n await this.setObjectNotExistsAsync('schedule.stopall', {\n type: 'state',\n common: {\n name: {\n en: 'stop all zones',\n de: 'alle Zonen stoppen',\n ru: '\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B',\n pt: 'parar todas as zonas',\n nl: 'stop alle zones',\n fr: 'arr\u00EAter toutes les zones',\n it: 'fermare tutte le zone',\n es: 'detener todas las zonas',\n pl: 'zatrzymuj\u0105 wszystkie strefy',\n uk: '\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438',\n 'zh-cn': '\u505C\u6B62\u6240\u6709\u5730\u533A',\n },\n type: 'boolean',\n role: 'button.stop',\n read: false,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync('schedule.runall', {\n type: 'state',\n common: {\n name: {\n en: 'run all zones for x seconds',\n de: 'alle Zonen f\u00FCr x Sekunden ausf\u00FChren',\n ru: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'executar todas as zonas por x segundos',\n nl: 'ren alle zones voor x seconden',\n fr: 'ex\u00E9cuter toutes les zones pendant x secondes',\n it: 'eseguire tutte le zone per x secondi',\n es: 'ejecutar todas las zonas durante x segundos',\n pl: 'wszystkie strefy startuj\u0105 dla x sekundy',\n uk: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u8DD1\u9053\u533A',\n },\n type: 'number',\n role: 'level',\n unit: 'seconds',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync('schedule.suspendall', {\n type: 'state',\n common: {\n name: {\n en: 'suspend all zones for x seconds',\n de: 'alle Zonen f\u00FCr x Sekunden aussetzen',\n ru: '\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'suspender todas as zonas por x segundos',\n nl: 'vertaling:',\n fr: 'suspendre toutes les zones pendant x secondes',\n it: 'sospendere tutte le zone per x secondi',\n es: 'suspender todas las zonas durante x segundos',\n pl: 'wszystkie strefy zawieszenia dla x sekundy',\n uk: '\u043F\u0440\u0438\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u505C\u6B62\u6240\u6709\u00D7\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n for (let key in content) {\n key = this.name2id(key);\n\n if (key !== 'relays' && key !== 'sensors' && key !== 'expanders' && !Number.isNaN(key)) {\n await this.setObjectNotExistsAsync(`schedule.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'message' ? 'string' : 'number',\n role: key === 'message' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n this.setStateChangedAsync(`schedule.${key}`, content[key], true);\n\n if (key === 'time') {\n await this.setObjectNotExistsAsync('schedule.timestr', {\n type: 'state',\n common: {\n name: 'last api call',\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n\n const t = new Date(content[key] * 1000);\n\n this.setStateChangedAsync('schedule.timestr', t.toString(), true);\n }\n }\n }\n\n for (const relay of content.relays) {\n const name = relay.relay;\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}`, {\n type: 'channel',\n common: {\n name: name.toString(),\n },\n native: {},\n });\n\n RELAYS[relay.relay] = relay.relay_id;\n\n for (let key in relay) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'name' || key === 'timestr' ? 'string' : 'number',\n role: key === 'name' || key === 'timestr' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (key === 'timestr') {\n const t = new Date();\n t.setSeconds(t.getSeconds() + relay.time);\n relay[key] = t.toString();\n }\n\n this.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);\n }\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {\n type: 'state',\n common: {\n name: {\n en: 'stop zone',\n de: 'Zone stoppen',\n ru: '\u0437\u043E\u043D\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438',\n pt: 'zona de paragem',\n nl: 'stop zone',\n fr: \"zone d ' arr\u00EAt\",\n it: 'zona di sosta',\n es: 'zona de parada',\n pl: 'strefa stopu',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0443\u043F\u0438\u043D\u043A\u0438',\n 'zh-cn': '\u505C\u6B62\u5730\u533A',\n },\n type: 'boolean',\n role: 'button.stop',\n read: false,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runZone`, {\n type: 'state',\n common: {\n name: {\n en: 'run zone for x seconds',\n de: 'Zone f\u00FCr x Sekunden starten',\n ru: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'zona de execu\u00E7\u00E3o por x segundos',\n nl: 'ren zone voor x seconden',\n fr: 'zone de course pour x secondes',\n it: 'zona di corsa per x secondi',\n es: 'zona de ejecuci\u00F3n por x segundos',\n pl: 'strefa x sekundy',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u00D7\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.suspendZone`, {\n type: 'state',\n common: {\n name: {\n en: 'suspend zone for x seconds',\n de: 'Zone f\u00FCr x Sekunden aussetzen',\n ru: '\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'zona de suspens\u00E3o por x segundos',\n nl: 'quality over quantity (qoq) releases vertaling:',\n fr: 'zone de suspension pour x secondes',\n it: 'zona di sospensione per x secondi',\n es: 'zona de suspensi\u00F3n por x segundos',\n pl: 'strefa zawies\u0142a na x sekundy',\n uk: '\u0437\u043E\u043D\u0430 \u043F\u0456\u0434\u0432\u0456\u0441\u043A\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u505C\u6B62x\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runDefault`, {\n type: 'state',\n common: {\n name: {\n en: 'run zone for default time',\n de: 'Zone mit Standardlaufzeit starten',\n ru: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0434\u043B\u044F \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E',\n pt: 'fuso de execu\u00E7\u00E3o para o tempo padr\u00E3o',\n nl: 'run zone for default time',\n fr: 'run zone for default time',\n it: 'run zone per il tempo predefinito',\n es: 'zona de ejecuci\u00F3n por tiempo predeterminado',\n pl: 'strefa czasu domy\u015Blnego',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C',\n 'zh-cn': 'a. \u6682\u505C\u65F6\u95F4\u533A',\n },\n type: 'boolean',\n role: 'button.start',\n read: true,\n write: true,\n },\n native: {},\n });\n }\n\n for (const sensor of content.sensors) {\n await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}`, {\n type: 'channel',\n common: {\n name: 'sensors',\n },\n native: {},\n });\n\n for (let key in sensor) {\n if (key !== 'relays') {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: 'number',\n role: 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n this.setStateChangedAsync(`schedule.sensors.${sensor.input}.${key}`, sensor[key], true);\n }\n }\n }\n }\n\n resolve(response.status);\n })\n .catch((error) => {\n this.clearInterval(nextpollSchedule);\n\n if (error.code === 'EAI_AGAIN' || error.code === 'ECONNABORTED' || error.code === 'ENOTFOUND' || error.response?.status === 429) {\n nextpollSchedule = this.setInterval(async () => {\n await this.GetStatusSchedule();\n }, this.config.apiInterval * 1000);\n } else {\n this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n this.setStateChangedAsync('info.connection', false, true);\n\n reject(error);\n }\n });\n });\n }\n\n private async GetCustomerDetails(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.buildRequest('customerdetails.php', { api_key: this.config.apiKey })\n .then(async (response) => {\n if (response?.status === 200) {\n const content = response.data;\n\n this.setStateChangedAsync('info.connection', true, true);\n\n for (let key in content) {\n if (key !== 'controllers' && !Number.isNaN(key)) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`customer.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'message' || key === 'current_controller' ? 'string' : 'number',\n role: key === 'message' || key === 'current_controller' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n this.setStateChangedAsync(`customer.${key}`, content[key], true);\n }\n }\n\n for (const controller of content.controllers) {\n await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}`, {\n type: 'channel',\n common: {\n name: controller.name,\n },\n native: {},\n });\n\n for (let key in controller) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key !== 'controller_id' ? 'string' : 'number',\n role: key !== 'controller_id' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (key === 'last_contact') {\n const t = new Date(controller[key] * 1000);\n controller[key] = t.toString();\n }\n\n this.setStateChangedAsync(`customer.controllers.${controller.name}.${key}`, controller[key], true);\n }\n }\n }\n\n resolve(response.status);\n })\n .catch((error) => {\n this.clearInterval(nextpollCustomer);\n\n if (error.code === 'EAI_AGAIN' || error.code === 'ECONNABORTED' || error.code === 'ENOTFOUND' || error.response?.status === 429) {\n nextpollCustomer = this.setInterval(\n async () => {\n await this.GetCustomerDetails();\n },\n 5 * 60 * 1000,\n );\n } else {\n this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n this.setStateChangedAsync('info.connection', false, true);\n\n reject(error);\n }\n });\n });\n }\n\n buildRequest(service: string, params: any): Promise<any> {\n return new Promise((resolve, reject) => {\n const url = `/api/v1/${service}`;\n let lastErrorCode = 0;\n\n if (params.api_key) {\n try {\n axios({\n method: 'GET',\n baseURL: hydrawise_url,\n url: url,\n timeout: 30000,\n responseType: 'json',\n params: params,\n })\n .then((response) => {\n // no error - clear up reminder\n lastErrorCode = 0;\n\n resolve(response);\n })\n .catch((error) => {\n if (error.response) {\n // The request was made and the server responded with a status code\n\n this.log.warn(`received ${error.response.status} response from ${url} with content: ${JSON.stringify(error.response.data)}`);\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n // http.ClientRequest in node.js\n\n // avoid spamming of the same error when stuck in a reconnection loop\n if (error.code === lastErrorCode) {\n this.log.debug(error.message);\n } else {\n this.log.info(`error ${error.code} from ${url}: ${error.message}`);\n lastErrorCode = error.code;\n }\n } else {\n // Something happened in setting up the request that triggered an Error\n this.log.error(error.message);\n }\n\n reject(error);\n });\n } catch (error) {\n reject(error);\n }\n } else {\n reject('API key is not configured');\n }\n });\n }\n\n /**\n * Is called when adapter shuts down - callback has to be called under any circumstances!\n */\n private onUnload(callback: () => void): void {\n try {\n this.clearInterval(nextpollSchedule);\n this.clearInterval(nextpollCustomer);\n\n callback();\n } catch (e) {\n callback();\n }\n }\n\n /**\n * Is called if a subscribed state changes\n */\n private onStateChange(id: string, state: ioBroker.State | null | undefined): void {\n if (state && !state.ack) {\n if (id.indexOf('stopall') !== -1) {\n this.buildRequest('setzone.php', { api_key: this.config.apiKey, action: 'stopall' });\n } else if (id.indexOf('stop') !== -1) {\n const relay = id.match(/.*schedule\\.(.*)\\.stopZone/);\n\n if (relay && relay?.length > 1) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'stop',\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n if (id.indexOf('runall') !== -1 && (state.val || state.val === 0)) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'runall',\n period_id: 999,\n custom: state.val,\n });\n } else if (id.indexOf('runZone') !== -1 && (state.val || state.val === 0)) {\n const relay = id.match(/.*schedule\\.(.*)\\.runZone/);\n\n if (relay && relay?.length > 1) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'run',\n period_id: 999,\n custom: state.val,\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n\n if (id.indexOf('runDefault') !== -1 && state.val !== null) {\n this.initRunDefault(id, state.val as boolean);\n }\n\n if (id.indexOf('suspendall') !== -1 && (state.val || state.val === 0)) {\n const num = state.val as number;\n\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'suspendall',\n period_id: 999,\n custom: Math.trunc((state.ts + num) / 1000),\n });\n } else if (id.indexOf('suspend') !== -1 && (state.val || state.val === 0)) {\n const num = state.val as number;\n const relay = id.match(/.*schedule\\.(.*)\\.suspendZone/);\n\n if (relay && relay?.length > 1) {\n this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'suspend',\n period_id: 999,\n custom: Math.trunc((state.ts + num) / 1000),\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n }\n }\n\n async initRunDefault(id: string, run: boolean): Promise<void> {\n const relay = id.match(/(.*schedule.*\\.)runDefault/);\n\n this.clearTimeout(resetSwitch);\n\n if (relay) {\n if (run) {\n const defaultRunTime = await this.getStateAsync(relay[1] + 'run');\n if (defaultRunTime && defaultRunTime.val) {\n this.setStateAsync(relay[1] + 'runZone', defaultRunTime.val, false);\n resetSwitch = this.setTimeout(\n () => {\n this.setStateAsync(id, false, false);\n },\n (defaultRunTime.val as number) * 1000,\n );\n }\n } else {\n this.setStateAsync(relay[1] + 'stopZone', true, false);\n }\n }\n }\n\n name2id(pName: string): string {\n return (pName || '').replace(this.FORBIDDEN_CHARS, '_');\n }\n}\n\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial<utils.AdapterOptions> | undefined) => new Hydrawise(options);\n} else {\n // otherwise start the instance directly\n (() => new Hydrawise())();\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAMA,YAAuB;AACvB,mBAAkB;AAElB,MAAM,gBAAgB;AACtB,IAAI,mBAAwB;AAC5B,IAAI,mBAAwB;AAC5B,IAAI,cAAmB;AACvB,MAAM,SAAc;AAEpB,MAAM,kBAAkB,MAAM,QAAQ;AAAA,EAC3B,YAAY,UAAyC,CAAC,GAAG;AAC5D,UAAM;AAAA,MACF,GAAG;AAAA,MACH,MAAM;AAAA,IACV,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,EAC9C;AAAA,EAEA,MAAc,UAAyB;AACnC,QAAI,CAAC,KAAK,OAAO,QAAQ;AACrB,WAAK,IAAI,MAAM,qBAAqB;AAAA,IACxC,OAAO;AACH,WAAK,qBAAqB,mBAAmB,OAAO,IAAI;AAExD,UAAI;AACA,cAAM,KAAK,kBAAkB;AAE7B,2BAAmB,KAAK,YAAY,YAAY;AAC5C,gBAAM,KAAK,kBAAkB;AAAA,QACjC,GAAG,KAAK,OAAO,cAAc,GAAI;AAEjC,cAAM,KAAK,mBAAmB;AAE9B,2BAAmB,KAAK;AAAA,UACpB,YAAY;AACR,kBAAM,KAAK,mBAAmB;AAAA,UAClC;AAAA,UACA,IAA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,CAAC,YAAuD,IAAI,UAAU,OAAO;AAClG,OAAO;AAEH,GAAC,MAAM,IAAI,UAAU,GAAG;AAC5B;",
4
+ "sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.3.0\n */\n\n// The adapter-core module gives you access to the core ioBroker functions\n// you need to create an adapter\nimport * as utils from '@iobroker/adapter-core';\nimport axios from 'axios';\n\nconst hydrawise_url = 'https://api.hydrawise.com';\nlet nextpollSchedule: any = null;\nlet nextpollCustomer: any = null;\nlet resetSwitch: any = null;\nconst RELAYS: any = Object;\n\nclass Hydrawise extends utils.Adapter {\n public constructor(options: Partial<utils.AdapterOptions> = {}) {\n super({\n ...options,\n name: 'hydrawise',\n });\n\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n private async onReady(): Promise<void> {\n if (!this.config.apiKey) {\n this.log.error('No API-Key defined!');\n } else {\n void this.setStateChangedAsync('info.connection', false, true);\n\n try {\n await this.GetStatusSchedule();\n\n nextpollSchedule = this.setInterval(async () => {\n await this.GetStatusSchedule();\n }, this.config.apiInterval * 1000);\n\n await this.GetCustomerDetails();\n\n nextpollCustomer = this.setInterval(\n async () => {\n await this.GetCustomerDetails();\n },\n 5 * 60 * 1000,\n );\n } catch (error: any) {\n this.log.error(error.toString());\n }\n\n await this.subscribeStatesAsync('*');\n }\n }\n\n private async GetStatusSchedule(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.buildRequest('statusschedule.php', { api_key: this.config.apiKey })\n .then(async response => {\n if (response?.status === 200) {\n const content = response.data;\n\n void this.setStateChangedAsync('info.connection', true, true);\n\n await this.setObjectNotExistsAsync('schedule.stopall', {\n type: 'state',\n common: {\n name: {\n en: 'stop all zones',\n de: 'alle Zonen stoppen',\n ru: '\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B',\n pt: 'parar todas as zonas',\n nl: 'stop alle zones',\n fr: 'arr\u00EAter toutes les zones',\n it: 'fermare tutte le zone',\n es: 'detener todas las zonas',\n pl: 'zatrzymuj\u0105 wszystkie strefy',\n uk: '\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438',\n 'zh-cn': '\u505C\u6B62\u6240\u6709\u5730\u533A',\n },\n type: 'boolean',\n role: 'button.stop',\n read: false,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync('schedule.runall', {\n type: 'state',\n common: {\n name: {\n en: 'run all zones for x seconds',\n de: 'alle Zonen f\u00FCr x Sekunden ausf\u00FChren',\n ru: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'executar todas as zonas por x segundos',\n nl: 'ren alle zones voor x seconden',\n fr: 'ex\u00E9cuter toutes les zones pendant x secondes',\n it: 'eseguire tutte le zone per x secondi',\n es: 'ejecutar todas las zonas durante x segundos',\n pl: 'wszystkie strefy startuj\u0105 dla x sekundy',\n uk: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u8DD1\u9053\u533A',\n },\n type: 'number',\n role: 'level',\n unit: 'seconds',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync('schedule.suspendall', {\n type: 'state',\n common: {\n name: {\n en: 'suspend all zones for x seconds',\n de: 'alle Zonen f\u00FCr x Sekunden aussetzen',\n ru: '\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0437\u043E\u043D\u044B \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'suspender todas as zonas por x segundos',\n nl: 'vertaling:',\n fr: 'suspendre toutes les zones pendant x secondes',\n it: 'sospendere tutte le zone per x secondi',\n es: 'suspender todas las zonas durante x segundos',\n pl: 'wszystkie strefy zawieszenia dla x sekundy',\n uk: '\u043F\u0440\u0438\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438 \u0432\u0441\u0456 \u0437\u043E\u043D\u0438 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u505C\u6B62\u6240\u6709\u00D7\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n for (let key in content) {\n key = this.name2id(key);\n\n if (key !== 'relays' && key !== 'sensors' && key !== 'expanders' && !Number.isNaN(key)) {\n await this.setObjectNotExistsAsync(`schedule.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'message' ? 'string' : 'number',\n role: key === 'message' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n void this.setStateChangedAsync(`schedule.${key}`, content[key], true);\n\n if (key === 'time') {\n await this.setObjectNotExistsAsync('schedule.timestr', {\n type: 'state',\n common: {\n name: 'last api call',\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n\n const t = new Date(content[key] * 1000);\n\n void this.setStateChangedAsync('schedule.timestr', t.toString(), true);\n }\n }\n }\n\n for (const relay of content.relays) {\n const name = relay.relay;\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}`, {\n type: 'channel',\n common: {\n name: name.toString(),\n },\n native: {},\n });\n\n RELAYS[relay.relay] = relay.relay_id;\n\n for (let key in relay) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'name' || key === 'timestr' ? 'string' : 'number',\n role: key === 'name' || key === 'timestr' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (key === 'timestr') {\n const t = new Date();\n t.setSeconds(t.getSeconds() + relay.time);\n relay[key] = t.toString();\n }\n\n void this.setStateChangedAsync(`schedule.${relay.relay}.${key}`, relay[key], true);\n }\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.stopZone`, {\n type: 'state',\n common: {\n name: {\n en: 'stop zone',\n de: 'Zone stoppen',\n ru: '\u0437\u043E\u043D\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438',\n pt: 'zona de paragem',\n nl: 'stop zone',\n fr: \"zone d ' arr\u00EAt\",\n it: 'zona di sosta',\n es: 'zona de parada',\n pl: 'strefa stopu',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0443\u043F\u0438\u043D\u043A\u0438',\n 'zh-cn': '\u505C\u6B62\u5730\u533A',\n },\n type: 'boolean',\n role: 'button.stop',\n read: false,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runZone`, {\n type: 'state',\n common: {\n name: {\n en: 'run zone for x seconds',\n de: 'Zone f\u00FCr x Sekunden starten',\n ru: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0437\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'zona de execu\u00E7\u00E3o por x segundos',\n nl: 'ren zone voor x seconden',\n fr: 'zone de course pour x secondes',\n it: 'zona di corsa per x secondi',\n es: 'zona de ejecuci\u00F3n por x segundos',\n pl: 'strefa x sekundy',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u00D7\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.suspendZone`, {\n type: 'state',\n common: {\n name: {\n en: 'suspend zone for x seconds',\n de: 'Zone f\u00FCr x Sekunden aussetzen',\n ru: '\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u043D\u0430 x \u0441\u0435\u043A\u0443\u043D\u0434\u044B',\n pt: 'zona de suspens\u00E3o por x segundos',\n nl: 'quality over quantity (qoq) releases vertaling:',\n fr: 'zone de suspension pour x secondes',\n it: 'zona di sospensione per x secondi',\n es: 'zona de suspensi\u00F3n por x segundos',\n pl: 'strefa zawies\u0142a na x sekundy',\n uk: '\u0437\u043E\u043D\u0430 \u043F\u0456\u0434\u0432\u0456\u0441\u043A\u0438 \u0434\u043B\u044F x \u0441\u0435\u043A\u0443\u043D\u0434',\n 'zh-cn': '\u505C\u6B62x\u4E8C\u533A',\n },\n type: 'number',\n role: 'level',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectNotExistsAsync(`schedule.${relay.relay}.runDefault`, {\n type: 'state',\n common: {\n name: {\n en: 'run zone for default time',\n de: 'Zone mit Standardlaufzeit starten',\n ru: '\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0437\u043E\u043D\u0443 \u0434\u043B\u044F \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E',\n pt: 'fuso de execu\u00E7\u00E3o para o tempo padr\u00E3o',\n nl: 'run zone for default time',\n fr: 'run zone for default time',\n it: 'run zone per il tempo predefinito',\n es: 'zona de ejecuci\u00F3n por tiempo predeterminado',\n pl: 'strefa czasu domy\u015Blnego',\n uk: '\u0437\u043E\u043D\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C',\n 'zh-cn': 'a. \u6682\u505C\u65F6\u95F4\u533A',\n },\n type: 'boolean',\n role: 'button.start',\n read: true,\n write: true,\n },\n native: {},\n });\n }\n\n for (const sensor of content.sensors) {\n await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}`, {\n type: 'channel',\n common: {\n name: 'sensors',\n },\n native: {},\n });\n\n for (let key in sensor) {\n if (key !== 'relays') {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: 'number',\n role: 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n void this.setStateChangedAsync(\n `schedule.sensors.${sensor.input}.${key}`,\n sensor[key],\n true,\n );\n }\n }\n }\n }\n\n resolve(response.status);\n })\n .catch(error => {\n this.clearInterval(nextpollSchedule);\n\n if (\n error.code === 'EAI_AGAIN' ||\n error.code === 'ECONNABORTED' ||\n error.code === 'ENOTFOUND' ||\n error.response?.status === 429\n ) {\n nextpollSchedule = this.setInterval(async () => {\n await this.GetStatusSchedule();\n }, this.config.apiInterval * 1000);\n } else {\n this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n void this.setStateChangedAsync('info.connection', false, true);\n\n reject(new Error(error));\n }\n });\n });\n }\n\n private async GetCustomerDetails(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.buildRequest('customerdetails.php', { api_key: this.config.apiKey })\n .then(async response => {\n if (response?.status === 200) {\n const content = response.data;\n\n void this.setStateChangedAsync('info.connection', true, true);\n\n for (let key in content) {\n if (key !== 'controllers' && !Number.isNaN(key)) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`customer.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key === 'message' || key === 'current_controller' ? 'string' : 'number',\n role: key === 'message' || key === 'current_controller' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n void this.setStateChangedAsync(`customer.${key}`, content[key], true);\n }\n }\n\n for (const controller of content.controllers) {\n await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}`, {\n type: 'channel',\n common: {\n name: controller.name,\n },\n native: {},\n });\n\n for (let key in controller) {\n key = this.name2id(key);\n\n await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}.${key}`, {\n type: 'state',\n common: {\n name: key,\n type: key !== 'controller_id' ? 'string' : 'number',\n role: key !== 'controller_id' ? 'text' : 'value',\n read: true,\n write: false,\n },\n native: {},\n });\n\n if (key === 'last_contact') {\n const t = new Date(controller[key] * 1000);\n controller[key] = t.toString();\n }\n\n void this.setStateChangedAsync(\n `customer.controllers.${controller.name}.${key}`,\n controller[key],\n true,\n );\n }\n }\n }\n\n resolve(response.status);\n })\n .catch(error => {\n this.clearInterval(nextpollCustomer);\n\n if (\n error.code === 'EAI_AGAIN' ||\n error.code === 'ECONNABORTED' ||\n error.code === 'ENOTFOUND' ||\n error.response?.status === 429\n ) {\n nextpollCustomer = this.setInterval(\n async () => {\n await this.GetCustomerDetails();\n },\n 5 * 60 * 1000,\n );\n } else {\n this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);\n\n void this.setStateChangedAsync('info.connection', false, true);\n\n reject(new Error(error));\n }\n });\n });\n }\n\n buildRequest(service: string, params: any): Promise<any> {\n return new Promise((resolve, reject) => {\n const url = `/api/v1/${service}`;\n let lastErrorCode = 0;\n\n if (params.api_key) {\n try {\n axios({\n method: 'GET',\n baseURL: hydrawise_url,\n url: url,\n timeout: 30000,\n responseType: 'json',\n params: params,\n })\n .then(response => {\n // no error - clear up reminder\n lastErrorCode = 0;\n\n resolve(response);\n })\n .catch(error => {\n if (error.response) {\n // The request was made and the server responded with a status code\n\n this.log.warn(\n `received ${error.response.status} response from ${url} with content: ${JSON.stringify(error.response.data)}`,\n );\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n // http.ClientRequest in node.js\n\n // avoid spamming of the same error when stuck in a reconnection loop\n if (error.code === lastErrorCode) {\n this.log.debug(error.message);\n } else {\n this.log.info(`error ${error.code} from ${url}: ${error.message}`);\n lastErrorCode = error.code;\n }\n } else {\n // Something happened in setting up the request that triggered an Error\n this.log.error(error.message);\n }\n\n reject(new Error(error));\n });\n } catch (error: any) {\n reject(new Error(error));\n }\n } else {\n reject(new Error('API key is not configured'));\n }\n });\n }\n\n /**\n * Is called when adapter shuts down - callback has to be called under any circumstances!\n *\n * @param callback callback function\n */\n private onUnload(callback: () => void): void {\n try {\n this.clearInterval(nextpollSchedule);\n this.clearInterval(nextpollCustomer);\n\n callback();\n } catch {\n callback();\n }\n }\n\n /**\n * Is called if a subscribed state changes\n *\n * @param id id of the state\n * @param state state object\n */\n private onStateChange(id: string, state: ioBroker.State | null | undefined): void {\n if (state && !state.ack) {\n if (id.indexOf('stopall') !== -1) {\n void this.buildRequest('setzone.php', { api_key: this.config.apiKey, action: 'stopall' });\n } else if (id.indexOf('stop') !== -1) {\n const relay = id.match(/.*schedule\\.(.*)\\.stopZone/);\n\n if (relay && relay?.length > 1) {\n void this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'stop',\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n if (id.indexOf('runall') !== -1 && (state.val || state.val === 0)) {\n void this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'runall',\n period_id: 999,\n custom: state.val,\n });\n } else if (id.indexOf('runZone') !== -1 && (state.val || state.val === 0)) {\n const relay = id.match(/.*schedule\\.(.*)\\.runZone/);\n\n if (relay && relay?.length > 1) {\n void this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'run',\n period_id: 999,\n custom: state.val,\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n\n if (id.indexOf('runDefault') !== -1 && state.val !== null) {\n void this.initRunDefault(id, state.val as boolean);\n }\n\n if (id.indexOf('suspendall') !== -1 && (state.val || state.val === 0)) {\n const num = state.val as number;\n\n void this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'suspendall',\n period_id: 999,\n custom: Math.trunc((state.ts + num) / 1000),\n });\n } else if (id.indexOf('suspend') !== -1 && (state.val || state.val === 0)) {\n const num = state.val as number;\n const relay = id.match(/.*schedule\\.(.*)\\.suspendZone/);\n\n if (relay && relay?.length > 1) {\n void this.buildRequest('setzone.php', {\n api_key: this.config.apiKey,\n action: 'suspend',\n period_id: 999,\n custom: Math.trunc((state.ts + num) / 1000),\n relay_id: RELAYS[relay[1]],\n });\n }\n }\n }\n }\n\n async initRunDefault(id: string, run: boolean): Promise<void> {\n const relay = id.match(/(.*schedule.*\\.)runDefault/);\n\n this.clearTimeout(resetSwitch);\n\n if (relay) {\n if (run) {\n const defaultRunTime = await this.getStateAsync(`${relay[1]}run`);\n if (defaultRunTime && defaultRunTime.val) {\n void this.setState(`${relay[1]}runZone`, defaultRunTime.val, false);\n resetSwitch = this.setTimeout(\n () => {\n void this.setState(id, false, false);\n },\n (defaultRunTime.val as number) * 1000,\n );\n }\n } else {\n void this.setState(`${relay[1]}stopZone`, true, false);\n }\n }\n }\n\n name2id(pName: string): string {\n return (pName || '').replace(this.FORBIDDEN_CHARS, '_');\n }\n}\n\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial<utils.AdapterOptions> | undefined) => new Hydrawise(options);\n} else {\n // otherwise start the instance directly\n (() => new Hydrawise())();\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAMA,YAAuB;AACvB,mBAAkB;AAElB,MAAM,gBAAgB;AACtB,IAAI,mBAAwB;AAC5B,IAAI,mBAAwB;AAC5B,IAAI,cAAmB;AACvB,MAAM,SAAc;AAEpB,MAAM,kBAAkB,MAAM,QAAQ;AAAA,EAC3B,YAAY,UAAyC,CAAC,GAAG;AAC5D,UAAM;AAAA,MACF,GAAG;AAAA,MACH,MAAM;AAAA,IACV,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,EAC9C;AAAA,EAEA,MAAc,UAAyB;AACnC,QAAI,CAAC,KAAK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M,4BAA4B;AAEnD,SAAK,aAAa,WAAW;AAE7B,QAAI,OAAO;AACP,UAAI,KAAK;AACL,cAAM,iBAAiB,MAAM,KAAK,cAAc,GAAG,MAAM,CAAC,CAAC,KAAK;AAChE,YAAI,kBAAkB,eAAe,KAAK;AACtC,eAAK,KAAK,SAAS,GAAG,MAAM,CAAC,CAAC,WAAW,eAAe,KAAK,KAAK;AAClE,wBAAc,KAAK;AAAA,YACf,MAAM;AACF,mBAAK,KAAK,SAAS,IAAI,OAAO,KAAK;AAAA,YACvC;AAAA,YACC,eAAe,MAAiB;AAAA,UACrC;AAAA,QACJ;AAAA,MACJ,OAAO;AACH,aAAK,KAAK,SAAS,GAAG,MAAM,CAAC,CAAC,YAAY,MAAM,KAAK;AAAA,MACzD;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,QAAQ,OAAuB;AAC3B,YAAQ,SAAS,IAAI,QAAQ,KAAK,iBAAiB,GAAG;AAAA,EAC1D;AACJ;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAEzB,SAAO,UAAU,CAAC,YAAuD,IAAI,UAAU,OAAO;AAClG,OAAO;AAEH,GAAC,MAAM,IAAI,UAAU,GAAG;AAC5B;",
6
6
  "names": ["axios"]
7
7
  }
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "hydrawise",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "news": {
6
+ "1.0.3": {
7
+ "en": "updated dependencies",
8
+ "de": "aktualisierte abhängigkeiten",
9
+ "ru": "обновленные зависимости",
10
+ "pt": "dependências atualizadas",
11
+ "nl": "bijgewerkte afhankelijkheden",
12
+ "fr": "dépendances actualisées",
13
+ "it": "dipendenze aggiornate",
14
+ "es": "dependencias actualizadas",
15
+ "pl": "zaktualizowane zależności",
16
+ "uk": "оновлені залежності",
17
+ "zh-cn": "更新的依赖关系"
18
+ },
6
19
  "1.0.2": {
7
20
  "en": "fixed issues detected by repository checker",
8
21
  "de": "von repository checker erkannte probleme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.hydrawise",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Adapter to control the Hydrawise irrigation control system",
5
5
  "author": {
6
6
  "name": "SentiQ",
@@ -21,44 +21,29 @@
21
21
  "url": "git@github.com:SentiQ/ioBroker.hydrawise.git"
22
22
  },
23
23
  "engines": {
24
- "node": ">=18"
24
+ "node": ">=20"
25
25
  },
26
26
  "dependencies": {
27
- "@iobroker/adapter-core": "^3.1.6",
28
- "axios": "^1.7.7"
27
+ "@iobroker/adapter-core": "^3.3.2",
28
+ "axios": "^1.13.2"
29
29
  },
30
30
  "devDependencies": {
31
- "@alcalzone/release-script": "^3.8.0",
32
- "@alcalzone/release-script-plugin-iobroker": "^3.7.0",
33
- "@alcalzone/release-script-plugin-license": "^3.5.9",
34
- "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
35
- "@iobroker/adapter-dev": "^1.3.0",
36
- "@iobroker/testing": "^4.1.3",
37
- "@tsconfig/node16": "^16.1.0",
38
- "@types/chai": "^4.3.4",
39
- "@types/chai-as-promised": "^7.1.5",
40
- "@types/mocha": "^10.0.2",
41
- "@types/node": "^20.13.0",
31
+ "@alcalzone/release-script": "^5.0.0",
32
+ "@alcalzone/release-script-plugin-iobroker": "^4.0.0",
33
+ "@alcalzone/release-script-plugin-license": "^4.0.0",
34
+ "@alcalzone/release-script-plugin-manual-review": "^4.0.0",
35
+ "@iobroker/adapter-dev": "^1.4.0",
36
+ "@iobroker/eslint-config": "^2.2.0",
37
+ "@iobroker/testing": "^5.2.2",
38
+ "@tsconfig/node16": "^16.1.8",
39
+ "@types/node": "^24.10.1",
42
40
  "@types/proxyquire": "^1.3.31",
43
- "@types/sinon": "^17.0.3",
44
- "@types/sinon-chai": "^3.2.10",
45
- "@typescript-eslint/eslint-plugin": "^5.60.1",
46
- "@typescript-eslint/parser": "^5.60.1",
47
- "chai": "^4.3.8",
48
- "chai-as-promised": "^8.0.0",
49
- "eslint": "^8.56.0",
50
- "eslint-config-prettier": "^9.0.0",
51
- "eslint-plugin-prettier": "^5.2.1",
52
- "mocha": "^10.3.0",
53
- "nyc": "^15.1.0",
54
- "prettier": "^3.3.2",
41
+ "nyc": "^17.1.0",
55
42
  "proxyquire": "^2.1.3",
56
- "rimraf": "^5.0.7",
57
- "sinon": "^18.0.0",
58
- "sinon-chai": "^3.7.0",
43
+ "rimraf": "^6.0.1",
59
44
  "source-map-support": "^0.5.21",
60
45
  "ts-node": "^10.9.1",
61
- "typescript": "~5.5.4"
46
+ "typescript": "~5.9.3"
62
47
  },
63
48
  "main": "build/main.js",
64
49
  "files": [
@@ -82,7 +67,7 @@
82
67
  "test": "npm run test:ts && npm run test:package",
83
68
  "check": "tsc --noEmit",
84
69
  "coverage": "nyc npm run test:ts",
85
- "lint": "eslint --ext .ts src/ --fix",
70
+ "lint": "eslint -c eslint.config.mjs .",
86
71
  "translate": "translate-adapter",
87
72
  "release": "release-script patch --yes",
88
73
  "release-minor": "release-script minor --yes",