iobroker.acinfinity 0.7.1 → 0.7.2
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/io-package.json +14 -1
- package/lib/client.js +84 -54
- package/lib/constants.js +96 -108
- package/lib/creators/deviceCreator.js +97 -91
- package/lib/creators/portCreator.js +238 -225
- package/lib/creators/stateCreator.js +27 -21
- package/lib/dataModels.js +25 -20
- package/lib/handlers/deviceSettingsHandler.js +55 -38
- package/lib/handlers/portModeHandler.js +72 -71
- package/lib/handlers/portSettingsHandler.js +95 -68
- package/lib/stateManager.js +62 -42
- package/lib/updaters/deviceUpdater.js +133 -96
- package/lib/updaters/portUpdater.js +256 -207
- package/main.js +102 -77
- package/package.json +4 -4
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
* Verantwortlich für das Erstellen von Port-Strukturen in ioBroker
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
'use strict';
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
MODE_OPTIONS,
|
|
10
10
|
SETTINGS_MODE_OPTIONS,
|
|
11
11
|
DYNAMIC_RESPONSE_OPTIONS,
|
|
12
|
-
DEVICE_LOAD_TYPE_OPTIONS
|
|
13
|
-
} = require(
|
|
12
|
+
DEVICE_LOAD_TYPE_OPTIONS,
|
|
13
|
+
} = require('../constants');
|
|
14
14
|
|
|
15
15
|
class PortCreator {
|
|
16
16
|
/**
|
|
17
17
|
* Erstellt einen neuen PortCreator
|
|
18
|
+
*
|
|
18
19
|
* @param {object} stateManager - Referenz zum StateManager
|
|
19
20
|
*/
|
|
20
21
|
constructor(stateManager) {
|
|
@@ -25,6 +26,7 @@ class PortCreator {
|
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Erstellt einen Port-Kanal für ein Gerät
|
|
29
|
+
*
|
|
28
30
|
* @param {string} deviceId - Geräte-ID
|
|
29
31
|
* @param {number} portId - Port-ID
|
|
30
32
|
* @param {string} portName - Port-Name
|
|
@@ -33,7 +35,7 @@ class PortCreator {
|
|
|
33
35
|
async createPortChannel(deviceId, portId, portName) {
|
|
34
36
|
// Erstelle Port-Channel
|
|
35
37
|
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}`, portName || `Port ${portId}`, {
|
|
36
|
-
portId: portId
|
|
38
|
+
portId: portId,
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
// Erstelle Port-Unterkanäle
|
|
@@ -44,93 +46,95 @@ class PortCreator {
|
|
|
44
46
|
|
|
45
47
|
/**
|
|
46
48
|
* Erstellt einen Port-Kanal für ein Gerät
|
|
49
|
+
*
|
|
47
50
|
* @param {string} deviceId - Geräte-ID
|
|
48
51
|
* @param {number} portId - Port-ID
|
|
49
52
|
* @returns {Promise<void>}
|
|
50
53
|
*/
|
|
51
54
|
async createPortInfoChannel(deviceId, portId) {
|
|
52
55
|
// Erstelle Port-Info-Kanal
|
|
53
|
-
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.info`,
|
|
56
|
+
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.info`, 'Information');
|
|
54
57
|
|
|
55
58
|
// Erstelle Port-Info-States
|
|
56
59
|
await this.stateCreator.createMultipleStates([
|
|
57
60
|
{
|
|
58
61
|
id: `devices.${deviceId}.ports.${portId}.info.name`,
|
|
59
|
-
name:
|
|
60
|
-
type:
|
|
61
|
-
role:
|
|
62
|
+
name: 'Name',
|
|
63
|
+
type: 'string',
|
|
64
|
+
role: 'text',
|
|
62
65
|
},
|
|
63
66
|
{
|
|
64
67
|
id: `devices.${deviceId}.ports.${portId}.info.online`,
|
|
65
|
-
name:
|
|
66
|
-
type:
|
|
67
|
-
role:
|
|
68
|
+
name: 'Online',
|
|
69
|
+
type: 'boolean',
|
|
70
|
+
role: 'indicator.connected',
|
|
68
71
|
},
|
|
69
72
|
{
|
|
70
73
|
id: `devices.${deviceId}.ports.${portId}.info.power`,
|
|
71
|
-
name:
|
|
72
|
-
type:
|
|
73
|
-
role:
|
|
74
|
-
common: { min: 0, max: 10 }
|
|
74
|
+
name: 'Aktuelle Leistung (0-10)',
|
|
75
|
+
type: 'number',
|
|
76
|
+
role: 'value.power',
|
|
77
|
+
common: { min: 0, max: 10 },
|
|
75
78
|
},
|
|
76
79
|
{
|
|
77
80
|
id: `devices.${deviceId}.ports.${portId}.info.state`,
|
|
78
|
-
name:
|
|
79
|
-
type:
|
|
80
|
-
role:
|
|
81
|
+
name: 'Status',
|
|
82
|
+
type: 'boolean',
|
|
83
|
+
role: 'switch.power',
|
|
81
84
|
},
|
|
82
85
|
{
|
|
83
86
|
id: `devices.${deviceId}.ports.${portId}.info.remainingTime`,
|
|
84
|
-
name:
|
|
85
|
-
type:
|
|
86
|
-
role:
|
|
87
|
-
unit:
|
|
87
|
+
name: 'Verbleibende Zeit',
|
|
88
|
+
type: 'number',
|
|
89
|
+
role: 'value.interval',
|
|
90
|
+
unit: 's',
|
|
88
91
|
},
|
|
89
92
|
{
|
|
90
93
|
id: `devices.${deviceId}.ports.${portId}.info.nextStateChange`,
|
|
91
|
-
name:
|
|
92
|
-
type:
|
|
93
|
-
role:
|
|
94
|
-
}
|
|
94
|
+
name: 'Nächste Statusänderung',
|
|
95
|
+
type: 'string',
|
|
96
|
+
role: 'date.start',
|
|
97
|
+
},
|
|
95
98
|
]);
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
/**
|
|
99
102
|
* Erstellt einen Modus-Kanal für einen Port
|
|
103
|
+
*
|
|
100
104
|
* @param {string} deviceId - Geräte-ID
|
|
101
105
|
* @param {number} portId - Port-ID
|
|
102
106
|
* @returns {Promise<void>}
|
|
103
107
|
*/
|
|
104
108
|
async createPortModeChannel(deviceId, portId) {
|
|
105
109
|
// Erstelle Port-Mode-Kanal
|
|
106
|
-
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode`,
|
|
110
|
+
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode`, 'Modus-Einstellungen');
|
|
107
111
|
|
|
108
112
|
// Erstelle Port-Mode-States
|
|
109
113
|
await this.stateCreator.createMultipleStates([
|
|
110
114
|
{
|
|
111
115
|
id: `devices.${deviceId}.ports.${portId}.mode.active`,
|
|
112
|
-
name:
|
|
113
|
-
type:
|
|
114
|
-
role:
|
|
116
|
+
name: 'Aktiver Modus',
|
|
117
|
+
type: 'string',
|
|
118
|
+
role: 'text',
|
|
115
119
|
write: true,
|
|
116
|
-
states: MODE_OPTIONS
|
|
120
|
+
states: MODE_OPTIONS,
|
|
117
121
|
},
|
|
118
122
|
{
|
|
119
123
|
id: `devices.${deviceId}.ports.${portId}.mode.onSpeed`,
|
|
120
|
-
name:
|
|
121
|
-
type:
|
|
122
|
-
role:
|
|
124
|
+
name: 'Ein-Geschwindigkeit (0-10)',
|
|
125
|
+
type: 'number',
|
|
126
|
+
role: 'level',
|
|
123
127
|
write: true,
|
|
124
|
-
common: { min: 0, max: 10 }
|
|
128
|
+
common: { min: 0, max: 10 },
|
|
125
129
|
},
|
|
126
130
|
{
|
|
127
131
|
id: `devices.${deviceId}.ports.${portId}.mode.offSpeed`,
|
|
128
|
-
name:
|
|
129
|
-
type:
|
|
130
|
-
role:
|
|
132
|
+
name: 'Aus-Geschwindigkeit (0-10)',
|
|
133
|
+
type: 'number',
|
|
134
|
+
role: 'level',
|
|
131
135
|
write: true,
|
|
132
|
-
common: { min: 0, max: 10 }
|
|
133
|
-
}
|
|
136
|
+
common: { min: 0, max: 10 },
|
|
137
|
+
},
|
|
134
138
|
]);
|
|
135
139
|
|
|
136
140
|
// Erstelle Unterkanäle für verschiedene Modi
|
|
@@ -143,393 +147,402 @@ class PortCreator {
|
|
|
143
147
|
|
|
144
148
|
/**
|
|
145
149
|
* Erstellt einen Timer-Modus-Unterkanal
|
|
150
|
+
*
|
|
146
151
|
* @param {string} deviceId - Geräte-ID
|
|
147
152
|
* @param {number} portId - Port-ID
|
|
148
153
|
* @returns {Promise<void>}
|
|
149
154
|
*/
|
|
150
155
|
async createTimerModeChannel(deviceId, portId) {
|
|
151
|
-
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.timer`,
|
|
156
|
+
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.timer`, 'Timer-Modus');
|
|
152
157
|
|
|
153
158
|
await this.stateCreator.createMultipleStates([
|
|
154
159
|
{
|
|
155
160
|
id: `devices.${deviceId}.ports.${portId}.mode.timer.toOnMinutes`,
|
|
156
|
-
name:
|
|
157
|
-
type:
|
|
158
|
-
role:
|
|
159
|
-
unit:
|
|
161
|
+
name: 'Minuten bis Ein (0-1440)',
|
|
162
|
+
type: 'number',
|
|
163
|
+
role: 'value.interval',
|
|
164
|
+
unit: 'min',
|
|
160
165
|
write: true,
|
|
161
|
-
common: { min: 0, max: 1440 }
|
|
166
|
+
common: { min: 0, max: 1440 },
|
|
162
167
|
},
|
|
163
168
|
{
|
|
164
169
|
id: `devices.${deviceId}.ports.${portId}.mode.timer.toOffMinutes`,
|
|
165
|
-
name:
|
|
166
|
-
type:
|
|
167
|
-
role:
|
|
168
|
-
unit:
|
|
170
|
+
name: 'Minuten bis Aus (0-1440)',
|
|
171
|
+
type: 'number',
|
|
172
|
+
role: 'value.interval',
|
|
173
|
+
unit: 'min',
|
|
169
174
|
write: true,
|
|
170
|
-
common: { min: 0, max: 1440 }
|
|
171
|
-
}
|
|
175
|
+
common: { min: 0, max: 1440 },
|
|
176
|
+
},
|
|
172
177
|
]);
|
|
173
178
|
}
|
|
174
179
|
|
|
175
180
|
/**
|
|
176
181
|
* Erstellt einen Zyklus-Modus-Unterkanal
|
|
182
|
+
*
|
|
177
183
|
* @param {string} deviceId - Geräte-ID
|
|
178
184
|
* @param {number} portId - Port-ID
|
|
179
185
|
* @returns {Promise<void>}
|
|
180
186
|
*/
|
|
181
187
|
async createCycleModeChannel(deviceId, portId) {
|
|
182
|
-
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.cycle`,
|
|
188
|
+
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.cycle`, 'Zyklus-Modus');
|
|
183
189
|
|
|
184
190
|
await this.stateCreator.createMultipleStates([
|
|
185
191
|
{
|
|
186
192
|
id: `devices.${deviceId}.ports.${portId}.mode.cycle.onMinutes`,
|
|
187
|
-
name:
|
|
188
|
-
type:
|
|
189
|
-
role:
|
|
190
|
-
unit:
|
|
193
|
+
name: 'Minuten Ein (0-1440)',
|
|
194
|
+
type: 'number',
|
|
195
|
+
role: 'value.interval',
|
|
196
|
+
unit: 'min',
|
|
191
197
|
write: true,
|
|
192
|
-
common: { min: 0, max: 1440 }
|
|
198
|
+
common: { min: 0, max: 1440 },
|
|
193
199
|
},
|
|
194
200
|
{
|
|
195
201
|
id: `devices.${deviceId}.ports.${portId}.mode.cycle.offMinutes`,
|
|
196
|
-
name:
|
|
197
|
-
type:
|
|
198
|
-
role:
|
|
199
|
-
unit:
|
|
202
|
+
name: 'Minuten Aus (0-1440)',
|
|
203
|
+
type: 'number',
|
|
204
|
+
role: 'value.interval',
|
|
205
|
+
unit: 'min',
|
|
200
206
|
write: true,
|
|
201
|
-
common: { min: 0, max: 1440 }
|
|
202
|
-
}
|
|
207
|
+
common: { min: 0, max: 1440 },
|
|
208
|
+
},
|
|
203
209
|
]);
|
|
204
210
|
}
|
|
205
211
|
|
|
206
212
|
/**
|
|
207
213
|
* Erstellt einen Zeitplan-Modus-Unterkanal
|
|
214
|
+
*
|
|
208
215
|
* @param {string} deviceId - Geräte-ID
|
|
209
216
|
* @param {number} portId - Port-ID
|
|
210
217
|
* @returns {Promise<void>}
|
|
211
218
|
*/
|
|
212
219
|
async createScheduleModeChannel(deviceId, portId) {
|
|
213
|
-
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.schedule`,
|
|
220
|
+
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.schedule`, 'Zeitplan-Modus');
|
|
214
221
|
|
|
215
222
|
await this.stateCreator.createMultipleStates([
|
|
216
223
|
{
|
|
217
224
|
id: `devices.${deviceId}.ports.${portId}.mode.schedule.startEnabled`,
|
|
218
|
-
name:
|
|
219
|
-
type:
|
|
220
|
-
role:
|
|
221
|
-
write: true
|
|
225
|
+
name: 'Startzeit aktiviert',
|
|
226
|
+
type: 'boolean',
|
|
227
|
+
role: 'switch.enable',
|
|
228
|
+
write: true,
|
|
222
229
|
},
|
|
223
230
|
{
|
|
224
231
|
id: `devices.${deviceId}.ports.${portId}.mode.schedule.startTime`,
|
|
225
|
-
name:
|
|
226
|
-
type:
|
|
227
|
-
role:
|
|
228
|
-
write: true
|
|
232
|
+
name: 'Startzeit',
|
|
233
|
+
type: 'string',
|
|
234
|
+
role: 'value.time',
|
|
235
|
+
write: true,
|
|
229
236
|
},
|
|
230
237
|
{
|
|
231
238
|
id: `devices.${deviceId}.ports.${portId}.mode.schedule.endEnabled`,
|
|
232
|
-
name:
|
|
233
|
-
type:
|
|
234
|
-
role:
|
|
235
|
-
write: true
|
|
239
|
+
name: 'Endzeit aktiviert',
|
|
240
|
+
type: 'boolean',
|
|
241
|
+
role: 'switch.enable',
|
|
242
|
+
write: true,
|
|
236
243
|
},
|
|
237
244
|
{
|
|
238
245
|
id: `devices.${deviceId}.ports.${portId}.mode.schedule.endTime`,
|
|
239
|
-
name:
|
|
240
|
-
type:
|
|
241
|
-
role:
|
|
242
|
-
write: true
|
|
243
|
-
}
|
|
246
|
+
name: 'Endzeit',
|
|
247
|
+
type: 'string',
|
|
248
|
+
role: 'value.time',
|
|
249
|
+
write: true,
|
|
250
|
+
},
|
|
244
251
|
]);
|
|
245
252
|
}
|
|
246
253
|
|
|
247
254
|
/**
|
|
248
255
|
* Erstellt einen Auto-Modus-Unterkanal
|
|
256
|
+
*
|
|
249
257
|
* @param {string} deviceId - Geräte-ID
|
|
250
258
|
* @param {number} portId - Port-ID
|
|
251
259
|
* @returns {Promise<void>}
|
|
252
260
|
*/
|
|
253
261
|
async createAutoModeChannel(deviceId, portId) {
|
|
254
|
-
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.auto`,
|
|
262
|
+
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.auto`, 'Auto-Modus');
|
|
255
263
|
|
|
256
264
|
await this.stateCreator.createMultipleStates([
|
|
257
265
|
{
|
|
258
266
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.settingsMode`,
|
|
259
|
-
name:
|
|
260
|
-
type:
|
|
261
|
-
role:
|
|
267
|
+
name: 'Einstellungsmodus',
|
|
268
|
+
type: 'string',
|
|
269
|
+
role: 'text',
|
|
262
270
|
write: true,
|
|
263
|
-
states: SETTINGS_MODE_OPTIONS
|
|
271
|
+
states: SETTINGS_MODE_OPTIONS,
|
|
264
272
|
},
|
|
265
273
|
{
|
|
266
274
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.tempHighEnabled`,
|
|
267
|
-
name:
|
|
268
|
-
type:
|
|
269
|
-
role:
|
|
270
|
-
write: true
|
|
275
|
+
name: 'Temperatur-Hochgrenze aktiviert',
|
|
276
|
+
type: 'boolean',
|
|
277
|
+
role: 'switch.enable',
|
|
278
|
+
write: true,
|
|
271
279
|
},
|
|
272
280
|
{
|
|
273
281
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.tempHighTrigger`,
|
|
274
|
-
name:
|
|
275
|
-
type:
|
|
276
|
-
role:
|
|
277
|
-
unit:
|
|
282
|
+
name: 'Temperatur-Hochgrenze (0-90)',
|
|
283
|
+
type: 'number',
|
|
284
|
+
role: 'value.temperature',
|
|
285
|
+
unit: '°C',
|
|
278
286
|
write: true,
|
|
279
|
-
common: { min: 0, max: 90 }
|
|
287
|
+
common: { min: 0, max: 90 },
|
|
280
288
|
},
|
|
281
289
|
{
|
|
282
290
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.tempLowEnabled`,
|
|
283
|
-
name:
|
|
284
|
-
type:
|
|
285
|
-
role:
|
|
286
|
-
write: true
|
|
291
|
+
name: 'Temperatur-Tiefgrenze aktiviert',
|
|
292
|
+
type: 'boolean',
|
|
293
|
+
role: 'switch.enable',
|
|
294
|
+
write: true,
|
|
287
295
|
},
|
|
288
296
|
{
|
|
289
297
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.tempLowTrigger`,
|
|
290
|
-
name:
|
|
291
|
-
type:
|
|
292
|
-
role:
|
|
293
|
-
unit:
|
|
298
|
+
name: 'Temperatur-Tiefgrenze (0-90)',
|
|
299
|
+
type: 'number',
|
|
300
|
+
role: 'value.temperature',
|
|
301
|
+
unit: '°C',
|
|
294
302
|
write: true,
|
|
295
|
-
common: { min: 0, max: 90 }
|
|
303
|
+
common: { min: 0, max: 90 },
|
|
296
304
|
},
|
|
297
305
|
{
|
|
298
306
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.humidityHighEnabled`,
|
|
299
|
-
name:
|
|
300
|
-
type:
|
|
301
|
-
role:
|
|
302
|
-
write: true
|
|
307
|
+
name: 'Feuchtigkeit-Hochgrenze aktiviert',
|
|
308
|
+
type: 'boolean',
|
|
309
|
+
role: 'switch.enable',
|
|
310
|
+
write: true,
|
|
303
311
|
},
|
|
304
312
|
{
|
|
305
313
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.humidityHighTrigger`,
|
|
306
|
-
name:
|
|
307
|
-
type:
|
|
308
|
-
role:
|
|
309
|
-
unit:
|
|
314
|
+
name: 'Feuchtigkeit-Hochgrenze (0-100)',
|
|
315
|
+
type: 'number',
|
|
316
|
+
role: 'value.humidity',
|
|
317
|
+
unit: '%',
|
|
310
318
|
write: true,
|
|
311
|
-
common: { min: 0, max: 100 }
|
|
319
|
+
common: { min: 0, max: 100 },
|
|
312
320
|
},
|
|
313
321
|
{
|
|
314
322
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.humidityLowEnabled`,
|
|
315
|
-
name:
|
|
316
|
-
type:
|
|
317
|
-
role:
|
|
318
|
-
write: true
|
|
323
|
+
name: 'Feuchtigkeit-Tiefgrenze aktiviert',
|
|
324
|
+
type: 'boolean',
|
|
325
|
+
role: 'switch.enable',
|
|
326
|
+
write: true,
|
|
319
327
|
},
|
|
320
328
|
{
|
|
321
329
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.humidityLowTrigger`,
|
|
322
|
-
name:
|
|
323
|
-
type:
|
|
324
|
-
role:
|
|
325
|
-
unit:
|
|
330
|
+
name: 'Feuchtigkeit-Tiefgrenze (0-100)',
|
|
331
|
+
type: 'number',
|
|
332
|
+
role: 'value.humidity',
|
|
333
|
+
unit: '%',
|
|
326
334
|
write: true,
|
|
327
|
-
common: { min: 0, max: 100 }
|
|
335
|
+
common: { min: 0, max: 100 },
|
|
328
336
|
},
|
|
329
337
|
{
|
|
330
338
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.targetTempEnabled`,
|
|
331
|
-
name:
|
|
332
|
-
type:
|
|
333
|
-
role:
|
|
334
|
-
write: true
|
|
339
|
+
name: 'Zieltemperatur aktiviert',
|
|
340
|
+
type: 'boolean',
|
|
341
|
+
role: 'switch.enable',
|
|
342
|
+
write: true,
|
|
335
343
|
},
|
|
336
344
|
{
|
|
337
345
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.targetTemp`,
|
|
338
|
-
name:
|
|
339
|
-
type:
|
|
340
|
-
role:
|
|
341
|
-
unit:
|
|
346
|
+
name: 'Zieltemperatur (0-90)',
|
|
347
|
+
type: 'number',
|
|
348
|
+
role: 'value.temperature',
|
|
349
|
+
unit: '°C',
|
|
342
350
|
write: true,
|
|
343
|
-
common: { min: 0, max: 90 }
|
|
351
|
+
common: { min: 0, max: 90 },
|
|
344
352
|
},
|
|
345
353
|
{
|
|
346
354
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.targetHumidityEnabled`,
|
|
347
|
-
name:
|
|
348
|
-
type:
|
|
349
|
-
role:
|
|
350
|
-
write: true
|
|
355
|
+
name: 'Zielfeuchtigkeit aktiviert',
|
|
356
|
+
type: 'boolean',
|
|
357
|
+
role: 'switch.enable',
|
|
358
|
+
write: true,
|
|
351
359
|
},
|
|
352
360
|
{
|
|
353
361
|
id: `devices.${deviceId}.ports.${portId}.mode.auto.targetHumidity`,
|
|
354
|
-
name:
|
|
355
|
-
type:
|
|
356
|
-
role:
|
|
357
|
-
unit:
|
|
362
|
+
name: 'Zielfeuchtigkeit (0-100)',
|
|
363
|
+
type: 'number',
|
|
364
|
+
role: 'value.humidity',
|
|
365
|
+
unit: '%',
|
|
358
366
|
write: true,
|
|
359
|
-
common: { min: 0, max: 100 }
|
|
360
|
-
}
|
|
367
|
+
common: { min: 0, max: 100 },
|
|
368
|
+
},
|
|
361
369
|
]);
|
|
362
370
|
}
|
|
363
371
|
|
|
364
372
|
/**
|
|
365
373
|
* Erstellt einen VPD-Modus-Unterkanal
|
|
374
|
+
*
|
|
366
375
|
* @param {string} deviceId - Geräte-ID
|
|
367
376
|
* @param {number} portId - Port-ID
|
|
368
377
|
* @returns {Promise<void>}
|
|
369
378
|
*/
|
|
370
379
|
async createVpdModeChannel(deviceId, portId) {
|
|
371
|
-
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.vpd`,
|
|
380
|
+
await this.stateCreator.createChannel(`devices.${deviceId}.ports.${portId}.mode.vpd`, 'VPD-Modus');
|
|
372
381
|
|
|
373
382
|
await this.stateCreator.createMultipleStates([
|
|
374
383
|
{
|
|
375
384
|
id: `devices.${deviceId}.ports.${portId}.mode.vpd.settingsMode`,
|
|
376
|
-
name:
|
|
377
|
-
type:
|
|
378
|
-
role:
|
|
385
|
+
name: 'Einstellungsmodus',
|
|
386
|
+
type: 'string',
|
|
387
|
+
role: 'text',
|
|
379
388
|
write: true,
|
|
380
|
-
states: SETTINGS_MODE_OPTIONS
|
|
389
|
+
states: SETTINGS_MODE_OPTIONS,
|
|
381
390
|
},
|
|
382
391
|
{
|
|
383
392
|
id: `devices.${deviceId}.ports.${portId}.mode.vpd.highEnabled`,
|
|
384
|
-
name:
|
|
385
|
-
type:
|
|
386
|
-
role:
|
|
387
|
-
write: true
|
|
393
|
+
name: 'VPD-Hochgrenze aktiviert',
|
|
394
|
+
type: 'boolean',
|
|
395
|
+
role: 'switch.enable',
|
|
396
|
+
write: true,
|
|
388
397
|
},
|
|
389
398
|
{
|
|
390
399
|
id: `devices.${deviceId}.ports.${portId}.mode.vpd.highTrigger`,
|
|
391
|
-
name:
|
|
392
|
-
type:
|
|
393
|
-
role:
|
|
394
|
-
unit:
|
|
400
|
+
name: 'VPD-Hochgrenze (0-9.9)',
|
|
401
|
+
type: 'number',
|
|
402
|
+
role: 'value',
|
|
403
|
+
unit: 'kPa',
|
|
395
404
|
write: true,
|
|
396
|
-
common: { min: 0, max: 9.9 }
|
|
405
|
+
common: { min: 0, max: 9.9 },
|
|
397
406
|
},
|
|
398
407
|
{
|
|
399
408
|
id: `devices.${deviceId}.ports.${portId}.mode.vpd.lowEnabled`,
|
|
400
|
-
name:
|
|
401
|
-
type:
|
|
402
|
-
role:
|
|
403
|
-
write: true
|
|
409
|
+
name: 'VPD-Tiefgrenze aktiviert',
|
|
410
|
+
type: 'boolean',
|
|
411
|
+
role: 'switch.enable',
|
|
412
|
+
write: true,
|
|
404
413
|
},
|
|
405
414
|
{
|
|
406
415
|
id: `devices.${deviceId}.ports.${portId}.mode.vpd.lowTrigger`,
|
|
407
|
-
name:
|
|
408
|
-
type:
|
|
409
|
-
role:
|
|
410
|
-
unit:
|
|
416
|
+
name: 'VPD-Tiefgrenze (0-9.9)',
|
|
417
|
+
type: 'number',
|
|
418
|
+
role: 'value',
|
|
419
|
+
unit: 'kPa',
|
|
411
420
|
write: true,
|
|
412
|
-
common: { min: 0, max: 9.9 }
|
|
421
|
+
common: { min: 0, max: 9.9 },
|
|
413
422
|
},
|
|
414
423
|
{
|
|
415
424
|
id: `devices.${deviceId}.ports.${portId}.mode.vpd.targetEnabled`,
|
|
416
|
-
name:
|
|
417
|
-
type:
|
|
418
|
-
role:
|
|
419
|
-
write: true
|
|
425
|
+
name: 'Ziel-VPD aktiviert',
|
|
426
|
+
type: 'boolean',
|
|
427
|
+
role: 'switch.enable',
|
|
428
|
+
write: true,
|
|
420
429
|
},
|
|
421
430
|
{
|
|
422
431
|
id: `devices.${deviceId}.ports.${portId}.mode.vpd.target`,
|
|
423
|
-
name:
|
|
424
|
-
type:
|
|
425
|
-
role:
|
|
426
|
-
unit:
|
|
432
|
+
name: 'Ziel-VPD (0-9.9)',
|
|
433
|
+
type: 'number',
|
|
434
|
+
role: 'value',
|
|
435
|
+
unit: 'kPa',
|
|
427
436
|
write: true,
|
|
428
|
-
common: { min: 0, max: 9.9 }
|
|
429
|
-
}
|
|
437
|
+
common: { min: 0, max: 9.9 },
|
|
438
|
+
},
|
|
430
439
|
]);
|
|
431
440
|
}
|
|
432
441
|
|
|
433
442
|
/**
|
|
434
443
|
* Erstellt einen Einstellungskanal für einen Port
|
|
444
|
+
*
|
|
435
445
|
* @param {string} deviceId - Geräte-ID
|
|
436
446
|
* @param {number} portId - Port-ID
|
|
437
447
|
* @returns {Promise<void>}
|
|
438
448
|
*/
|
|
439
449
|
async createPortSettingsChannel(deviceId, portId) {
|
|
440
|
-
await this.stateCreator.createChannel(
|
|
450
|
+
await this.stateCreator.createChannel(
|
|
451
|
+
`devices.${deviceId}.ports.${portId}.settings`,
|
|
452
|
+
'Erweiterte Einstellungen',
|
|
453
|
+
);
|
|
441
454
|
|
|
442
455
|
await this.stateCreator.createMultipleStates([
|
|
443
456
|
{
|
|
444
457
|
id: `devices.${deviceId}.ports.${portId}.settings.deviceType`,
|
|
445
|
-
name:
|
|
446
|
-
type:
|
|
447
|
-
role:
|
|
458
|
+
name: 'Gerätetyp',
|
|
459
|
+
type: 'number',
|
|
460
|
+
role: 'value',
|
|
448
461
|
write: true,
|
|
449
462
|
states: Object.keys(DEVICE_LOAD_TYPE_OPTIONS).map(key => parseInt(key, 10)),
|
|
450
463
|
common: {
|
|
451
464
|
// Mapping der numerischen IDs zu Gerätetypnamen
|
|
452
|
-
states: DEVICE_LOAD_TYPE_OPTIONS
|
|
453
|
-
}
|
|
465
|
+
states: DEVICE_LOAD_TYPE_OPTIONS,
|
|
466
|
+
},
|
|
454
467
|
},
|
|
455
468
|
{
|
|
456
469
|
id: `devices.${deviceId}.ports.${portId}.settings.dynamicResponse`,
|
|
457
|
-
name:
|
|
458
|
-
type:
|
|
459
|
-
role:
|
|
470
|
+
name: 'Dynamische Reaktion',
|
|
471
|
+
type: 'string',
|
|
472
|
+
role: 'text',
|
|
460
473
|
write: true,
|
|
461
|
-
states: DYNAMIC_RESPONSE_OPTIONS
|
|
474
|
+
states: DYNAMIC_RESPONSE_OPTIONS,
|
|
462
475
|
},
|
|
463
476
|
{
|
|
464
477
|
id: `devices.${deviceId}.ports.${portId}.settings.dynamicTransitionTemp`,
|
|
465
|
-
name:
|
|
466
|
-
type:
|
|
467
|
-
role:
|
|
468
|
-
unit:
|
|
478
|
+
name: 'Übergangstemperatur (0-20)',
|
|
479
|
+
type: 'number',
|
|
480
|
+
role: 'value.temperature',
|
|
481
|
+
unit: '°',
|
|
469
482
|
write: true,
|
|
470
|
-
common: { min: 0, max: 20 }
|
|
483
|
+
common: { min: 0, max: 20 },
|
|
471
484
|
},
|
|
472
485
|
{
|
|
473
486
|
id: `devices.${deviceId}.ports.${portId}.settings.dynamicTransitionHumidity`,
|
|
474
|
-
name:
|
|
475
|
-
type:
|
|
476
|
-
role:
|
|
477
|
-
unit:
|
|
487
|
+
name: 'Übergangsfeuchtigkeit (0-10)',
|
|
488
|
+
type: 'number',
|
|
489
|
+
role: 'value.humidity',
|
|
490
|
+
unit: '%',
|
|
478
491
|
write: true,
|
|
479
|
-
common: { min: 0, max: 10 }
|
|
492
|
+
common: { min: 0, max: 10 },
|
|
480
493
|
},
|
|
481
494
|
{
|
|
482
495
|
id: `devices.${deviceId}.ports.${portId}.settings.dynamicTransitionVPD`,
|
|
483
|
-
name:
|
|
484
|
-
type:
|
|
485
|
-
role:
|
|
486
|
-
unit:
|
|
496
|
+
name: 'Übergangs-VPD (0-1)',
|
|
497
|
+
type: 'number',
|
|
498
|
+
role: 'value',
|
|
499
|
+
unit: 'kPa',
|
|
487
500
|
write: true,
|
|
488
|
-
common: { min: 0, max: 1 }
|
|
501
|
+
common: { min: 0, max: 1 },
|
|
489
502
|
},
|
|
490
503
|
{
|
|
491
504
|
id: `devices.${deviceId}.ports.${portId}.settings.dynamicBufferTemp`,
|
|
492
|
-
name:
|
|
493
|
-
type:
|
|
494
|
-
role:
|
|
495
|
-
unit:
|
|
505
|
+
name: 'Puffertemperatur (0-20)',
|
|
506
|
+
type: 'number',
|
|
507
|
+
role: 'value.temperature',
|
|
508
|
+
unit: '°',
|
|
496
509
|
write: true,
|
|
497
|
-
common: { min: 0, max: 20 }
|
|
510
|
+
common: { min: 0, max: 20 },
|
|
498
511
|
},
|
|
499
512
|
{
|
|
500
513
|
id: `devices.${deviceId}.ports.${portId}.settings.dynamicBufferHumidity`,
|
|
501
|
-
name:
|
|
502
|
-
type:
|
|
503
|
-
role:
|
|
504
|
-
unit:
|
|
514
|
+
name: 'Pufferfeuchtigkeit (0-10)',
|
|
515
|
+
type: 'number',
|
|
516
|
+
role: 'value.humidity',
|
|
517
|
+
unit: '%',
|
|
505
518
|
write: true,
|
|
506
|
-
common: { min: 0, max: 10 }
|
|
519
|
+
common: { min: 0, max: 10 },
|
|
507
520
|
},
|
|
508
521
|
{
|
|
509
522
|
id: `devices.${deviceId}.ports.${portId}.settings.dynamicBufferVPD`,
|
|
510
|
-
name:
|
|
511
|
-
type:
|
|
512
|
-
role:
|
|
513
|
-
unit:
|
|
523
|
+
name: 'Puffer-VPD (0-1)',
|
|
524
|
+
type: 'number',
|
|
525
|
+
role: 'value',
|
|
526
|
+
unit: 'kPa',
|
|
514
527
|
write: true,
|
|
515
|
-
common: { min: 0, max: 1 }
|
|
528
|
+
common: { min: 0, max: 1 },
|
|
516
529
|
},
|
|
517
530
|
{
|
|
518
531
|
id: `devices.${deviceId}.ports.${portId}.settings.sunriseTimerEnabled`,
|
|
519
|
-
name:
|
|
520
|
-
type:
|
|
521
|
-
role:
|
|
522
|
-
write: true
|
|
532
|
+
name: 'Sonnenaufgang/Sonnenuntergang-Timer aktiviert',
|
|
533
|
+
type: 'boolean',
|
|
534
|
+
role: 'switch.enable',
|
|
535
|
+
write: true,
|
|
523
536
|
},
|
|
524
537
|
{
|
|
525
538
|
id: `devices.${deviceId}.ports.${portId}.settings.sunriseTimerMinutes`,
|
|
526
|
-
name:
|
|
527
|
-
type:
|
|
528
|
-
role:
|
|
529
|
-
unit:
|
|
539
|
+
name: 'Sonnenaufgang/Sonnenuntergang-Timer Minuten (0-360)',
|
|
540
|
+
type: 'number',
|
|
541
|
+
role: 'value.interval',
|
|
542
|
+
unit: 'min',
|
|
530
543
|
write: true,
|
|
531
|
-
common: { min: 0, max: 360 }
|
|
532
|
-
}
|
|
544
|
+
common: { min: 0, max: 360 },
|
|
545
|
+
},
|
|
533
546
|
]);
|
|
534
547
|
}
|
|
535
548
|
}
|