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