grenton-ts 1.0.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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -0
  3. package/dist/analog-din/fv02_01/analog-in.ts +271 -0
  4. package/dist/clu/calendar/v1/calendar.ts +308 -0
  5. package/dist/clu/clu-zwave-2/fv515_03/clu-zwave-2.ts +1302 -0
  6. package/dist/clu/event-scheduler/v1/event-scheduler.ts +537 -0
  7. package/dist/clu/multi-fan-ac-thermostat/v1/multi-fan-ac-thermostat.ts +1163 -0
  8. package/dist/clu/pid-controller/v1/pid-controller.ts +536 -0
  9. package/dist/clu/presence-sensor/v1/presence-sensor.ts +313 -0
  10. package/dist/clu/presence-sensor/v2/presence-sensor.ts +470 -0
  11. package/dist/clu/push/v1/push.ts +261 -0
  12. package/dist/clu/scheduler/v1/scheduler.ts +304 -0
  13. package/dist/clu/statistics/v1/statistics.ts +413 -0
  14. package/dist/clu/statistics-pulse/v1/statistics-pulse.ts +218 -0
  15. package/dist/clu/sunrise-sunset-calendar/v1/sunrise-sunset-calendar.ts +389 -0
  16. package/dist/clu/sunrise-sunset-calendar/v2/sunrise-sunset-calendar.ts +659 -0
  17. package/dist/clu/sunrise-sunset-calendar/v3/sunrise-sunset-calendar.ts +659 -0
  18. package/dist/clu/thermostat/v1/thermostat.ts +768 -0
  19. package/dist/clu/thermostat/v2/thermostat.ts +861 -0
  20. package/dist/clu/timer/v1/timer.ts +369 -0
  21. package/dist/core/execution-builder.ts +55 -0
  22. package/dist/core/remote-gate.ts +17 -0
  23. package/dist/digital-in-din/fv02_01/din.ts +310 -0
  24. package/dist/examples/light_turned_on_by_calendar/Clu_OnInit.ts +26 -0
  25. package/dist/examples/light_turned_on_by_presence_sensor/Clu_OnInit.ts +35 -0
  26. package/dist/examples/light_turned_on_by_switch/Clu_OnInit.ts +16 -0
  27. package/dist/gate/cool-master/v1/cool-master.ts +782 -0
  28. package/dist/gate/cool-master-net/v1/cool-master-net.ts +334 -0
  29. package/dist/gate/denon-marantz-avr/v1/denon-marantz-avr.ts +724 -0
  30. package/dist/gate/heos/v1/heos.ts +1224 -0
  31. package/dist/gate/http/fv1000_03/clu-gate-http.ts +405 -0
  32. package/dist/gate/http/fv1000_03_hv1/clu-gate-http.ts +352 -0
  33. package/dist/gate/http/fv1100_03/clu-gate-http.ts +589 -0
  34. package/dist/gate/http/fv1110_03/clu-gate-http.ts +589 -0
  35. package/dist/gate/http/fv1300_03/clu-gate-http.ts +589 -0
  36. package/dist/gate/http/fv1400_03/clu-gate-http.ts +677 -0
  37. package/dist/gate/http-listener/v1/http-listener.ts +299 -0
  38. package/dist/gate/http-listener/v2/http-listener.ts +325 -0
  39. package/dist/gate/http-request/v1/http-request.ts +645 -0
  40. package/dist/gate/http-request/v2/http-request.ts +709 -0
  41. package/dist/gate/input/v1/input.ts +171 -0
  42. package/dist/gate/jablotron/v1/jablotron.ts +100 -0
  43. package/dist/gate/jablotron-device/v1/jablotron-device.ts +171 -0
  44. package/dist/gate/jablotron-output/v1/jablotron-output.ts +240 -0
  45. package/dist/gate/jablotron-section/v1/jablotron-section.ts +260 -0
  46. package/dist/gate/modbus/v1/modbus.ts +609 -0
  47. package/dist/gate/modbus/v2/modbus.ts +690 -0
  48. package/dist/gate/modbus-client/v1/modbus-client.ts +827 -0
  49. package/dist/gate/modbus-rtu/v1/modbus-rtu.ts +911 -0
  50. package/dist/gate/modbus-server/v1/modbus-server.ts +405 -0
  51. package/dist/gate/modbus-slave-config-rtu/v1/modbus-slave-config-rtu.ts +160 -0
  52. package/dist/gate/modbus-slave-rtu/v1/modbus-slave-rtu.ts +371 -0
  53. package/dist/gate/modbus-value/v1/modbus-value.ts +856 -0
  54. package/dist/gate/music-cast/v1/music-cast.ts +1298 -0
  55. package/dist/gate/output/v1/output.ts +240 -0
  56. package/dist/gate/satel/v1/satel.ts +359 -0
  57. package/dist/gate/satel-input/v1/satel-input.ts +171 -0
  58. package/dist/gate/satel-output/v1/satel-output.ts +240 -0
  59. package/dist/gate/satel-zone/v1/satel-zone.ts +235 -0
  60. package/dist/gate/sonos/v1/sonos.ts +934 -0
  61. package/dist/gate/timer/v2/timer.ts +253 -0
  62. package/dist/gate/zone/v1/zone.ts +235 -0
  63. package/dist/io-module-din-8/fv02_02/din.ts +354 -0
  64. package/dist/io-module-din-8/fv02_02/dout.ts +360 -0
  65. package/dist/one-wire/fv01_10/onew-sensor.ts +269 -0
  66. package/dist/one-wire/fv01_28/onew-sensor.ts +269 -0
  67. package/dist/one-wire/fv02_28/onew-sensor.ts +350 -0
  68. package/dist/one-wire/fv03_28/onew-sensor.ts +435 -0
  69. package/dist/relay-din-2/fv02_02/dout.ts +544 -0
  70. package/dist/relay-din-4/fv01_02/dout.ts +340 -0
  71. package/dist/relay-din-4/fv02_02/dout.ts +368 -0
  72. package/dist/roller-shutter-din-3/fv03_02/roller-shutter.ts +1078 -0
  73. package/dist/smart-panel-fm-4/fv03_03/panel-button.ts +550 -0
  74. package/dist/smart-panel-fm-4/fv03_03/panel-sens-light.ts +238 -0
  75. package/dist/smart-panel-fm-4/fv03_03/panel-sens-temp.ts +239 -0
  76. package/dist/smart-panel-fm-4/fv03_03/panel.ts +700 -0
  77. package/dist/smart-panel-fm-4/fv04_03/panel-button.ts +567 -0
  78. package/dist/smart-panel-fm-4/fv04_03/panel-page.ts +516 -0
  79. package/dist/smart-panel-fm-4/fv04_03/panel-sens-light.ts +238 -0
  80. package/dist/smart-panel-fm-4/fv04_03/panel-sens-temp.ts +239 -0
  81. package/dist/smart-panel-fm-4/fv04_03/panel.ts +1026 -0
  82. package/dist/smart-panel-fm-4/fv05_03/panel-button.ts +567 -0
  83. package/dist/smart-panel-fm-4/fv05_03/panel-page.ts +620 -0
  84. package/dist/smart-panel-fm-4/fv05_03/panel-sens-light.ts +238 -0
  85. package/dist/smart-panel-fm-4/fv05_03/panel-sens-temp.ts +266 -0
  86. package/dist/smart-panel-fm-4/fv05_03/panel.ts +1109 -0
  87. package/dist/smart-panel-fm-4/fv06_03/panel-button.ts +567 -0
  88. package/dist/smart-panel-fm-4/fv06_03/panel-page.ts +877 -0
  89. package/dist/smart-panel-fm-4/fv06_03/panel-sens-light.ts +238 -0
  90. package/dist/smart-panel-fm-4/fv06_03/panel-sens-temp.ts +297 -0
  91. package/dist/smart-panel-fm-4/fv06_03/panel.ts +1138 -0
  92. package/dist/smart-panel-fm-4/fv07_03/panel-button.ts +567 -0
  93. package/dist/smart-panel-fm-4/fv07_03/panel-page.ts +864 -0
  94. package/dist/smart-panel-fm-4/fv07_03/panel-sens-light.ts +238 -0
  95. package/dist/smart-panel-fm-4/fv07_03/panel-sens-temp.ts +297 -0
  96. package/dist/smart-panel-fm-4/fv07_03/panel.ts +1135 -0
  97. package/dist/touch-panel-fm-4/fv01_02/panel-button.ts +418 -0
  98. package/dist/touch-panel-fm-4/fv01_02/panel-sens-light.ts +238 -0
  99. package/dist/touch-panel-fm-4/fv01_02/panel-sens-temp.ts +257 -0
  100. package/dist/touch-panel-fm-4/fv01_02/panel.ts +75 -0
  101. package/dist/touch-panel-fm-4/fv01_02/power-supply-voltage.ts +322 -0
  102. package/dist/touch-panel-fm-8/fv01_02/panel-button.ts +418 -0
  103. package/dist/touch-panel-fm-8/fv01_02/panel-sens-light.ts +238 -0
  104. package/dist/touch-panel-fm-8/fv01_02/panel-sens-temp.ts +270 -0
  105. package/dist/touch-panel-fm-8/fv01_02/panel.ts +75 -0
  106. package/dist/touch-panel-fm-8/fv01_02/power-supply-voltage.ts +322 -0
  107. package/package.json +16 -0
@@ -0,0 +1,352 @@
1
+ // Created from: packages/grenton-api/interfaces/clu_GATE_HTTP_ft00000003_fv000003e8_ht00000012_hv00000001.xml, object name="CLU_GATE_HTTP"
2
+
3
+ import { rawExecutionBuilderFactory } from "../../../core/execution-builder"
4
+ import { RemoteGate } from "../../../core/remote-gate"
5
+
6
+ enum EventType {
7
+ OnInit = 0,
8
+ }
9
+
10
+ enum PropertyType {
11
+ Uptime = 0,
12
+ UnixTime = 13,
13
+ FirmwareVersion = 17,
14
+ ClientReportInterval = 1,
15
+ PrimaryDNS = 2,
16
+ SecondaryDNS = 3,
17
+ }
18
+
19
+ enum MethodType {
20
+ SetDateTime = 2,
21
+ StartConsole = 7,
22
+ StartConsoleOnReboot = 8,
23
+ }
24
+
25
+ declare class CluGateHttpRaw {
26
+ add_event(event: EventType, callback: () => void): void;
27
+ get(property: PropertyType): any;
28
+ set(property: PropertyType, value: any): void;
29
+ execute(method: MethodType, ...args: any[]): any;
30
+ }
31
+
32
+ interface ICluGateHttp {
33
+ /**
34
+ * Zdarzenie wywoływane jednorazowo w momencie inicjalizacji urządzenia
35
+ * @param callback
36
+ */
37
+ addOnInit: (callback: () => void) => void
38
+ /**
39
+ * Ustawia datę i czas
40
+ * @param {number} unixTimestamp
41
+ */
42
+ setDateTime: (unixTimestamp: number) => void
43
+ /** Uruchamia konsolę Lua */
44
+ startConsole: () => void
45
+ /** Uruchamia konsolę Lua przy ponownym uruchomieniu */
46
+ startConsoleOnReboot: () => void
47
+ /**
48
+ * Ustawia okres raportowania o zmianach cech
49
+ * @param {number} clientReportInterval
50
+ */
51
+ setClientReportInterval: (clientReportInterval: number) => void
52
+ /**
53
+ * Ustawia cechę PrimaryDNS
54
+ * @param {string} iP
55
+ */
56
+ setPrimaryDNS: (iP: string) => void
57
+ /**
58
+ * Ustawia cechę SecondaryDNS
59
+ * @param {string} iP
60
+ */
61
+ setSecondaryDNS: (iP: string) => void
62
+ /** Czas pracy urządzenia od ostatniego resetu (w sekundach) */
63
+ readonly uptime: number
64
+ /** Zwraca aktualny uniksowy znacznik czasu */
65
+ readonly unixTime: number
66
+ /** Wersja oprogramowania Gate */
67
+ readonly firmwareVersion: string
68
+ /** Okres raportowania o zmianach cech */
69
+ clientReportInterval: number
70
+ /** Preferowany serwer DNS */
71
+ primaryDNS: string
72
+ /** Alternatywny serwer DNS */
73
+ secondaryDNS: string
74
+ }
75
+
76
+ class CluGateHttp implements ICluGateHttp {
77
+ private onInitCallbacks: Array<() => void> = [];
78
+
79
+ constructor(private raw: CluGateHttpRaw) {
80
+ this.raw.add_event(EventType.OnInit, () => {
81
+ this.onInitCallbacks.forEach(callback => {
82
+ callback();
83
+ });
84
+ });
85
+
86
+ }
87
+ /**
88
+ * Zdarzenie wywoływane jednorazowo w momencie inicjalizacji urządzenia
89
+ * @param callback
90
+ */
91
+ addOnInit(callback: () => void): void {
92
+ this.onInitCallbacks.push(callback);
93
+ }
94
+ /**
95
+ * Ustawia datę i czas
96
+ * @param {number} unixTimestamp
97
+ */
98
+ setDateTime(unixTimestamp: number): void {
99
+ this.raw.execute(MethodType.SetDateTime, unixTimestamp);
100
+ }
101
+ /** Uruchamia konsolę Lua */
102
+ startConsole(): void {
103
+ this.raw.execute(MethodType.StartConsole);
104
+ }
105
+ /** Uruchamia konsolę Lua przy ponownym uruchomieniu */
106
+ startConsoleOnReboot(): void {
107
+ this.raw.execute(MethodType.StartConsoleOnReboot);
108
+ }
109
+ /**
110
+ * Ustawia okres raportowania o zmianach cech
111
+ * @param {number} clientReportInterval
112
+ */
113
+ setClientReportInterval(clientReportInterval: number): void {
114
+ this.raw.set(PropertyType.ClientReportInterval, clientReportInterval);
115
+ }
116
+ /**
117
+ * Ustawia cechę PrimaryDNS
118
+ * @param {string} iP
119
+ */
120
+ setPrimaryDNS(iP: string): void {
121
+ this.raw.set(PropertyType.PrimaryDNS, iP);
122
+ }
123
+ /**
124
+ * Ustawia cechę SecondaryDNS
125
+ * @param {string} iP
126
+ */
127
+ setSecondaryDNS(iP: string): void {
128
+ this.raw.set(PropertyType.SecondaryDNS, iP);
129
+ }
130
+ /**
131
+ * Czas pracy urządzenia od ostatniego resetu (w sekundach)
132
+ * @returns {number}
133
+ */
134
+ get uptime(): number {
135
+ return this.raw.get(PropertyType.Uptime);
136
+ }
137
+ /**
138
+ * Zwraca aktualny uniksowy znacznik czasu
139
+ * @returns {number}
140
+ */
141
+ get unixTime(): number {
142
+ return this.raw.get(PropertyType.UnixTime);
143
+ }
144
+ /**
145
+ * Wersja oprogramowania Gate
146
+ * @returns {string}
147
+ */
148
+ get firmwareVersion(): string {
149
+ return this.raw.get(PropertyType.FirmwareVersion);
150
+ }
151
+ /**
152
+ * Okres raportowania o zmianach cech
153
+ * @returns {number}
154
+ */
155
+ get clientReportInterval(): number {
156
+ return this.raw.get(PropertyType.ClientReportInterval);
157
+ }
158
+ set clientReportInterval(value: number) {
159
+ this.raw.set(PropertyType.ClientReportInterval, value);
160
+ }
161
+ /**
162
+ * Preferowany serwer DNS
163
+ * @returns {string}
164
+ */
165
+ get primaryDNS(): string {
166
+ return this.raw.get(PropertyType.PrimaryDNS);
167
+ }
168
+ set primaryDNS(value: string) {
169
+ this.raw.set(PropertyType.PrimaryDNS, value);
170
+ }
171
+ /**
172
+ * Alternatywny serwer DNS
173
+ * @returns {string}
174
+ */
175
+ get secondaryDNS(): string {
176
+ return this.raw.get(PropertyType.SecondaryDNS);
177
+ }
178
+ set secondaryDNS(value: string) {
179
+ this.raw.set(PropertyType.SecondaryDNS, value);
180
+ }
181
+ }
182
+
183
+ class CluGateHttpRemote implements ICluGateHttp {
184
+ constructor(private objectName: string, private gate: RemoteGate) {
185
+
186
+ }
187
+ /**
188
+ * Zdarzenie wywoływane jednorazowo w momencie inicjalizacji urządzenia
189
+ * @param callback
190
+ */
191
+ addOnInit(_callback: () => void): void {
192
+ // Remote events are not supported
193
+ }
194
+ /**
195
+ * Ustawia datę i czas
196
+ * @param {number} unixTimestamp
197
+ */
198
+ setDateTime(unixTimestamp: number): void {
199
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
200
+ .execute()
201
+ .addParameter(MethodType.SetDateTime)
202
+ .addParameter(unixTimestamp)
203
+ .build();
204
+ this.gate.runScript(cmd!);
205
+ }
206
+ /** Uruchamia konsolę Lua */
207
+ startConsole(): void {
208
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
209
+ .execute()
210
+ .addParameter(MethodType.StartConsole)
211
+ .build();
212
+ this.gate.runScript(cmd!);
213
+ }
214
+ /** Uruchamia konsolę Lua przy ponownym uruchomieniu */
215
+ startConsoleOnReboot(): void {
216
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
217
+ .execute()
218
+ .addParameter(MethodType.StartConsoleOnReboot)
219
+ .build();
220
+ this.gate.runScript(cmd!);
221
+ }
222
+ /**
223
+ * Ustawia okres raportowania o zmianach cech
224
+ * @param {number} clientReportInterval
225
+ */
226
+ setClientReportInterval(clientReportInterval: number): void {
227
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
228
+ .set()
229
+ .addParameter(PropertyType.ClientReportInterval)
230
+ .addParameter(clientReportInterval)
231
+ .build();
232
+ this.gate.runScript(cmd!);
233
+ }
234
+ /**
235
+ * Ustawia cechę PrimaryDNS
236
+ * @param {string} iP
237
+ */
238
+ setPrimaryDNS(iP: string): void {
239
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
240
+ .set()
241
+ .addParameter(PropertyType.PrimaryDNS)
242
+ .addParameter(iP)
243
+ .build();
244
+ this.gate.runScript(cmd!);
245
+ }
246
+ /**
247
+ * Ustawia cechę SecondaryDNS
248
+ * @param {string} iP
249
+ */
250
+ setSecondaryDNS(iP: string): void {
251
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
252
+ .set()
253
+ .addParameter(PropertyType.SecondaryDNS)
254
+ .addParameter(iP)
255
+ .build();
256
+ this.gate.runScript(cmd!);
257
+ }
258
+ /**
259
+ * Czas pracy urządzenia od ostatniego resetu (w sekundach)
260
+ * @returns {number}
261
+ */
262
+ get uptime(): number {
263
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
264
+ .get()
265
+ .addParameter(PropertyType.Uptime)
266
+ .build();
267
+ return this.gate.runScript(cmd!);
268
+ }
269
+ /**
270
+ * Zwraca aktualny uniksowy znacznik czasu
271
+ * @returns {number}
272
+ */
273
+ get unixTime(): number {
274
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
275
+ .get()
276
+ .addParameter(PropertyType.UnixTime)
277
+ .build();
278
+ return this.gate.runScript(cmd!);
279
+ }
280
+ /**
281
+ * Wersja oprogramowania Gate
282
+ * @returns {string}
283
+ */
284
+ get firmwareVersion(): string {
285
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
286
+ .get()
287
+ .addParameter(PropertyType.FirmwareVersion)
288
+ .build();
289
+ return this.gate.runScript(cmd!);
290
+ }
291
+ /**
292
+ * Okres raportowania o zmianach cech
293
+ * @returns {number}
294
+ */
295
+ get clientReportInterval(): number {
296
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
297
+ .get()
298
+ .addParameter(PropertyType.ClientReportInterval)
299
+ .build();
300
+ return this.gate.runScript(cmd!);
301
+ }
302
+ set clientReportInterval(value: number) {
303
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
304
+ .set()
305
+ .addParameter(PropertyType.ClientReportInterval)
306
+ .addParameter(value)
307
+ .build();
308
+ this.gate.runScript(cmd!);
309
+ }
310
+ /**
311
+ * Preferowany serwer DNS
312
+ * @returns {string}
313
+ */
314
+ get primaryDNS(): string {
315
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
316
+ .get()
317
+ .addParameter(PropertyType.PrimaryDNS)
318
+ .build();
319
+ return this.gate.runScript(cmd!);
320
+ }
321
+ set primaryDNS(value: string) {
322
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
323
+ .set()
324
+ .addParameter(PropertyType.PrimaryDNS)
325
+ .addParameter(value)
326
+ .build();
327
+ this.gate.runScript(cmd!);
328
+ }
329
+ /**
330
+ * Alternatywny serwer DNS
331
+ * @returns {string}
332
+ */
333
+ get secondaryDNS(): string {
334
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
335
+ .get()
336
+ .addParameter(PropertyType.SecondaryDNS)
337
+ .build();
338
+ return this.gate.runScript(cmd!);
339
+ }
340
+ set secondaryDNS(value: string) {
341
+ const cmd: string | null = rawExecutionBuilderFactory(this.objectName)
342
+ .set()
343
+ .addParameter(PropertyType.SecondaryDNS)
344
+ .addParameter(value)
345
+ .build();
346
+ this.gate.runScript(cmd!);
347
+ }
348
+ }
349
+
350
+ export {
351
+ CluGateHttp, CluGateHttpRaw, CluGateHttpRemote
352
+ }