homebridge-zwave-usb 2.0.0 → 2.0.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.
|
@@ -66,6 +66,8 @@
|
|
|
66
66
|
|
|
67
67
|
<script>
|
|
68
68
|
(async () => {
|
|
69
|
+
let currentConfig = {};
|
|
70
|
+
|
|
69
71
|
const getInt = (id, def) => {
|
|
70
72
|
const el = document.getElementById(id);
|
|
71
73
|
if (!el) return def;
|
|
@@ -84,6 +86,7 @@
|
|
|
84
86
|
};
|
|
85
87
|
|
|
86
88
|
const newConfig = {
|
|
89
|
+
...currentConfig,
|
|
87
90
|
name: document.getElementById('name').value,
|
|
88
91
|
platform: 'ZWaveUSB',
|
|
89
92
|
serialPort: document.getElementById('serialPort').value,
|
|
@@ -93,6 +96,8 @@
|
|
|
93
96
|
|
|
94
97
|
if (Object.values(securityKeys).some((k) => k && k.length > 0)) {
|
|
95
98
|
newConfig.securityKeys = securityKeys;
|
|
99
|
+
} else {
|
|
100
|
+
delete newConfig.securityKeys;
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
return newConfig;
|
|
@@ -110,7 +115,8 @@
|
|
|
110
115
|
|
|
111
116
|
// Load Config
|
|
112
117
|
const pluginConfig = await window.homebridge.getPluginConfig();
|
|
113
|
-
|
|
118
|
+
currentConfig = pluginConfig[0] || { platform: 'ZWaveUSB' };
|
|
119
|
+
const config = currentConfig;
|
|
114
120
|
|
|
115
121
|
// Populate Form
|
|
116
122
|
document.getElementById('name').value = config.name || 'Homebridge Z-Wave USB';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-zwave-usb",
|
|
3
3
|
"displayName": "Homebridge Z-Wave USB",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"description": "A Homebridge dynamic platform plugin for Z-Wave USB controllers using zwave-js.",
|
|
6
6
|
"license": "Polyform-Noncommercial-1.0.0",
|
|
7
7
|
"funding": {
|