iobroker.hydrawise 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +15 -153
- package/build/lib/helpers.js +65 -0
- package/build/lib/helpers.js.map +7 -0
- package/build/main.js +544 -430
- package/build/main.js.map +3 -3
- package/io-package.json +28 -28
- package/package.json +15 -15
- package/admin/words.js +0 -14
- /package/admin/i18n/{de/translations.json → de.json} +0 -0
- /package/admin/i18n/{en/translations.json → en.json} +0 -0
- /package/admin/i18n/{es/translations.json → es.json} +0 -0
- /package/admin/i18n/{fr/translations.json → fr.json} +0 -0
- /package/admin/i18n/{it/translations.json → it.json} +0 -0
- /package/admin/i18n/{nl/translations.json → nl.json} +0 -0
- /package/admin/i18n/{pl/translations.json → pl.json} +0 -0
- /package/admin/i18n/{pt/translations.json → pt.json} +0 -0
- /package/admin/i18n/{ru/translations.json → ru.json} +0 -0
- /package/admin/i18n/{uk/translations.json → uk.json} +0 -0
- /package/admin/i18n/{zh-cn/translations.json → zh-cn.json} +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025 SentiQ <yves.nuesser@proton.me>
|
|
3
|
+
Copyright (c) 2025-2026 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
|
@@ -39,6 +39,19 @@ 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.1.0 (2026-09-01)
|
|
43
|
+
|
|
44
|
+
* (SentiQ) **FIXED**: Relay ID mapping no longer writes onto the Object constructor
|
|
45
|
+
* (SentiQ) **FIXED**: runDefault reset no longer accidentally stops the zone
|
|
46
|
+
* (SentiQ) **ENHANCED**: Object creation only on structure change; poll overlap protection
|
|
47
|
+
* (SentiQ) **ENHANCED**: Replaced axios with native fetch; timers cleaned up on unload
|
|
48
|
+
* (SentiQ) **TESTING**: Unit tests for helpers (name2id, URL builder, structure signature)
|
|
49
|
+
|
|
50
|
+
### 1.0.6 (2026-08-09)
|
|
51
|
+
|
|
52
|
+
- (SentiQ) updated dependencies
|
|
53
|
+
- (copilot) Adapter requires node.js >= 22 now
|
|
54
|
+
|
|
42
55
|
### 1.0.5 (2025-12-05)
|
|
43
56
|
|
|
44
57
|
- (SentiQ) updated js-controller dependency
|
|
@@ -53,164 +66,13 @@ You can see all controller information, schedules and sensors. It is also possib
|
|
|
53
66
|
|
|
54
67
|
- (SentiQ) updated dependencies
|
|
55
68
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- (SentiQ) fixed issues detected by repository checker
|
|
59
|
-
|
|
60
|
-
### 1.0.1 (2024-09-24)
|
|
61
|
-
|
|
62
|
-
- (SentiQ) added compatibility check and testing for node.js 22
|
|
63
|
-
|
|
64
|
-
### 1.0.0 (2024-04-30)
|
|
65
|
-
|
|
66
|
-
- (SentiQ) fixed adapter crash after dns not reachable
|
|
67
|
-
|
|
68
|
-
### 0.3.3 (2024-04-22)
|
|
69
|
-
|
|
70
|
-
- (SentiQ) updated dependencies
|
|
71
|
-
|
|
72
|
-
### 0.3.2 (2024-04-19)
|
|
73
|
-
|
|
74
|
-
- (SentiQ) added default value to parameter `apiInterval`
|
|
75
|
-
- (SentiQ) added translations
|
|
76
|
-
|
|
77
|
-
### 0.3.1 (2024-04-18)
|
|
78
|
-
|
|
79
|
-
- (SentiQ) removed parameter `apiKey` in method call
|
|
80
|
-
|
|
81
|
-
### 0.3.0 (2024-04-18)
|
|
82
|
-
|
|
83
|
-
- (SentiQ) added api interval to settings
|
|
84
|
-
- (SentiQ) changed interval of schedule endpoint from 5 minutes to 1 minute
|
|
85
|
-
|
|
86
|
-
### 0.2.8 (2024-04-08)
|
|
87
|
-
|
|
88
|
-
- (SentiQ) fixed tier and license
|
|
89
|
-
|
|
90
|
-
### 0.2.7 (2024-04-08)
|
|
91
|
-
|
|
92
|
-
- (SentiQ) fixed type of runDefault object
|
|
93
|
-
|
|
94
|
-
### 0.2.6 (2024-04-08)
|
|
95
|
-
|
|
96
|
-
- (SentiQ) fixed type of `runDefault`
|
|
97
|
-
|
|
98
|
-
### 0.2.5 (2024-04-07)
|
|
99
|
-
|
|
100
|
-
- (SentiQ) NodeJS >= 18.x and js-controller >= 5 is required
|
|
101
|
-
|
|
102
|
-
### 0.2.4 (2024-02-01)
|
|
103
|
-
|
|
104
|
-
- (SentiQ) updated dependencies
|
|
105
|
-
|
|
106
|
-
### 0.2.3 (2023-10-28)
|
|
107
|
-
|
|
108
|
-
- (SentiQ) NodeJS 16.x is required
|
|
109
|
-
- (SentiQ) updated dependencies
|
|
110
|
-
|
|
111
|
-
### 0.2.2 (2023-09-22)
|
|
112
|
-
|
|
113
|
-
- (SentiQ) fixed versions
|
|
114
|
-
|
|
115
|
-
### 0.2.0 (2023-09-22)
|
|
116
|
-
|
|
117
|
-
- (SentiQ) added button to run zone for default runtime
|
|
118
|
-
|
|
119
|
-
### 0.1.2 (2023-08-22)
|
|
120
|
-
|
|
121
|
-
- (SentiQ) added link to api docu
|
|
122
|
-
|
|
123
|
-
### 0.1.1 (2023-08-22)
|
|
124
|
-
|
|
125
|
-
- (SentiQ) fixed random crash, when api domain can't be resolved by dns
|
|
126
|
-
- (SentiQ) added time string of last api call
|
|
127
|
-
|
|
128
|
-
### 0.0.19 (2023-08-05)
|
|
129
|
-
|
|
130
|
-
- (SentiQ) fixed button roles
|
|
131
|
-
|
|
132
|
-
### 0.0.18 (2023-08-05)
|
|
133
|
-
|
|
134
|
-
- (SentiQ) fixed timeout
|
|
135
|
-
|
|
136
|
-
### 0.0.17 (2023-08-03)
|
|
137
|
-
|
|
138
|
-
- (SentiQ) fixed adapter crash
|
|
139
|
-
|
|
140
|
-
### 0.0.16 (2023-08-02)
|
|
141
|
-
|
|
142
|
-
- (SentiQ) added more information to README
|
|
143
|
-
- (SentiQ) encrypted apiKey
|
|
144
|
-
- (SentiQ) removed logging of apiKey
|
|
145
|
-
- (SentiQ) added filtering of invalid characters in ids
|
|
146
|
-
- (SentiQ) added check of ack flag
|
|
147
|
-
- (SentiQ) fixed roles
|
|
148
|
-
- (SentiQ) fixed error message
|
|
149
|
-
- (SentiQ) removed usage of clearTimeout
|
|
150
|
-
|
|
151
|
-
### 0.0.15 (2023-06-29)
|
|
152
|
-
|
|
153
|
-
- (SentiQ) updated dependencies
|
|
154
|
-
|
|
155
|
-
### 0.0.14 (2023-06-29)
|
|
156
|
-
|
|
157
|
-
- (SentiQ) fixing version
|
|
158
|
-
|
|
159
|
-
### 0.0.12 (2023-06-29)
|
|
160
|
-
|
|
161
|
-
- (SentiQ) changed value of `last_contact` to date string format
|
|
162
|
-
|
|
163
|
-
### 0.0.11 (2023-06-28)
|
|
164
|
-
|
|
165
|
-
- (SentiQ) raised timeouts
|
|
166
|
-
- (SentiQ) fixed types
|
|
167
|
-
|
|
168
|
-
### 0.0.10 (2023-06-27)
|
|
169
|
-
|
|
170
|
-
- (SentiQ) fixed adapter crash
|
|
171
|
-
- (SentiQ) changed value of `timestr` to date string format
|
|
172
|
-
|
|
173
|
-
### 0.0.9 (2023-05-25)
|
|
174
|
-
|
|
175
|
-
- (SentiQ) added more translations
|
|
176
|
-
|
|
177
|
-
### 0.0.8 (2023-05-25)
|
|
178
|
-
|
|
179
|
-
- (SentiQ) improved log messages
|
|
180
|
-
|
|
181
|
-
### 0.0.7 (2023-05-25)
|
|
182
|
-
|
|
183
|
-
- (SentiQ) fixed author
|
|
184
|
-
|
|
185
|
-
### 0.0.6 (2023-05-24)
|
|
186
|
-
|
|
187
|
-
- (SentiQ) lowered min node version to 14.5.0
|
|
188
|
-
|
|
189
|
-
### 0.0.5 (2023-05-24)
|
|
190
|
-
|
|
191
|
-
- (SentiQ) updated packages
|
|
192
|
-
|
|
193
|
-
### 0.0.4 (2023-05-24)
|
|
194
|
-
|
|
195
|
-
- (SentiQ) testing
|
|
196
|
-
|
|
197
|
-
### 0.0.3 (2023-05-24)
|
|
198
|
-
|
|
199
|
-
- (SentiQ) added zone controls and Ukrainian language
|
|
200
|
-
|
|
201
|
-
### 0.0.2 (2023-05-23)
|
|
202
|
-
|
|
203
|
-
- (SentiQ) refactoring code
|
|
204
|
-
|
|
205
|
-
### 0.0.1 (2023-01-26)
|
|
206
|
-
|
|
207
|
-
- (aDabbelju) Initial commit by adapter creator
|
|
69
|
+
[Older changelogs can be found there](CHANGELOG_OLD.md)
|
|
208
70
|
|
|
209
71
|
## License
|
|
210
72
|
|
|
211
73
|
MIT License
|
|
212
74
|
|
|
213
|
-
Copyright (c) 2025 SentiQ <yves.nuesser@proton.me>
|
|
75
|
+
Copyright (c) 2025-2026 SentiQ <yves.nuesser@proton.me>
|
|
214
76
|
|
|
215
77
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
216
78
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var helpers_exports = {};
|
|
20
|
+
__export(helpers_exports, {
|
|
21
|
+
CUSTOMER_SKIP_KEYS: () => CUSTOMER_SKIP_KEYS,
|
|
22
|
+
HYDRAWISE_BASE_URL: () => HYDRAWISE_BASE_URL,
|
|
23
|
+
SCHEDULE_SKIP_KEYS: () => SCHEDULE_SKIP_KEYS,
|
|
24
|
+
buildHydrawiseUrl: () => buildHydrawiseUrl,
|
|
25
|
+
isScalarKey: () => isScalarKey,
|
|
26
|
+
name2id: () => name2id,
|
|
27
|
+
structureSignature: () => structureSignature
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(helpers_exports);
|
|
30
|
+
const HYDRAWISE_BASE_URL = "https://api.hydrawise.com";
|
|
31
|
+
const SCHEDULE_SKIP_KEYS = ["relays", "sensors", "expanders"];
|
|
32
|
+
const CUSTOMER_SKIP_KEYS = ["controllers"];
|
|
33
|
+
function name2id(name, forbiddenChars) {
|
|
34
|
+
return (name || "").replace(forbiddenChars, "_");
|
|
35
|
+
}
|
|
36
|
+
function isScalarKey(key, skipKeys) {
|
|
37
|
+
return !skipKeys.includes(key);
|
|
38
|
+
}
|
|
39
|
+
function buildHydrawiseUrl(service, params) {
|
|
40
|
+
const url = new URL(`/api/v1/${service}`, HYDRAWISE_BASE_URL);
|
|
41
|
+
for (const [key, value] of Object.entries(params)) {
|
|
42
|
+
if (value !== void 0 && value !== null) {
|
|
43
|
+
url.searchParams.set(key, String(value));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return url.toString();
|
|
47
|
+
}
|
|
48
|
+
function structureSignature(relayIds, sensorInputs, controllerNames = []) {
|
|
49
|
+
return JSON.stringify({
|
|
50
|
+
relays: [...relayIds].map(String).sort(),
|
|
51
|
+
sensors: [...sensorInputs].map(String).sort(),
|
|
52
|
+
controllers: [...controllerNames].map(String).sort()
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
CUSTOMER_SKIP_KEYS,
|
|
58
|
+
HYDRAWISE_BASE_URL,
|
|
59
|
+
SCHEDULE_SKIP_KEYS,
|
|
60
|
+
buildHydrawiseUrl,
|
|
61
|
+
isScalarKey,
|
|
62
|
+
name2id,
|
|
63
|
+
structureSignature
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/helpers.ts"],
|
|
4
|
+
"sourcesContent": ["export const HYDRAWISE_BASE_URL = 'https://api.hydrawise.com';\n\nexport const SCHEDULE_SKIP_KEYS = ['relays', 'sensors', 'expanders'] as const;\nexport const CUSTOMER_SKIP_KEYS = ['controllers'] as const;\n\n/**\n * Replace characters forbidden in ioBroker object IDs.\n *\n * @param name raw name from API\n * @param forbiddenChars adapter FORBIDDEN_CHARS regex\n */\nexport function name2id(name: string, forbiddenChars: RegExp): string {\n return (name || '').replace(forbiddenChars, '_');\n}\n\n/**\n * True when the key is a scalar field (not a nested array/object list).\n *\n * @param key API response key\n * @param skipKeys keys to skip (arrays/objects)\n */\nexport function isScalarKey(key: string, skipKeys: readonly string[]): boolean {\n return !skipKeys.includes(key);\n}\n\n/**\n * Build a full Hydrawise API URL with query parameters.\n *\n * @param service endpoint file name (e.g. statusschedule.php)\n * @param params query parameters\n */\nexport function buildHydrawiseUrl(service: string, params: Record<string, string | number | boolean>): string {\n const url = new URL(`/api/v1/${service}`, HYDRAWISE_BASE_URL);\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null) {\n url.searchParams.set(key, String(value));\n }\n }\n return url.toString();\n}\n\n/**\n * Stable signature of schedule/customer structure for object-sync decisions.\n *\n * @param relayIds relay numbers from status API\n * @param sensorInputs sensor input numbers\n * @param controllerNames controller names from customer API\n */\nexport function structureSignature(\n relayIds: Array<string | number>,\n sensorInputs: Array<string | number>,\n controllerNames: string[] = [],\n): string {\n return JSON.stringify({\n relays: [...relayIds].map(String).sort(),\n sensors: [...sensorInputs].map(String).sort(),\n controllers: [...controllerNames].map(String).sort(),\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,qBAAqB;AAE3B,MAAM,qBAAqB,CAAC,UAAU,WAAW,WAAW;AAC5D,MAAM,qBAAqB,CAAC,aAAa;AAQzC,SAAS,QAAQ,MAAc,gBAAgC;AAClE,UAAQ,QAAQ,IAAI,QAAQ,gBAAgB,GAAG;AACnD;AAQO,SAAS,YAAY,KAAa,UAAsC;AAC3E,SAAO,CAAC,SAAS,SAAS,GAAG;AACjC;AAQO,SAAS,kBAAkB,SAAiB,QAA2D;AAC1G,QAAM,MAAM,IAAI,IAAI,WAAW,OAAO,IAAI,kBAAkB;AAC5D,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAC/C,QAAI,UAAU,UAAa,UAAU,MAAM;AACvC,UAAI,aAAa,IAAI,KAAK,OAAO,KAAK,CAAC;AAAA,IAC3C;AAAA,EACJ;AACA,SAAO,IAAI,SAAS;AACxB;AASO,SAAS,mBACZ,UACA,cACA,kBAA4B,CAAC,GACvB;AACN,SAAO,KAAK,UAAU;AAAA,IAClB,QAAQ,CAAC,GAAG,QAAQ,EAAE,IAAI,MAAM,EAAE,KAAK;AAAA,IACvC,SAAS,CAAC,GAAG,YAAY,EAAE,IAAI,MAAM,EAAE,KAAK;AAAA,IAC5C,aAAa,CAAC,GAAG,eAAe,EAAE,IAAI,MAAM,EAAE,KAAK;AAAA,EACvD,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|