iobroker.hydrawise 0.0.6
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 +21 -0
- package/README.md +55 -0
- package/admin/hydrawise.jpg +0 -0
- package/admin/i18n/de/translations.json +4 -0
- package/admin/i18n/en/translations.json +4 -0
- package/admin/i18n/es/translations.json +4 -0
- package/admin/i18n/fr/translations.json +4 -0
- package/admin/i18n/it/translations.json +4 -0
- package/admin/i18n/nl/translations.json +4 -0
- package/admin/i18n/pl/translations.json +4 -0
- package/admin/i18n/pt/translations.json +4 -0
- package/admin/i18n/ru/translations.json +4 -0
- package/admin/i18n/uk/translations.json +4 -0
- package/admin/i18n/zh-cn/translations.json +4 -0
- package/admin/jsonConfig.json +11 -0
- package/build/main.js +383 -0
- package/build/main.js.map +7 -0
- package/io-package.json +215 -0
- package/package.json +113 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 SentiQ <fischer.yves@web.de>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# ioBroker.hydrawise
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/iobroker.hydrawise)
|
|
6
|
+
[](https://www.npmjs.com/package/iobroker.hydrawise)
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
[](https://nodei.co/npm/iobroker.hydrawise/)
|
|
11
|
+
|
|
12
|
+
## Changelog
|
|
13
|
+
### 0.0.6 (2023-05-24)
|
|
14
|
+
|
|
15
|
+
- (SentiQ) improving log messages
|
|
16
|
+
|
|
17
|
+
### 0.0.5 (2023-05-24)
|
|
18
|
+
|
|
19
|
+
- (SentiQ) updated packages
|
|
20
|
+
|
|
21
|
+
### 0.0.4 (2023-05-24)
|
|
22
|
+
|
|
23
|
+
- (SentiQ) testing
|
|
24
|
+
|
|
25
|
+
### 0.0.3 (2023-05-24)
|
|
26
|
+
|
|
27
|
+
- (SentiQ) added zone controls and Ukrainian language
|
|
28
|
+
|
|
29
|
+
### 0.0.2 (2023-05-23)
|
|
30
|
+
|
|
31
|
+
- (SentiQ) Initial commit after refactoring code
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT License
|
|
36
|
+
|
|
37
|
+
Copyright (c) 2023 SentiQ <fischer.yves@web.de>
|
|
38
|
+
|
|
39
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
40
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
41
|
+
in the Software without restriction, including without limitation the rights
|
|
42
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
43
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
44
|
+
furnished to do so, subject to the following conditions:
|
|
45
|
+
|
|
46
|
+
The above copyright notice and this permission notice shall be included in all
|
|
47
|
+
copies or substantial portions of the Software.
|
|
48
|
+
|
|
49
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
50
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
51
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
52
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
53
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
54
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
55
|
+
SOFTWARE.
|
|
Binary file
|
package/build/main.js
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
20
|
+
var utils = __toESM(require("@iobroker/adapter-core"));
|
|
21
|
+
var import_axios = __toESM(require("axios"));
|
|
22
|
+
const hydrawise_url = "https://api.hydrawise.com";
|
|
23
|
+
let nextpollSchedule = null;
|
|
24
|
+
let nextpollCustomer = null;
|
|
25
|
+
const RELAYS = Object;
|
|
26
|
+
class Hydrawise extends utils.Adapter {
|
|
27
|
+
constructor(options = {}) {
|
|
28
|
+
super({
|
|
29
|
+
...options,
|
|
30
|
+
name: "hydrawise"
|
|
31
|
+
});
|
|
32
|
+
this.on("ready", this.onReady.bind(this));
|
|
33
|
+
this.on("stateChange", this.onStateChange.bind(this));
|
|
34
|
+
this.on("unload", this.onUnload.bind(this));
|
|
35
|
+
}
|
|
36
|
+
async onReady() {
|
|
37
|
+
if (!this.config.apiKey) {
|
|
38
|
+
this.log.error("No API-Key definded!");
|
|
39
|
+
} else {
|
|
40
|
+
this.log.info("config apiKey: " + this.config.apiKey);
|
|
41
|
+
this.setStateChangedAsync("info.connection", false, true);
|
|
42
|
+
await this.GetStatusSchedule(this.config.apiKey);
|
|
43
|
+
await this.GetCustomerDetails(this.config.apiKey);
|
|
44
|
+
await this.subscribeStatesAsync("*");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async GetStatusSchedule(apiKey) {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
nextpollSchedule = nextpollSchedule || this.setTimeout(() => {
|
|
50
|
+
nextpollSchedule = null;
|
|
51
|
+
this.GetStatusSchedule(apiKey);
|
|
52
|
+
}, 6e4);
|
|
53
|
+
this.buildRequest("statusschedule.php", { api_key: this.config.apiKey }).then(async (response) => {
|
|
54
|
+
if (response.status === 200) {
|
|
55
|
+
const content = response.data;
|
|
56
|
+
this.setStateChangedAsync("info.connection", true, true);
|
|
57
|
+
await this.setObjectNotExistsAsync("schedule.stopall", {
|
|
58
|
+
type: "state",
|
|
59
|
+
common: {
|
|
60
|
+
name: "stopall",
|
|
61
|
+
type: "boolean",
|
|
62
|
+
role: "button",
|
|
63
|
+
read: false,
|
|
64
|
+
write: true
|
|
65
|
+
},
|
|
66
|
+
native: {}
|
|
67
|
+
});
|
|
68
|
+
await this.setObjectNotExistsAsync("schedule.runall", {
|
|
69
|
+
type: "state",
|
|
70
|
+
common: {
|
|
71
|
+
name: "runall for x seconds",
|
|
72
|
+
type: "number",
|
|
73
|
+
role: "value",
|
|
74
|
+
read: false,
|
|
75
|
+
write: true
|
|
76
|
+
},
|
|
77
|
+
native: {}
|
|
78
|
+
});
|
|
79
|
+
await this.setObjectNotExistsAsync("schedule.suspendall", {
|
|
80
|
+
type: "state",
|
|
81
|
+
common: {
|
|
82
|
+
name: "suspendall for x seconds",
|
|
83
|
+
type: "number",
|
|
84
|
+
role: "value",
|
|
85
|
+
read: false,
|
|
86
|
+
write: true
|
|
87
|
+
},
|
|
88
|
+
native: {}
|
|
89
|
+
});
|
|
90
|
+
for (const key in content) {
|
|
91
|
+
if (key !== "relays" && key !== "sensors" && key !== "expanders") {
|
|
92
|
+
await this.setObjectNotExistsAsync(`schedule.${key}`, {
|
|
93
|
+
type: "state",
|
|
94
|
+
common: {
|
|
95
|
+
name: key,
|
|
96
|
+
type: key === "message" ? "string" : "number",
|
|
97
|
+
role: key === "message" ? "text" : "value",
|
|
98
|
+
read: true,
|
|
99
|
+
write: false
|
|
100
|
+
},
|
|
101
|
+
native: {}
|
|
102
|
+
});
|
|
103
|
+
this.setStateChangedAsync(`schedule.${key}`, content[key], true);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (const relay of content.relays) {
|
|
107
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.name}`, {
|
|
108
|
+
type: "channel",
|
|
109
|
+
common: {
|
|
110
|
+
name: relay.name
|
|
111
|
+
},
|
|
112
|
+
native: {}
|
|
113
|
+
});
|
|
114
|
+
RELAYS[relay.name] = relay.relay_id;
|
|
115
|
+
for (const key in relay) {
|
|
116
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.name}.${key}`, {
|
|
117
|
+
type: "state",
|
|
118
|
+
common: {
|
|
119
|
+
name: key,
|
|
120
|
+
type: key === "name" ? "string" : "number",
|
|
121
|
+
role: key === "name" ? "text" : "value",
|
|
122
|
+
read: true,
|
|
123
|
+
write: false
|
|
124
|
+
},
|
|
125
|
+
native: {}
|
|
126
|
+
});
|
|
127
|
+
this.setStateChangedAsync(`schedule.${relay.name}.${key}`, relay[key], true);
|
|
128
|
+
}
|
|
129
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.name}.stopZone`, {
|
|
130
|
+
type: "state",
|
|
131
|
+
common: {
|
|
132
|
+
name: "stop zone",
|
|
133
|
+
type: "boolean",
|
|
134
|
+
role: "button",
|
|
135
|
+
read: false,
|
|
136
|
+
write: true
|
|
137
|
+
},
|
|
138
|
+
native: {}
|
|
139
|
+
});
|
|
140
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.name}.runZone`, {
|
|
141
|
+
type: "state",
|
|
142
|
+
common: {
|
|
143
|
+
name: "run zone for x seconds",
|
|
144
|
+
type: "number",
|
|
145
|
+
role: "value",
|
|
146
|
+
read: false,
|
|
147
|
+
write: true
|
|
148
|
+
},
|
|
149
|
+
native: {}
|
|
150
|
+
});
|
|
151
|
+
await this.setObjectNotExistsAsync(`schedule.${relay.name}.suspendZone`, {
|
|
152
|
+
type: "state",
|
|
153
|
+
common: {
|
|
154
|
+
name: "suspend zone for x seconds",
|
|
155
|
+
type: "number",
|
|
156
|
+
role: "value",
|
|
157
|
+
read: false,
|
|
158
|
+
write: true
|
|
159
|
+
},
|
|
160
|
+
native: {}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
for (const sensor of content.sensors) {
|
|
164
|
+
await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}`, {
|
|
165
|
+
type: "channel",
|
|
166
|
+
common: {
|
|
167
|
+
name: "sensors"
|
|
168
|
+
},
|
|
169
|
+
native: {}
|
|
170
|
+
});
|
|
171
|
+
for (const key in sensor) {
|
|
172
|
+
if (key !== "relays") {
|
|
173
|
+
await this.setObjectNotExistsAsync(`schedule.sensors.${sensor.input}.${key}`, {
|
|
174
|
+
type: "state",
|
|
175
|
+
common: {
|
|
176
|
+
name: key,
|
|
177
|
+
type: "number",
|
|
178
|
+
role: "value",
|
|
179
|
+
read: true,
|
|
180
|
+
write: false
|
|
181
|
+
},
|
|
182
|
+
native: {}
|
|
183
|
+
});
|
|
184
|
+
this.setStateChangedAsync(
|
|
185
|
+
`schedule.sensors.${sensor.input}.${key}`,
|
|
186
|
+
sensor[key],
|
|
187
|
+
true
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
resolve(response.status);
|
|
194
|
+
}).catch((error) => {
|
|
195
|
+
this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);
|
|
196
|
+
this.setStateChangedAsync("info.connection", false, true);
|
|
197
|
+
reject(error);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
async GetCustomerDetails(apiKey) {
|
|
202
|
+
return new Promise((resolve, reject) => {
|
|
203
|
+
nextpollCustomer = nextpollCustomer || this.setTimeout(() => {
|
|
204
|
+
nextpollCustomer = null;
|
|
205
|
+
this.GetCustomerDetails(apiKey);
|
|
206
|
+
}, 60 * 5e3);
|
|
207
|
+
this.buildRequest("customerdetails.php", { api_key: this.config.apiKey }).then(async (response) => {
|
|
208
|
+
if (response.status === 200) {
|
|
209
|
+
const content = response.data;
|
|
210
|
+
this.setStateChangedAsync("info.connection", true, true);
|
|
211
|
+
for (const key in content) {
|
|
212
|
+
if (key !== "controllers") {
|
|
213
|
+
await this.setObjectNotExistsAsync(`customer.${key}`, {
|
|
214
|
+
type: "state",
|
|
215
|
+
common: {
|
|
216
|
+
name: key,
|
|
217
|
+
type: key === "message" ? "string" : "number",
|
|
218
|
+
role: key === "message" ? "text" : "value",
|
|
219
|
+
read: true,
|
|
220
|
+
write: false
|
|
221
|
+
},
|
|
222
|
+
native: {}
|
|
223
|
+
});
|
|
224
|
+
this.setStateChangedAsync(`customer.${key}`, content[key], true);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
for (const controller of content.controllers) {
|
|
228
|
+
await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}`, {
|
|
229
|
+
type: "channel",
|
|
230
|
+
common: {
|
|
231
|
+
name: controller.name
|
|
232
|
+
},
|
|
233
|
+
native: {}
|
|
234
|
+
});
|
|
235
|
+
for (const key in controller) {
|
|
236
|
+
await this.setObjectNotExistsAsync(`customer.controllers.${controller.name}.${key}`, {
|
|
237
|
+
type: "state",
|
|
238
|
+
common: {
|
|
239
|
+
name: key,
|
|
240
|
+
type: key !== "controller_id" ? "string" : "number",
|
|
241
|
+
role: key !== "controller_id" ? "text" : "value",
|
|
242
|
+
read: true,
|
|
243
|
+
write: false
|
|
244
|
+
},
|
|
245
|
+
native: {}
|
|
246
|
+
});
|
|
247
|
+
this.setStateChangedAsync(
|
|
248
|
+
`customer.controllers.${controller.name}.${key}`,
|
|
249
|
+
controller[key],
|
|
250
|
+
true
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
resolve(response.status);
|
|
256
|
+
}).catch((error) => {
|
|
257
|
+
this.log.debug(`(stats) received error - API is now offline: ${JSON.stringify(error)}`);
|
|
258
|
+
this.setStateChangedAsync("info.connection", false, true);
|
|
259
|
+
reject(error);
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
buildRequest(service, params) {
|
|
264
|
+
return new Promise((resolve, reject) => {
|
|
265
|
+
const url = `/api/v1/${service}`;
|
|
266
|
+
let lastErrorCode = 0;
|
|
267
|
+
if (params.api_key) {
|
|
268
|
+
this.log.debug(`sending GET request to "${url}" with params: ${JSON.stringify(params)}`);
|
|
269
|
+
(0, import_axios.default)({
|
|
270
|
+
method: "GET",
|
|
271
|
+
baseURL: hydrawise_url,
|
|
272
|
+
url,
|
|
273
|
+
timeout: 3e3,
|
|
274
|
+
responseType: "json",
|
|
275
|
+
params
|
|
276
|
+
}).then((response) => {
|
|
277
|
+
this.log.debug(
|
|
278
|
+
`received ${response.status} response from "${url}" with content: ${JSON.stringify(
|
|
279
|
+
response.data
|
|
280
|
+
)}`
|
|
281
|
+
);
|
|
282
|
+
lastErrorCode = 0;
|
|
283
|
+
resolve(response);
|
|
284
|
+
}).catch((error) => {
|
|
285
|
+
if (error.response) {
|
|
286
|
+
this.log.warn(
|
|
287
|
+
`received ${error.response.status} response from ${url} with content: ${JSON.stringify(
|
|
288
|
+
error.response.data
|
|
289
|
+
)}`
|
|
290
|
+
);
|
|
291
|
+
} else if (error.request) {
|
|
292
|
+
if (error.code === lastErrorCode) {
|
|
293
|
+
this.log.debug(error.message);
|
|
294
|
+
} else {
|
|
295
|
+
this.log.info(`error ${error.code} from ${url}: ${error.message}`);
|
|
296
|
+
lastErrorCode = error.code;
|
|
297
|
+
}
|
|
298
|
+
} else {
|
|
299
|
+
this.log.error(error.message);
|
|
300
|
+
}
|
|
301
|
+
reject(error);
|
|
302
|
+
});
|
|
303
|
+
} else {
|
|
304
|
+
reject("Device IP is not configured");
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
onUnload(callback) {
|
|
309
|
+
try {
|
|
310
|
+
clearTimeout(nextpollSchedule);
|
|
311
|
+
clearTimeout(nextpollCustomer);
|
|
312
|
+
callback();
|
|
313
|
+
} catch (e) {
|
|
314
|
+
callback();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
onStateChange(id, state) {
|
|
318
|
+
if (state) {
|
|
319
|
+
console.log("state", state);
|
|
320
|
+
this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`);
|
|
321
|
+
if (id.indexOf("stopall") !== -1) {
|
|
322
|
+
this.buildRequest("setzone.php", { api_key: this.config.apiKey, action: "stopall" });
|
|
323
|
+
} else if (id.indexOf("stop") !== -1) {
|
|
324
|
+
const relay = id.match(/.*schedule\.(.*)\.stopZone/);
|
|
325
|
+
if (relay && (relay == null ? void 0 : relay.length) > 1) {
|
|
326
|
+
this.buildRequest("setzone.php", {
|
|
327
|
+
api_key: this.config.apiKey,
|
|
328
|
+
action: "stop",
|
|
329
|
+
relay_id: RELAYS[relay[1]]
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (id.indexOf("runall") !== -1 && (state.val || state.val === 0)) {
|
|
334
|
+
this.buildRequest("setzone.php", {
|
|
335
|
+
api_key: this.config.apiKey,
|
|
336
|
+
action: "runall",
|
|
337
|
+
period_id: 999,
|
|
338
|
+
custom: state.val
|
|
339
|
+
});
|
|
340
|
+
} else if (id.indexOf("run") !== -1 && (state.val || state.val === 0)) {
|
|
341
|
+
const relay = id.match(/.*schedule\.(.*)\.runZone/);
|
|
342
|
+
if (relay && (relay == null ? void 0 : relay.length) > 1) {
|
|
343
|
+
this.buildRequest("setzone.php", {
|
|
344
|
+
api_key: this.config.apiKey,
|
|
345
|
+
action: "run",
|
|
346
|
+
period_id: 999,
|
|
347
|
+
custom: state.val,
|
|
348
|
+
relay_id: RELAYS[relay[1]]
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (id.indexOf("suspendall") !== -1 && (state.val || state.val === 0)) {
|
|
353
|
+
const num = state.val;
|
|
354
|
+
this.buildRequest("setzone.php", {
|
|
355
|
+
api_key: this.config.apiKey,
|
|
356
|
+
action: "suspendall",
|
|
357
|
+
period_id: 999,
|
|
358
|
+
custom: Math.trunc((state.ts + num) / 1e3)
|
|
359
|
+
});
|
|
360
|
+
} else if (id.indexOf("suspend") !== -1 && (state.val || state.val === 0)) {
|
|
361
|
+
const num = state.val;
|
|
362
|
+
const relay = id.match(/.*schedule\.(.*)\.suspendZone/);
|
|
363
|
+
if (relay && (relay == null ? void 0 : relay.length) > 1) {
|
|
364
|
+
this.buildRequest("setzone.php", {
|
|
365
|
+
api_key: this.config.apiKey,
|
|
366
|
+
action: "suspend",
|
|
367
|
+
period_id: 999,
|
|
368
|
+
custom: Math.trunc((state.ts + num) / 1e3),
|
|
369
|
+
relay_id: RELAYS[relay[1]]
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
} else {
|
|
374
|
+
this.log.info(`state ${id} deleted`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (require.main !== module) {
|
|
379
|
+
module.exports = (options) => new Hydrawise(options);
|
|
380
|
+
} else {
|
|
381
|
+
(() => new Hydrawise())();
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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> | undefined) => new Hydrawise(options);\n} else {\n\t// otherwise start the instance directly\n\t(() => new Hydrawise())();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAMA,YAAuB;AACvB,mBAAkB;AAElB,MAAM,gBAAgB;AACtB,IAAI,mBAAwB;AAC5B,IAAI,mBAAwB;AAC5B,MAAM,SAAc;AAEpB,MAAM,kBAAkB,MAAM,QAAQ;AAAA,EAC9B,YAAY,UAAyC,CAAC,GAAG;AAC/D,UAAM;AAAA,MACL,GAAG;AAAA,MACH,MAAM;AAAA,IACP,CAAC;AAED,SAAK,GAAG,SAAS,KAAK,QAAQ,KAAK,IAAI,CAAC;AACxC,SAAK,GAAG,eAAe,KAAK,cAAc,KAAK,IAAI,CAAC;AACpD,SAAK,GAAG,UAAU,KAAK,SAAS,KAAK,IAAI,CAAC;AAAA,EAC3C;AAAA,EAEA,MAAc,UAAyB;AACtC,QAAI,CAAC,KAAK,OAAO,QAAQ;AACxB,WAAK,IAAI,MAAM,sBAAsB;AAAA,IACtC,OAAO;AACN,WAAK,IAAI,KAAK,oBAAoB,KAAK,OAAO,MAAM;AAEpD,WAAK,qBAAqB,mBAAmB,OAAO,IAAI;AAExD,YAAM,KAAK,kBAAkB,KAAK,OAAO,MAAM;AAE/C,YAAM,KAAK,mBAAmB,KAAK,OAAO,MAAM;AAEhD,YAAM,KAAK,qBAAqB,GAAG;AAAA,IACpC;AAAA,EACD;AAAA,EAEA,MAAc,kBAAkB,QAA+B;AAC9D,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACvC,yBACC,oBACA,KAAK,WAAW,MAAM;AACrB,2BAAmB;AACnB,aAAK,kBAAkB,MAAM;AAAA,MAC9B,GAAG,GAAK;AAET,WAAK,aAAa,sBAAsB,EAAE,SAAS,KAAK,OAAO,OAAO,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UACrB,QAAQ;AAAA,UACR,WAAW;AAAA,UACX,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,GAAI;AAAA,QAC3C,CAAC;AAAA,MACF,WAAW,GAAG,QAAQ,SAAS,MAAM,OAAO,MAAM,OAAO,MAAM,QAAQ,IAAI;AAC1E,cAAM,MAAM,MAAM;AAClB,cAAM,QAAQ,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
|
+
"names": ["axios"]
|
|
7
|
+
}
|
package/io-package.json
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
{
|
|
2
|
+
"common": {
|
|
3
|
+
"name": "hydrawise",
|
|
4
|
+
"version": "0.0.6",
|
|
5
|
+
"news": {
|
|
6
|
+
"0.0.6": {
|
|
7
|
+
"en": "improving log messages",
|
|
8
|
+
"de": "verbesserung der log-nachrichten",
|
|
9
|
+
"ru": "улучшение лог-сообщений",
|
|
10
|
+
"pt": "melhorar as mensagens de log",
|
|
11
|
+
"nl": "het verbeteren van logberichten",
|
|
12
|
+
"fr": "améliorer les messages journaux",
|
|
13
|
+
"it": "migliorare i messaggi di log",
|
|
14
|
+
"es": "mejorar los mensajes de registro",
|
|
15
|
+
"pl": "udoskonalać",
|
|
16
|
+
"uk": "поліпшення повідомлень журналу",
|
|
17
|
+
"zh-cn": "b. 改进信息"
|
|
18
|
+
},
|
|
19
|
+
"0.0.5": {
|
|
20
|
+
"en": "improving log messages",
|
|
21
|
+
"de": "verbesserung der log-nachrichten",
|
|
22
|
+
"ru": "улучшение лог-сообщений",
|
|
23
|
+
"pt": "melhorar as mensagens de log",
|
|
24
|
+
"nl": "het verbeteren van logberichten",
|
|
25
|
+
"fr": "améliorer les messages journaux",
|
|
26
|
+
"it": "migliorare i messaggi di log",
|
|
27
|
+
"es": "mejorar los mensajes de registro",
|
|
28
|
+
"pl": "udoskonalać",
|
|
29
|
+
"uk": "поліпшення повідомлень журналу",
|
|
30
|
+
"zh-cn": "b. 改进信息"
|
|
31
|
+
},
|
|
32
|
+
"0.0.4": {
|
|
33
|
+
"en": "testing",
|
|
34
|
+
"de": "prüfverfahren",
|
|
35
|
+
"ru": "тестирование",
|
|
36
|
+
"pt": "testes",
|
|
37
|
+
"nl": "testen",
|
|
38
|
+
"fr": "essais",
|
|
39
|
+
"it": "test di prova",
|
|
40
|
+
"es": "pruebas",
|
|
41
|
+
"pl": "testować",
|
|
42
|
+
"uk": "тестування",
|
|
43
|
+
"zh-cn": "试验"
|
|
44
|
+
},
|
|
45
|
+
"0.0.3": {
|
|
46
|
+
"en": "added zone controls and Ukrainian language",
|
|
47
|
+
"de": "zusätzliche zonensteuerung",
|
|
48
|
+
"ru": "добавленный контроль зоны",
|
|
49
|
+
"pt": "controles de zona adicionados",
|
|
50
|
+
"nl": "vertaling:",
|
|
51
|
+
"fr": "contrôles des zones ajoutées",
|
|
52
|
+
"it": "comandi di zona aggiunti",
|
|
53
|
+
"es": "controles de zonas",
|
|
54
|
+
"pl": "kontrola strefy",
|
|
55
|
+
"uk": "додано контроль зони",
|
|
56
|
+
"zh-cn": "附加区管制"
|
|
57
|
+
},
|
|
58
|
+
"0.0.2": {
|
|
59
|
+
"en": "Refactoring",
|
|
60
|
+
"de": "Herstellung",
|
|
61
|
+
"ru": "Рефакторинг",
|
|
62
|
+
"pt": "Refactoring",
|
|
63
|
+
"nl": "Refactor",
|
|
64
|
+
"fr": "Refactoring",
|
|
65
|
+
"it": "Refactoring",
|
|
66
|
+
"es": "Refactoring",
|
|
67
|
+
"pl": "Refaktor",
|
|
68
|
+
"uk": "Рефакторинг",
|
|
69
|
+
"zh-cn": "评 注"
|
|
70
|
+
},
|
|
71
|
+
"0.0.1": {
|
|
72
|
+
"en": "initial release",
|
|
73
|
+
"de": "Erstveröffentlichung",
|
|
74
|
+
"ru": "Начальная версия",
|
|
75
|
+
"pt": "lançamento inicial",
|
|
76
|
+
"nl": "Eerste uitgave",
|
|
77
|
+
"fr": "Première version",
|
|
78
|
+
"it": "Versione iniziale",
|
|
79
|
+
"es": "Versión inicial",
|
|
80
|
+
"pl": "Pierwsze wydanie",
|
|
81
|
+
"uk": "початковий реліз",
|
|
82
|
+
"zh-cn": "首次出版"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"titleLang": {
|
|
86
|
+
"en": "Hydrawise",
|
|
87
|
+
"de": "Hydrawise",
|
|
88
|
+
"ru": "Hydrawise",
|
|
89
|
+
"pt": "Hydrawise",
|
|
90
|
+
"nl": "Hydrawise",
|
|
91
|
+
"fr": "Hydrawise",
|
|
92
|
+
"it": "Hydrawise",
|
|
93
|
+
"es": "Hydrawise",
|
|
94
|
+
"pl": "Hydrawise",
|
|
95
|
+
"uk": "Hydrawise",
|
|
96
|
+
"zh-cn": "Hydrawise"
|
|
97
|
+
},
|
|
98
|
+
"desc": {
|
|
99
|
+
"en": "Adapter to control the Hydrawise irrigation control system",
|
|
100
|
+
"de": "Adapter to control the Hydrawise irrigation control system",
|
|
101
|
+
"ru": "Adapter to control the Hydrawise irrigation control system",
|
|
102
|
+
"pt": "Adapter to control the Hydrawise irrigation control system",
|
|
103
|
+
"nl": "Adapter to control the Hydrawise irrigation control system",
|
|
104
|
+
"fr": "Adapter to control the Hydrawise irrigation control system",
|
|
105
|
+
"it": "Adapter to control the Hydrawise irrigation control system",
|
|
106
|
+
"es": "Adapter to control the Hydrawise irrigation control system",
|
|
107
|
+
"pl": "Adapter to control the Hydrawise irrigation control system",
|
|
108
|
+
"uk": "Adapter to control the Hydrawise irrigation control system",
|
|
109
|
+
"zh-cn": "Adapter to control the Hydrawise irrigation control system"
|
|
110
|
+
},
|
|
111
|
+
"authors": [
|
|
112
|
+
"SentiQ <fischer.yves@web.de>"
|
|
113
|
+
],
|
|
114
|
+
"keywords": [
|
|
115
|
+
"hydrawise",
|
|
116
|
+
"hunter",
|
|
117
|
+
"irrigation",
|
|
118
|
+
"watering",
|
|
119
|
+
"garden"
|
|
120
|
+
],
|
|
121
|
+
"license": "MIT",
|
|
122
|
+
"platform": "Javascript/Node.js",
|
|
123
|
+
"main": "build/main.js",
|
|
124
|
+
"icon": "hydrawise.jpg",
|
|
125
|
+
"enabled": true,
|
|
126
|
+
"extIcon": "https://raw.githubusercontent.com/SentiQ/ioBroker.hydrawise/main/admin/hydrawise.jpg",
|
|
127
|
+
"readme": "https://github.com/SentiQ/ioBroker.hydrawise/blob/main/README.md",
|
|
128
|
+
"loglevel": "info",
|
|
129
|
+
"mode": "daemon",
|
|
130
|
+
"type": "garden",
|
|
131
|
+
"compact": true,
|
|
132
|
+
"connectionType": "cloud",
|
|
133
|
+
"dataSource": "poll",
|
|
134
|
+
"adminUI": {
|
|
135
|
+
"config": "json"
|
|
136
|
+
},
|
|
137
|
+
"dependencies": [
|
|
138
|
+
{
|
|
139
|
+
"js-controller": ">=3.3.22"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"globalDependencies": [
|
|
143
|
+
{
|
|
144
|
+
"admin": ">=5.1.13"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"native": {
|
|
149
|
+
"apiKey": ""
|
|
150
|
+
},
|
|
151
|
+
"objects": [],
|
|
152
|
+
"instanceObjects": [
|
|
153
|
+
{
|
|
154
|
+
"_id": "info",
|
|
155
|
+
"type": "channel",
|
|
156
|
+
"common": {
|
|
157
|
+
"name": "Information"
|
|
158
|
+
},
|
|
159
|
+
"native": {}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"_id": "info.connection",
|
|
163
|
+
"type": "state",
|
|
164
|
+
"common": {
|
|
165
|
+
"role": "indicator.connected",
|
|
166
|
+
"name": "Device or service connected",
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"read": true,
|
|
169
|
+
"write": false,
|
|
170
|
+
"def": false
|
|
171
|
+
},
|
|
172
|
+
"native": {}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"_id": "customer",
|
|
176
|
+
"type": "channel",
|
|
177
|
+
"common": {
|
|
178
|
+
"name": {
|
|
179
|
+
"en": "Controllers",
|
|
180
|
+
"de": "Controller",
|
|
181
|
+
"ru": "Контроллеры",
|
|
182
|
+
"pt": "Controladores",
|
|
183
|
+
"nl": "Controller",
|
|
184
|
+
"fr": "Contrôleurs",
|
|
185
|
+
"it": "Regolatori",
|
|
186
|
+
"es": "Controladores",
|
|
187
|
+
"pl": "Kontroler",
|
|
188
|
+
"uk": "Контролери",
|
|
189
|
+
"zh-cn": "主计长"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"native": {}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"_id": "schedule",
|
|
196
|
+
"type": "channel",
|
|
197
|
+
"common": {
|
|
198
|
+
"name": {
|
|
199
|
+
"en": "Schedule",
|
|
200
|
+
"de": "Zeitplan",
|
|
201
|
+
"ru": "Расписание",
|
|
202
|
+
"pt": "Programação",
|
|
203
|
+
"nl": "Schedel",
|
|
204
|
+
"fr": "Tableau",
|
|
205
|
+
"it": "Programma",
|
|
206
|
+
"es": "Cuadro",
|
|
207
|
+
"pl": "Schedule",
|
|
208
|
+
"uk": "Розклад",
|
|
209
|
+
"zh-cn": "附表"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"native": {}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "iobroker.hydrawise",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "Adapter to control the Hydrawise irrigation control system",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "SentiQ",
|
|
7
|
+
"email": "fischer.yves@web.de"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/SentiQ/ioBroker.hydrawise",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"hydrawise",
|
|
13
|
+
"hunter",
|
|
14
|
+
"irrigation",
|
|
15
|
+
"watering",
|
|
16
|
+
"garden"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git@github.com:SentiQ/ioBroker.hydrawise.git"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">= 16"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@iobroker/adapter-core": "^2.6.7"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@alcalzone/release-script": "^3.5.9",
|
|
30
|
+
"@alcalzone/release-script-plugin-iobroker": "^3.5.9",
|
|
31
|
+
"@alcalzone/release-script-plugin-license": "^3.5.9",
|
|
32
|
+
"@alcalzone/release-script-plugin-manual-review": "^3.5.9",
|
|
33
|
+
"@iobroker/adapter-dev": "^1.2.0",
|
|
34
|
+
"@iobroker/testing": "^4.1.0",
|
|
35
|
+
"@tsconfig/node16": "^1.0.3",
|
|
36
|
+
"@types/chai": "^4.3.4",
|
|
37
|
+
"@types/chai-as-promised": "^7.1.5",
|
|
38
|
+
"@types/mocha": "^10.0.1",
|
|
39
|
+
"@types/node": "^20.2.3",
|
|
40
|
+
"@types/proxyquire": "^1.3.28",
|
|
41
|
+
"@types/sinon": "^10.0.13",
|
|
42
|
+
"@types/sinon-chai": "^3.2.9",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
|
44
|
+
"@typescript-eslint/parser": "^5.48.1",
|
|
45
|
+
"chai": "^4.3.7",
|
|
46
|
+
"chai-as-promised": "^7.1.1",
|
|
47
|
+
"eslint": "^8.31.0",
|
|
48
|
+
"eslint-config-prettier": "^8.6.0",
|
|
49
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
50
|
+
"mocha": "^10.2.0",
|
|
51
|
+
"nyc": "^15.1.0",
|
|
52
|
+
"prettier": "^2.8.2",
|
|
53
|
+
"proxyquire": "^2.1.3",
|
|
54
|
+
"rimraf": "^5.0.1",
|
|
55
|
+
"sinon": "^15.0.1",
|
|
56
|
+
"sinon-chai": "^3.7.0",
|
|
57
|
+
"source-map-support": "^0.5.21",
|
|
58
|
+
"ts-node": "^10.9.1",
|
|
59
|
+
"typescript": "~5.0.4"
|
|
60
|
+
},
|
|
61
|
+
"main": "build/main.js",
|
|
62
|
+
"files": [
|
|
63
|
+
"admin{,/!(src)/**}/!(tsconfig|tsconfig.*|.eslintrc).json",
|
|
64
|
+
"admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}",
|
|
65
|
+
"build/",
|
|
66
|
+
"www/",
|
|
67
|
+
"io-package.json",
|
|
68
|
+
"LICENSE"
|
|
69
|
+
],
|
|
70
|
+
"scripts": {
|
|
71
|
+
"prebuild": "rimraf build",
|
|
72
|
+
"build": "build-adapter ts",
|
|
73
|
+
"watch": "build-adapter ts --watch",
|
|
74
|
+
"prebuild:ts": "rimraf build",
|
|
75
|
+
"build:ts": "build-adapter ts",
|
|
76
|
+
"watch:ts": "build-adapter ts --watch",
|
|
77
|
+
"test:ts": "mocha --config test/mocharc.custom.json src/**/*.test.ts",
|
|
78
|
+
"test:package": "mocha test/package --exit",
|
|
79
|
+
"test:integration": "mocha test/integration --exit",
|
|
80
|
+
"test": "npm run test:ts && npm run test:package",
|
|
81
|
+
"check": "tsc --noEmit",
|
|
82
|
+
"coverage": "nyc npm run test:ts",
|
|
83
|
+
"lint": "eslint --ext .ts src/",
|
|
84
|
+
"translate": "translate-adapter",
|
|
85
|
+
"release": "release-script patch --yes",
|
|
86
|
+
"release-minor": "release-script minor --yes",
|
|
87
|
+
"release-major": "release-script major --yes"
|
|
88
|
+
},
|
|
89
|
+
"nyc": {
|
|
90
|
+
"include": [
|
|
91
|
+
"src/**/*.ts"
|
|
92
|
+
],
|
|
93
|
+
"exclude": [
|
|
94
|
+
"src/**/*.test.ts"
|
|
95
|
+
],
|
|
96
|
+
"extension": [
|
|
97
|
+
".ts"
|
|
98
|
+
],
|
|
99
|
+
"require": [
|
|
100
|
+
"ts-node/register"
|
|
101
|
+
],
|
|
102
|
+
"reporter": [
|
|
103
|
+
"text-summary",
|
|
104
|
+
"html"
|
|
105
|
+
],
|
|
106
|
+
"sourceMap": true,
|
|
107
|
+
"instrument": true
|
|
108
|
+
},
|
|
109
|
+
"bugs": {
|
|
110
|
+
"url": "https://github.com/SentiQ/ioBroker.hydrawise/issues"
|
|
111
|
+
},
|
|
112
|
+
"readmeFilename": "README.md"
|
|
113
|
+
}
|