homebridge-smartsystem 7.2.2 → 7.2.4
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/package.json +1 -1
- package/server/smartapp.js +4 -0
- package/server/views/proxy.ejs +23 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-smartsystem",
|
|
3
3
|
"displayname": "Duotecno Bridge",
|
|
4
|
-
"version": "7.2.
|
|
4
|
+
"version": "7.2.4",
|
|
5
5
|
"description": "SmartServer (Proxy TCP sockets to the cloud, Smappee MQTT, Duotecno IP Nodes, Homekit interface)",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": "Johan Coppieters",
|
package/server/smartapp.js
CHANGED
|
@@ -263,6 +263,10 @@ function SmartSocketInit(message){
|
|
|
263
263
|
// save username / password in config
|
|
264
264
|
this.config.username = user;
|
|
265
265
|
this.config.password = pw;
|
|
266
|
+
// remember the username as the login page's default, so it doesn't keep falling back
|
|
267
|
+
// to the hardcoded "duotecno" default for gateways whose actual account uses another name
|
|
268
|
+
this.config.user = user;
|
|
269
|
+
this.user = user;
|
|
266
270
|
this.writeConfig();
|
|
267
271
|
this.token = access_token;
|
|
268
272
|
(0, config_1.setToken)(this.token);
|
package/server/views/proxy.ejs
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
<h1>
|
|
13
13
|
Proxy Config
|
|
14
14
|
<button class="right btn waves-effect waves-light" type="submit" name="action" value="cancel">Back</button>
|
|
15
|
-
<button class="right btn waves-effect waves-light" type="submit" name="action" value="save"
|
|
15
|
+
<button class="right btn waves-effect waves-light" type="submit" name="action" value="save"
|
|
16
|
+
onclick="return confirmNodeNumber();">Save</button>
|
|
16
17
|
<button class="right btn waves-effect waves-light red" type="submit" name="action" value="restart">Restart</button>
|
|
17
18
|
<button class="right btn waves-effect waves-light
|
|
18
19
|
<%= backupState === 'warning' ? 'orange darken-1' : (backupState === 'blue' ? 'blue' : 'grey') %>"
|
|
@@ -116,11 +117,14 @@
|
|
|
116
117
|
<div class="row" style="margin-top: 0;">
|
|
117
118
|
<div class="input-field col s6">
|
|
118
119
|
<label for="dserverEmail">Duotecno Account Email</label>
|
|
119
|
-
<input id="dserverEmail" name="dserverEmail" type="
|
|
120
|
+
<input id="dserverEmail" name="dserverEmail" type="text" autocomplete="off"
|
|
121
|
+
value="<%= config.dserverEmail || '' %>">
|
|
120
122
|
</div>
|
|
121
123
|
<div class="input-field col s6">
|
|
122
124
|
<label for="dserverPassword">Duotecno Account Password</label>
|
|
123
|
-
<input id="dserverPassword" name="dserverPassword" type="
|
|
125
|
+
<input id="dserverPassword" name="dserverPassword" type="text" autocomplete="off"
|
|
126
|
+
style="-webkit-text-security: disc;"
|
|
127
|
+
value="<%= config.dserverPassword || '' %>">
|
|
124
128
|
</div>
|
|
125
129
|
</div>
|
|
126
130
|
|
|
@@ -177,7 +181,8 @@
|
|
|
177
181
|
</h2>
|
|
178
182
|
<p class="grey-text" style="margin-bottom: 2rem;">
|
|
179
183
|
Reach this configuration interface itself through the cloud server, at
|
|
180
|
-
<code>https://<%= config.cloudServer %>/connect/<%= deviceIds.http
|
|
184
|
+
<code>https://<%= config.cloudServer %>/connect/<%= deviceIds.http %>/ <br>
|
|
185
|
+
and fill in your username + password.</code>.
|
|
181
186
|
</p>
|
|
182
187
|
|
|
183
188
|
<div class="row" style="margin-top: 1rem;">
|
|
@@ -335,5 +340,19 @@
|
|
|
335
340
|
|
|
336
341
|
</body>
|
|
337
342
|
|
|
343
|
+
<script>
|
|
344
|
+
// The gateway has no Duotecno bus address of its own -- it always registers under the
|
|
345
|
+
// reserved node 0xff. Deviating from that is an exceptional setup that can collide with
|
|
346
|
+
// another device's registration on the cloud server, so confirm it explicitly on Save.
|
|
347
|
+
function confirmNodeNumber() {
|
|
348
|
+
var el = document.getElementById('nodeNumber');
|
|
349
|
+
var v = (el.value || '').trim().toLowerCase().replace(/^0x/, '');
|
|
350
|
+
if (v === '' || v === 'ff') return true;
|
|
351
|
+
return confirm('You changed the reserved node number away from the default (0xff). ' +
|
|
352
|
+
'This is an exceptional setup and may conflict with another device registered on the ' +
|
|
353
|
+
'cloud server. Continue anyway?');
|
|
354
|
+
}
|
|
355
|
+
</script>
|
|
356
|
+
|
|
338
357
|
<%- include('/views/scripts'); -%>
|
|
339
358
|
</html>
|