homebridge-zwave-usb 2.0.0 → 2.0.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.
@@ -303,6 +303,11 @@ class ControllerAccessory {
303
303
  }
304
304
  this.exclusionService.updateCharacteristic(this.platform.Characteristic.On, false);
305
305
  },
306
+ 'heal network progress': (progress) => {
307
+ const done = Array.from(progress.values()).filter((v) => v !== 0).length;
308
+ const total = progress.size;
309
+ this.statusChar.updateValue(`Heal: ${done}/${total}`);
310
+ },
306
311
  'heal network done': () => {
307
312
  this.platform.log.info('Controller event: Heal Network Done');
308
313
  this.isHealActive = false;
@@ -70,10 +70,15 @@ class ZWaveController extends events_1.EventEmitter {
70
70
  },
71
71
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
72
  'rebuild routes progress': (progress) => {
73
+ const done = Array.from(progress.values()).filter((v) => v !== 0).length;
74
+ const total = progress.size;
75
+ this.log.info(`Heal Network Progress: ${done}/${total} nodes completed`);
76
+ this.emit('status updated', `Heal: ${done}/${total}`);
73
77
  this.emit('heal network progress', progress);
74
78
  },
75
79
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
80
  'rebuild routes done': (result) => {
81
+ this.log.info('Heal Network Complete');
77
82
  this.emit('status updated', 'Heal Network Done');
78
83
  setTimeout(() => this.emit('status updated', 'Driver Ready'), 5000);
79
84
  this.emit('heal network done', result);
@@ -583,8 +588,11 @@ class ZWaveController extends events_1.EventEmitter {
583
588
  if (!this.driver) {
584
589
  return false;
585
590
  }
591
+ this.log.info('Z-Wave Controller: Requesting rebuild of all routes (Network Heal)...');
586
592
  try {
587
- return await this.driver.controller.beginRebuildingRoutes();
593
+ const started = await this.driver.controller.beginRebuildingRoutes();
594
+ this.log.info(`Z-Wave Controller: Heal started: ${started}`);
595
+ return started;
588
596
  }
589
597
  catch (err) {
590
598
  this.log.error('Failed to start network heal:', err);
@@ -595,8 +603,11 @@ class ZWaveController extends events_1.EventEmitter {
595
603
  if (!this.driver) {
596
604
  return false;
597
605
  }
606
+ this.log.info('Z-Wave Controller: Requesting to stop network heal...');
598
607
  try {
599
- return await this.driver.controller.stopRebuildingRoutes();
608
+ const stopped = await this.driver.controller.stopRebuildingRoutes();
609
+ this.log.info(`Z-Wave Controller: Heal stopped: ${stopped}`);
610
+ return stopped;
600
611
  }
601
612
  catch (err) {
602
613
  this.log.error('Failed to stop network heal:', err);
@@ -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
- const config = pluginConfig[0] || {};
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.0",
4
+ "version": "2.0.2",
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": {