iobroker.openknx 0.0.16 → 0.1.1

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 (75) hide show
  1. package/README.md +147 -120
  2. package/admin/index_m.html +16 -59
  3. package/admin/words.js +4 -4
  4. package/docs/pictures/ets1.png +0 -0
  5. package/docs/pictures/ets2.png +0 -0
  6. package/docs/pictures/loglevel.png +0 -0
  7. package/docs/pictures/setting.png +0 -0
  8. package/io-package.json +71 -72
  9. package/iob_npm.done +1 -0
  10. package/lib/knx/AUTHORS +3 -0
  11. package/lib/knx/LICENSE +19 -0
  12. package/lib/knx/README-API.md +138 -0
  13. package/lib/knx/README-datapoints.md +62 -0
  14. package/lib/knx/README-events.md +50 -0
  15. package/lib/knx/README-knxd.md +5 -0
  16. package/lib/knx/README-resilience.md +38 -0
  17. package/lib/knx/README.md +54 -0
  18. package/lib/knx/bitbucket-pipelines.yml +7 -0
  19. package/lib/knx/index.d.ts +70 -0
  20. package/lib/knx/index.js +19 -0
  21. package/lib/knx/manualtest/test-toggle.js +54 -0
  22. package/lib/knx/manualtest/test-writestorm.js +43 -0
  23. package/lib/knx/package.json +117 -0
  24. package/lib/knx/run-wired-tests.sh +2 -0
  25. package/lib/knx/src/Address.js +116 -0
  26. package/lib/knx/src/Connection.js +328 -0
  27. package/lib/knx/src/Datapoint.js +136 -0
  28. package/lib/knx/src/FSM.js +649 -0
  29. package/lib/knx/src/IpRoutingConnection.js +68 -0
  30. package/lib/knx/src/IpTunnelingConnection.js +43 -0
  31. package/lib/knx/src/KnxConstants.js +129 -0
  32. package/lib/knx/src/KnxLog.js +28 -0
  33. package/lib/knx/src/KnxProtocol.js +691 -0
  34. package/lib/knx/src/devices/BinarySwitch.js +51 -0
  35. package/lib/knx/src/devices/index.js +1 -0
  36. package/lib/knx/src/dptlib/dpt1.js +223 -0
  37. package/lib/knx/src/dptlib/dpt10.js +96 -0
  38. package/lib/knx/src/dptlib/dpt11.js +78 -0
  39. package/lib/knx/src/dptlib/dpt12.js +25 -0
  40. package/lib/knx/src/dptlib/dpt13.js +73 -0
  41. package/lib/knx/src/dptlib/dpt14.js +165 -0
  42. package/lib/knx/src/dptlib/dpt15.js +24 -0
  43. package/lib/knx/src/dptlib/dpt16.js +45 -0
  44. package/lib/knx/src/dptlib/dpt17.js +25 -0
  45. package/lib/knx/src/dptlib/dpt18.js +84 -0
  46. package/lib/knx/src/dptlib/dpt19.js +56 -0
  47. package/lib/knx/src/dptlib/dpt2.js +136 -0
  48. package/lib/knx/src/dptlib/dpt20.js +40 -0
  49. package/lib/knx/src/dptlib/dpt21.js +78 -0
  50. package/lib/knx/src/dptlib/dpt232.js +51 -0
  51. package/lib/knx/src/dptlib/dpt237.js +72 -0
  52. package/lib/knx/src/dptlib/dpt238.js +74 -0
  53. package/lib/knx/src/dptlib/dpt3.js +78 -0
  54. package/lib/knx/src/dptlib/dpt4.js +49 -0
  55. package/lib/knx/src/dptlib/dpt5.js +54 -0
  56. package/lib/knx/src/dptlib/dpt6.js +33 -0
  57. package/lib/knx/src/dptlib/dpt7.js +94 -0
  58. package/lib/knx/src/dptlib/dpt8.js +83 -0
  59. package/lib/knx/src/dptlib/dpt9.js +229 -0
  60. package/lib/knx/src/dptlib/index.js +215 -0
  61. package/lib/knx/typescript-sample/README.md +15 -0
  62. package/lib/knx/typescript-sample/package.json +17 -0
  63. package/lib/knx/typescript-sample/test-toggle-onoff.ts +43 -0
  64. package/lib/knx/typescript-sample/tsconfig.json +20 -0
  65. package/lib/knx/typescript-sample/tslint.json +58 -0
  66. package/lib/{generateGAS.js → projectImport.js} +10 -34
  67. package/lib/tools.js +3 -2
  68. package/main.js +22 -29
  69. package/package.json +1 -1
  70. package/.vscode/launch.json +0 -26
  71. package/.vscode/settings.json +0 -2
  72. package/admin/zip/inflate.js +0 -2155
  73. package/admin/zip/z-worker.js +0 -153
  74. package/admin/zip/zip-ext.js +0 -242
  75. package/admin/zip/zip.js +0 -959
package/README.md CHANGED
@@ -1,74 +1,110 @@
1
1
  ![Logo](admin/openknx.png)
2
2
  # ioBroker.openknx
3
- =================
4
3
 
5
4
  [![NPM version](http://img.shields.io/npm/v/iobroker.openknx.svg)](https://www.npmjs.com/package/iobroker.openknx)
6
5
  [![Downloads](https://img.shields.io/npm/dm/iobroker.openknx.svg)](https://www.npmjs.com/package/iobroker.openknx)
7
6
 
8
7
  [![NPM](https://nodei.co/npm/iobroker.openknx.png?downloads=true)](https://nodei.co/npm/iobroker.openknx/)
9
8
 
10
- This adapter serves as a communication interface between Iobroker Object tree and a IP Gateway on the KNX bus.
11
- This adapter allows to generate the communication objects by importing of knxproj Files from ETS.
12
- All generated Communication Objects are initially configured readable and writeable.
13
9
 
14
- # Installation of early versions
15
- This is an early untested version
16
- Please make a good backup of all your data!
17
- Please do not test in critical environments
10
+ This adapter serves as communication interface between Iobroker and your KNX IP Gateway.
11
+ The adapter allows to generate the iobroker communication objects automatically by importing an ETS group address xml export.
12
+ All generated communication objects are initially configured readable and writeable, values are fetched from the knx bus on adapter restart.
13
+
14
+ # Installation
15
+ This is an early untested version. Please make a good backup of all your data before installation! Please do not test in critical environments.
18
16
 
19
17
  install in shell
18
+
20
19
  cd /opt/iobroker/node_modules
21
20
  npm i iobroker.openknx
22
21
  iobroker add openknx
23
22
  npm i knx
24
23
 
25
- updates:
24
+ updates
25
+
26
26
  npm i iobroker.openknx
27
27
  iobroker upload openknx
28
28
 
29
- # GA import
29
+ # Adapter configuration
30
+ ![settings](docs/pictures/setting.png)
31
+ Press "save & close" or "save" to restart the adapter and take over the changes.
32
+ When starting, the adapter tries to read all GroupAdresses with have the autoread flag (default setting).
33
+ This could take a while and can produce a higher load on your KNX-bus. This ensures that the adapter operates with up-to-date values from the start.
34
+ Autoread is done on the first connection with the knx bus after an adapter start or restart, not on every knx reconnection.
35
+ After adapter installation, open the adapter configuration. Fill in:
36
+ #### KNX Gateway IP
37
+ IP of your KNX/Lan GW
38
+
39
+ ##### Port
40
+ this is normally port 3671 of the KNX IP gateway.
30
41
 
42
+ ##### phys. EIB Adress
43
+ Fill in physical address of the gateway in the format 1/1/1.
44
+
45
+ ##### Add only new Objects
46
+ If checked, the import will skip overwriting existing communication objects.
47
+
48
+ ##### Override object path
49
+ The adapter uses openknx.0 for first instance as default path for Iobroker objects.
50
+ If your curent setup has a lot of references to existing knx objects to an existing folder, then you can specify its location, for example knx.0.
51
+ This feature will be removed in future.
52
+
53
+ #### GA XML import
54
+ 1. In ETS go to Group Addresses, select export group addresse and select XML export in latest format version
55
+ 2. upload your ETS Export XML in the adapter via the GA XML-Import dialog
56
+ 3. Import will immediatelly start after file selection and give a status report after completion.
57
+ After the successful import a message shows how much objects where recognized. More detailed information could be found in the log.
58
+
59
+ #### Frames per sec
60
+ This settings protects the KNX bus from data flooding by limiting data frames to a certain rate. Not sent frames are put into a fifo buffer.
61
+
62
+ # howto use the adapter & basic concept
63
+ todo
31
64
 
32
65
  # Compatibility
33
66
  This adapter has its own namespace 'openknx'.
34
- for existing applications, that are connected to knx signals of other knx adapters you can use the setting:
35
- Override object path
67
+ for existing applications, that are connected to knx signals of other knx adapters you can use the setting:
68
+ Override object path
36
69
  to e.g. knx.0. A new project import will then store the data in this object tree space.
37
70
  Objects are not compatible, remove them manually before the import and disable all other knx adapters.
38
71
  Leave setting empty to use the adapters own namespace.
39
72
 
40
73
  # log level
74
+ Enable expert mode to enable switching between different log levels. Default loglevel is info.
75
+ ![loglevel](docs/pictures/logelevel.png)
41
76
 
77
+ # IOBroker Communication Object description
42
78
 
43
- # Adapter setting Interface Description
79
+ GA import generates a communication object folder structure following the ga main-group/middle-group scheme. Each groupaddress is an oject with following automatically generated data.
44
80
 
45
81
  {
46
- "_id": "path.and.name.to.object", //derieved from the KNX structure
82
+ "_id": "path.and.name.to.object", //derieved from the KNX structure
47
83
  "type": "state",
48
- "common": {
49
- "desc": "Basetype: 1-bit value, Subtype: switch", //informative
50
- "min": 0, //
51
- "max": 1,
52
- "name": "Aussen Melder Licht schalten", //informative description
53
- "read": true, //default this is set, if false incoming bus values are not updating the object
54
- "role": "", //tbd
55
- "type": "boolean", //boolean, number, string, object
56
- "unit": "", //informative, derived from dpt
57
- "write": true //default true, if set change on object is triggering knx write, succ. write sets then ack flag to true
84
+ "common": { //values here can be interpreted by iobroker
85
+ "desc": "Basetype: 1-bit value, Subtype: switch", //informative, from dpt
86
+ "min": 0, //derieved from dpt
87
+ "max": 1, //derieved from dpt
88
+ "name": "Aussen Melder Licht schalten", //informative description from ets export
89
+ "read": true, //default set, if false incoming bus values are not updating the object
90
+ "role": "", //tbd
91
+ "type": "boolean", //boolean, number, string, object, derieved from dpt
92
+ "unit": "", //derived from dpt
93
+ "write": true //default true, if set change on object is triggering knx write, succ. write sets then ack flag to true
58
94
  },
59
- "native": {
60
- "address": "0/0/7", //knx address
61
- "answer_groupValueResponse": false, //default false, if set to true adapter responds with value on GroupValue_Read
62
- "autoread": true, //default true, adapter sends a GroupValue_read on start to sync its states
63
- "bitlength": 1, //size ob knx data
64
- "dpt": "DPT1.001", //DPT
65
- "encoding": { //informative
95
+ "native": { //values here can be interpreted by openknx adapter
96
+ "address": "0/0/7", //knx address
97
+ "answer_groupValueResponse": false, //default false, if set to true adapter responds with value on GroupValue_Read
98
+ "autoread": true, //default true, adapter sends a GroupValue_read on start to sync its states
99
+ "bitlength": 1, //size ob knx data, derived from dpt
100
+ "dpt": "DPT1.001", //DPT
101
+ "encoding": { //informative
66
102
  "0": "Off",
67
103
  "1": "On"
68
104
  },
69
- "force_encoding": "",
70
- "signedness": "",
71
- "valuetype": "basic" //composite means set via a specific object
105
+ "force_encoding": "", //informative
106
+ "signedness": "", //informative
107
+ "valuetype": "basic" //composite means set via a specific javascript object
72
108
  },
73
109
  "from": "system.adapter.openknx.0",
74
110
  "user": "system.user.admin",
@@ -77,46 +113,57 @@ Leave setting empty to use the adapters own namespace.
77
113
 
78
114
 
79
115
  # Adapter communication Interface Description
80
- handeled DPTs 1-21,232,237,238
81
-
82
- Unhandeled DPTs are written as raw buffers, the iterface is a sequencial string of hexadecimal number. For example write '0102feff' to send values 0x01 0x02 0xfe 0xff on the bus.
83
- Where number, see scaling.
84
-
85
- Description of handeled DPTs
86
-
87
- javascript datatype special values range
88
- DPT-1 boolean false, true
89
- DPT-2 object {"priority":1 bit,"data":1 bit} -
90
- DPT-3 object {"decr_incr":1 bit,"data":2 bit} -
91
- DPT-18 object {"save_recall":0,"scenenumber":0}
92
- DPT-21 object {"outofservice":0,"fault":0,"overridden":0,"inalarm":0,"alarmunack":0} -
93
- DPT-232 object {red:0..255, green:0.255, blue:0.255} -
94
- DPT-237 object {"address":0,"addresstype":0,"readresponse":0,"lampfailure":0,"ballastfailure":0,"convertorerror":0} -
95
- DPT-4 string one character sent as 8-bit character
96
- DPT-16 string one character sent as 16-character string
97
- DPT-5 number 8-bit unsigned value
98
- DPT-5.001 number 0..100 [%] scaled to 1-byte
99
- DPT-5.003 number 0..360 [°] scaled to 1-byte
100
- DPT-6 number 8-bit signed -128..127
101
- DPT-7 number 16-bit unsigned value
102
- DPT-8 number 2-byte signed value -32768..32767
103
- DPT-9 number 2-byte floating point value
104
- DPT-14 number 4-byte floating point value
105
- DPT-12 number 4-byte unsigned value
106
- DPT-13 number 4-byte signed value
107
- DPT-15 number 4-byte
108
- DPT-17 number 1-byte
109
- DPT-20 number 1-byte
110
- DPT-238 number 1-byte
111
- DPT-10 number for Date Object -
112
- DPT-11 number for Date Object -
113
- DPT-19 number for Date Object -
114
- rest object {0 .. } -
116
+ Handeled DPTs are: 1-21,232,237,238
117
+ Unhandeled DPTs are written as raw buffers, the interface is a sequencial string of hexadecimal numbers. For example write '0102feff' to send values 0x01 0x02 0xfe 0xff on the bus.
118
+ Where number datatype is used please note that interface values can be scaled.
119
+
120
+ #### API call
121
+
122
+ setState(
123
+ id: string, // object path
124
+ state: State | StateValue | SettableState,
125
+ ack: false, //set to false and will be set to true by KNX stack on send confirmation
126
+ c: 'GroupValue_Read' //optional comment, set this value to trigger a bus read to this object, given StateValue is ignored
127
+ ): void;
128
+
129
+
130
+
131
+ #### Description of all DPTs
132
+
133
+ |KNX DPT |javascript datatype |special values |value range |
134
+ |--- |--- |--- |---|
135
+ |DPT-1 |boolean | |false, true|
136
+ |DPT-2 |object |{"priority":1 bit,"data":1 bit} |-|
137
+ |DPT-3 |object |{"decr_incr":1 bit,"data":2 bit} |-|
138
+ |DPT-18 |object |{"save_recall":0,"scenenumber":0} |
139
+ |DPT-21 |object |{"outofservice":0,"fault":0,"overridden":0,"inalarm":0,"alarmunack":0} |-|
140
+ |DPT-232 |object |{red:0..255, green:0.255, blue:0.255} -|
141
+ |DPT-237 |object |{"address":0,"addresstype":0,"readresponse":0,"lampfailure":0,"ballastfailure":0,"convertorerror":0} |-|
142
+ |DPT-4 |string ||one character sent as 8-bit character|
143
+ |DPT-16 |string ||one character sent as 16-character string|
144
+ |DPT-5 |number ||8-bit unsigned value|
145
+ |DPT-5.001 |number ||0..100 [%] scaled to 1-byte|
146
+ |DPT-5.003 |number ||0..360 [°] scaled to 1-byte|
147
+ |DPT-6 |number ||8-bit signed -128..127|
148
+ |DPT-7 |number ||16-bit unsigned value|
149
+ |DPT-8 |number ||2-byte signed value |-32768..32767|
150
+ |DPT-9 |number ||2-byte floating point value|
151
+ |DPT-14 |number ||4-byte floating point value|
152
+ |DPT-12 |number ||4-byte unsigned value|
153
+ |DPT-13 |number ||4-byte signed value|
154
+ |DPT-15 |number ||4-byte|
155
+ |DPT-17 |number ||1-byte|
156
+ |DPT-20 |number ||1-byte|
157
+ |DPT-238 |number | |1-byte|
158
+ |DPT-10 |number for Date Object ||-|
159
+ |DPT-11 |number for Date Object ||-|
160
+ |DPT-19 |number for Date Object ||-|
161
+ |rest |string |00010203.. |-|
115
162
 
116
163
 
117
164
  Only time and date information is exchanged with KNX time based datatypes, e.g. DPT-19 has unsupported fields for signal quality
118
165
 
119
- Object send and receive values are of type boolean (eg DPT1), number (scaled, or unscaled), string.
166
+ Object send and receive values are of type boolean DPT1), number (scaled, or unscaled), string.
120
167
  DPT 2 'expects a object {"priority":0,"data":1}' receive provides a strinified object of same type.
121
168
  Other joint DPTs have similar object notation.
122
169
  DPT19 expects a Number from a Date Object, Iobroker can not handle objects, fields of KNX ko that cannot be derived from timestamp are not implemented eg. quality flags
@@ -126,72 +173,52 @@ Please have in mind that Javascript and KNX have very different base type for ti
126
173
  DPT10 is time (hh:mm:ss) plus "day of week". This concept is unavailable in JS, so you'll be getting/setting a regular Date Js object, but please remember you'll need to ignore the date, month and year. The exact same datagram that converts to "Mon, Jul 1st 12:34:56", will evaluate to a wildly different JS Date of "Mon, Jul 8th 12:34:56" one week later. Be warned!
127
174
  DPT11 is date (dd/mm/yyyy): the same applies for DPT11, you'll need to ignore the time part.
128
175
 
176
+ #### group value write
177
+ send is triggered by writing a communication object.
178
+ Communication object is triggered when a write frame is received on the bus.
129
179
 
130
- # Features
131
- * import groupaddresses in XML format
132
- * import knxprj (only tested with ets 5.7.4 file format)
133
-
134
- # Adapterconfiguration
135
- After installing this adapter, open the adapter configuration. Fill in:
180
+ #### group value read
181
+ Sending can be triggered by writing a communicaton object with comment.
182
+ Receiving, if configured will trigger a group value response (limitation: write) of the actual c.o. value, see below
136
183
 
137
- ##### KNX Gateway IP
138
- <IP of your KNX/Lan GW> with ipv4 format
184
+ #### group value response
185
+ Sending Not yet supported. Emulated if response setting is set and adapter writes a group value write.
186
+ Receiving will update the value of the iobroker object in read is set to true.
139
187
 
140
- ##### Port
141
- this is normally port 3671 of the gateway.
142
-
143
- ##### phys. EIB Adress
144
- Fill in physical address of the gateway in the format 1/1/1.
145
-
146
- ##### Add only new Objects
147
-
148
- ##### Override object path
149
- The adapter uses openknx.0 for first instance as default path for Iobroker objects.
150
- If your existing installation has a lot of references to existing knx objects to an existing folder, then you can specify its location, for example knx.0.
151
- This feature will be removed in future.
152
-
153
- ##### Upload configuration
154
- 1st In the ETS go to Group Addresses, select Export Grou Adresses
155
- Select XML Output Format
156
- 2nd upload your ETS Export XML in the adapter via the GA XML-Import dialog
157
-
158
- After the successful import a message shows how much objects where recognized.
159
- Press "save & close" or "save" to restart the adapter and take over the changes.
160
- When starting, the adapter tries to read all GroupAdresses with have the autoread flag (default setting). This could take a while and can produce a higher load on your KNX-bus. This ensures that the adapter operates with up-to-date values from the start.
161
- Autoread is done on the first connection with the knx bus after an adapter start or restart, not on every knx reconnection.
162
-
163
- ## Objects
164
- In Objects the group adress tree like in your ETS project.
165
-
166
- # Usage
167
- If the adapter startet successfully your datapoints will be available for communication interaction.
188
+ # Features
189
+ * fast import of groupaddresses in XML format
190
+ * stable knx stack
191
+ * interpretation of many DPTs
192
+ * raw read and write of unsupported DPTs
193
+ * support of group value read and group value write, group value write as response to group value request
194
+ * Autoread
195
+ * free open source
168
196
 
169
- ## Datapoint Types
170
- Wide DPT (datapoint type) support (DPT1 - DPT21, DPT232, DPT237, DPT238 supported)
171
197
 
172
- # Special settings
173
198
 
174
199
 
175
200
  # Known Problems
176
- - raw value write where missing DPTs not fully implemented
177
- - cannot receive ga of unsupported dpt
178
- - sends write instead of response on GroupValue_Read
179
- - setting onlyAddNewObjects not working
180
- - knxprj file only tested from ETS 5.7.4
201
+ - sends write instead of GroupValue_Response on GroupValue_Read
181
202
  - IOBroker object role definition missing
182
203
 
183
- # limitations
184
- - only three level group address are supported
204
+ # Limitations
205
+ - only three level group addresses are supported
185
206
 
186
207
  ## Changelog
187
- ### 0.0.16
188
- * raw value handling
208
+ ###
209
+ * initial test release
210
+
211
+ ### 0.0.19
212
+ * display warning on ga import file errors
213
+
214
+ ### 0.0.17
215
+ * raw value handling, can now write and receive ga of unsupported dpt
216
+ * setting onlyAddNewObjects fixed
217
+ * adapter restart after import
189
218
 
190
219
  ### 0.0.14
191
220
  * import ga xml
192
221
 
193
- ### 0.0.12
194
- * initial version
195
222
 
196
223
 
197
224
  ## License
@@ -19,8 +19,6 @@
19
19
  <link rel="stylesheet" type="text/css" href="style.css" />
20
20
  <script type="text/javascript" src="words.js"></script>
21
21
 
22
- <script type="text/javascript" src="zip/zip.js"></script>
23
- <script type="text/javascript" src="zip/inflate.js"></script>
24
22
 
25
23
  <style>
26
24
  #progress {
@@ -163,7 +161,7 @@
163
161
  if (ValidateIPaddress(ip1)) {
164
162
  $('#gwip').val(ip1);
165
163
  } else {
166
- alert("Adresse ist nicht gültig");
164
+ alert("invalid address");
167
165
  }
168
166
  }
169
167
 
@@ -172,7 +170,7 @@
172
170
  if (ValidatePortaddress(gwipport1)) {
173
171
  $('#gwipport').val(gwipport1);
174
172
  } else {
175
- alert("Portnummer ist nicht gültig");
173
+ alert("invalid portnumber");
176
174
  }
177
175
  }
178
176
 
@@ -181,7 +179,7 @@
181
179
  if (ValidateEIBaddress(eibadr1)) {
182
180
  $('#eibadr').val(eibadr1);
183
181
  } else {
184
- alert("Physikalische EIB Adresse ist nicht gültig");
182
+ alert("physical EIB address not valid");
185
183
  }
186
184
  }
187
185
 
@@ -224,7 +222,6 @@
224
222
  }
225
223
  });
226
224
 
227
-
228
225
  //start with no changed settings, disable save button
229
226
  onChange(false);
230
227
  // reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
@@ -249,7 +246,6 @@
249
246
  callback(obj);
250
247
  }
251
248
 
252
-
253
249
  function fileHandler(event) {
254
250
  event.preventDefault();
255
251
 
@@ -259,18 +255,10 @@
259
255
  console.warn('invalid file object');
260
256
  return false;
261
257
  }
262
- if (file.size > 100000000) {
263
- showMessage('Filezise is too big');
264
- $('#knxprojFile').replaceWith($(knxprojFile));
265
- $('#knxprojFile').change(fileHandler);
266
- return false;
267
- }
268
258
 
269
259
  $('.file-field .btn').addClass('disabled');
270
260
  $('.file-field .file-path').prop('disabled', true);
271
261
 
272
- zip.useWebWorkers = false;
273
-
274
262
  if (file.name.split('.').pop() == 'xml') {
275
263
  var reader = new FileReader();
276
264
  reader.addEventListener('load', function readFile(event) {
@@ -278,18 +266,14 @@
278
266
  transmitXML();
279
267
 
280
268
  function transmitXML() {
281
- //$('#progress').find('.determinate').css('width', Math.round((callback / maxCat) * 100) + '%');
282
- //if (callback < maxCat) {
283
- // setTimeout(transmitXML, 100);
284
- // return;
285
- //}
269
+
286
270
  $('#knxprojFile').replaceWith($(knxprojFile));
287
271
  $('#knxprojFile').change(fileHandler);
288
272
 
289
- showToast(null, _('Please wait while generating Objects.....it could take a while.'), null, 5000);
273
+ showToast(null, _('Please wait while importing Objects...'), null, 5000);
290
274
  $('#progress .determinate').removeClass('determinate').addClass('indeterminate');
291
275
  $('#onlyAddNewObjects').addClass('disabled');
292
- sendTo(null, 'project', { xml: event.target.result }, function (result) {
276
+ sendTo(null, 'import', { xml: event.target.result, onlyAddNewObjects: $('#onlyAddNewObjects').prop('checked') }, function (result) {
293
277
  $('#onlyAddNewObjects').removeClass('disabled');
294
278
  $('.file-field .btn').removeClass('disabled');
295
279
  $('.file-field .file-path').prop('disabled', false);
@@ -299,7 +283,11 @@
299
283
  showMessage(_('Error: ') + (result ? result.error : _('Unknown')));
300
284
  } else {
301
285
  showMessage(_('Extracted %s states', result.count));
302
- sendTo(null, 'reload', null);
286
+ sendTo(null, 'reset', null);
287
+
288
+ //todo enable save button
289
+ $('.file-field .btn').addClass('enabled');
290
+ $('.file-field .file-path').prop('enabled', true);
303
291
  }
304
292
  });
305
293
  }
@@ -320,15 +308,12 @@
320
308
  // I will check only 2 first numbers of ipV4
321
309
  var i1 = ip1.split('.');
322
310
  var i2 = ip2.split('.');
323
-
324
311
  // If ipv6 or DNS name
325
312
  if (i1.length !== i2.length || i1.length !== 4) return 1;
326
-
327
313
  if (i1[0] !== i2[0]) return 0;
328
314
  if (i1[1] !== i2[1]) return 1;
329
315
  if (i1[2] !== i2[2]) return 2;
330
316
  if (i1[3] !== i2[3]) return 3;
331
-
332
317
  return 4;
333
318
  }
334
319
 
@@ -348,11 +333,9 @@
348
333
  }
349
334
 
350
335
 
351
-
352
336
  //todo ??
353
337
  $('.switch').find('input[type=checkbox]').on('change', function () {
354
338
  var status = $(this).prop('checked');
355
-
356
339
  $.ajax({
357
340
  url: url,
358
341
  type: 'post',
@@ -360,35 +343,6 @@
360
343
  })
361
344
  });
362
345
 
363
-
364
- //todo ??
365
- var modalInstance;
366
- document.addEventListener('DOMContentLoaded', function () {
367
- var modalelem = document.querySelector(".modal");
368
- modalInstance = M.Modal.init(modalelem);
369
- });
370
-
371
- //todo ??
372
- function openPasswordModal() {
373
- // document.getElementById("password").value = "";
374
- modalInstance.open();
375
- };
376
-
377
- //todo ??
378
- function getPassword() {
379
- openPasswordModal(this);
380
- // passwordOKBtn.onclick = function() {
381
- // console.log(document.getElementById("password").value);
382
- // modalInstance.value = document.getElementById("password");
383
- // modalInstance.close();
384
- // }
385
- }
386
-
387
- function closePasswordModal() {
388
- //console.log(document.getElementById("password").value);
389
- modalInstance.close();
390
- }
391
-
392
346
  function disableAllDialogs() {
393
347
  $('.c-tab').removeClass('tab-active');
394
348
  var x = document.getElementsByClassName("dialog");
@@ -404,12 +358,14 @@
404
358
  x.style.display = "block";
405
359
  }
406
360
 
361
+ /*
407
362
  function showDebugDialog() {
408
363
  disableAllDialogs();
409
364
  $('.dialog-debug').addClass('tab-active');
410
365
  var x = document.getElementById("debugDialog");
411
366
  x.style.display = "block";
412
367
  }
368
+ */
413
369
 
414
370
  </script>
415
371
  </head>
@@ -417,16 +373,17 @@
417
373
  <body>
418
374
  <!-- you have to put your config page in a div with id adapter-container -->
419
375
  <div class="m adapter-container">
376
+ <!--
420
377
  <nav>
421
378
  <div class="nav-wrapper">
422
379
  <a href="#!" class="brand-logo"><img src="openknx.png" width="65" height="auto" alt="logo" /></a>
423
380
  <ul class="right hide-on-med-and-down">
424
381
  <li><a onclick="showConfigDialog()" class="dialog-config c-tab translate">Configuration</a></li>
425
- <!-- <li><a onclick="showDebugDialog()" class="dialog-debug c-tab translate">Debug</a></li>-->
382
+ <li><a onclick="showDebugDialog()" class="dialog-debug c-tab translate">Debug</a></li>
426
383
  </ul>
427
384
  </div>
428
385
  </nav>
429
-
386
+ -->
430
387
  <div id="passwordModal" class="modal" role="dialog">
431
388
  <div class="modal-dialog">
432
389
  <div class="modal-content">
package/admin/words.js CHANGED
@@ -168,9 +168,9 @@ systemDictionary = {
168
168
  "es": "Escuchar en todas las direcciones IP",
169
169
  "pl": "Posłuchaj na wszystkich IP"
170
170
  },
171
- "Please wait while generating Objects.....it could take a while.": {
172
- "en": "Please wait while generating Objects.....it could take a while.",
173
- "de": "Bitte warten Sie, während Sie Objekte erzeugen ..... es könnte eine Weile dauern.",
171
+ "Please wait while generating Objects...": {
172
+ "en": "Please wait while generating Objects...",
173
+ "de": "Bitte warten Sie, während Sie Objekte erzeugen...",
174
174
  "ru": "Подождите, пока вы создадите объекты ..... это может занять некоторое время.",
175
175
  "pt": "Aguarde enquanto gera objetos ..... pode demorar um pouco.",
176
176
  "nl": "Even geduld met het genereren van objecten ... het kan even duren.",
@@ -181,7 +181,7 @@ systemDictionary = {
181
181
  },
182
182
  "Extracted %s states": {
183
183
  "en": "Extracted %s states",
184
- "de": "Es wurde %s Objekte extrahiert",
184
+ "de": "Es wurden %s Objekte extrahiert",
185
185
  "ru": "Извлечено %s объектов",
186
186
  "pt": "Estados extraídos %s",
187
187
  "nl": "Geëxtrade %s toestanden",
Binary file
Binary file
Binary file
Binary file