@switchbot/homebridge-switchbot 5.0.0-beta.111 → 5.0.0-beta.112

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/todo/COMPLETED.md CHANGED
@@ -181,6 +181,19 @@ This file tracks all completed features and improvements for the SwitchBot Homeb
181
181
 
182
182
  ## Bug Fixes & Technical Debt
183
183
 
184
+ ### Fix Discovery Not Showing Devices ✅ COMPLETED
185
+
186
+ - [x] **Issue:** No devices appear in discovery results after clicking "Discover Devices"
187
+ - [x] **Root Cause:** Discovery UI cleared the `#discoveredList` div (including the `<ul id="discoveredDevices">` element), but then tried to replace a non-existent element when rendering discovered devices
188
+ - [x] **Effect:** `document.getElementById('discoveredDevices')?.replaceWith(ul)` silently failed due to optional chaining, leaving the list empty
189
+
190
+ **Implementation:**
191
+ - Modified `discoverDevices()` in `discovery.ts` to create a new `<ul id="discoveredDevices">` container if it doesn't exist after clearing controls
192
+ - Updated `updateDiscoveryView()` to check if the element exists before using `replaceWith()`, with fallback to append if element is missing
193
+ - Added proper element lifecycle management for discovery list rendering
194
+
195
+ **Status:** Discovery now properly displays all discovered devices. Devices appear correctly with filters, sorting, and duplicate detection badges.
196
+
184
197
  ### Fix lint & lint:fix scripts ✅ COMPLETED
185
198
 
186
199
  - [x] Update ESLint configuration to include `src/homebridge-ui/**/*.ts` files