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

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 (85) hide show
  1. package/MIGRATION.md +10 -0
  2. package/README.md +43 -0
  3. package/TODO.md +263 -0
  4. package/config.schema.json +27 -10
  5. package/dist/device-types.d.ts.map +1 -1
  6. package/dist/device-types.js +93 -63
  7. package/dist/device-types.js.map +1 -1
  8. package/dist/deviceFactory.d.ts.map +1 -1
  9. package/dist/deviceFactory.js +55 -33
  10. package/dist/deviceFactory.js.map +1 -1
  11. package/dist/devices/genericDevice.d.ts +12 -1
  12. package/dist/devices/genericDevice.d.ts.map +1 -1
  13. package/dist/devices/genericDevice.js +121 -1
  14. package/dist/devices/genericDevice.js.map +1 -1
  15. package/dist/errors.d.ts +5 -0
  16. package/dist/errors.d.ts.map +1 -0
  17. package/dist/errors.js +51 -0
  18. package/dist/errors.js.map +1 -0
  19. package/dist/homebridge-ui/endpoints/devices.d.ts.map +1 -1
  20. package/dist/homebridge-ui/endpoints/devices.js +80 -1
  21. package/dist/homebridge-ui/endpoints/devices.js.map +1 -1
  22. package/dist/homebridge-ui/endpoints/discovery.d.ts.map +1 -1
  23. package/dist/homebridge-ui/endpoints/discovery.js +73 -41
  24. package/dist/homebridge-ui/endpoints/discovery.js.map +1 -1
  25. package/dist/homebridge-ui/public/css/styles.css +209 -16
  26. package/dist/homebridge-ui/public/index.html +87 -56
  27. package/dist/homebridge-ui/public/js/api.d.ts +24 -1
  28. package/dist/homebridge-ui/public/js/api.d.ts.map +1 -1
  29. package/dist/homebridge-ui/public/js/api.js +33 -2
  30. package/dist/homebridge-ui/public/js/api.js.map +1 -1
  31. package/dist/homebridge-ui/public/js/api.ts +52 -3
  32. package/dist/homebridge-ui/public/js/app.js +1604 -143
  33. package/dist/homebridge-ui/public/js/app.js.map +3 -3
  34. package/dist/homebridge-ui/public/js/app.ts +2 -1
  35. package/dist/homebridge-ui/public/js/devices.d.ts.map +1 -1
  36. package/dist/homebridge-ui/public/js/devices.js +2 -0
  37. package/dist/homebridge-ui/public/js/devices.js.map +1 -1
  38. package/dist/homebridge-ui/public/js/devices.ts +13 -1
  39. package/dist/homebridge-ui/public/js/discovery.d.ts +1 -0
  40. package/dist/homebridge-ui/public/js/discovery.d.ts.map +1 -1
  41. package/dist/homebridge-ui/public/js/discovery.js +1244 -124
  42. package/dist/homebridge-ui/public/js/discovery.js.map +1 -1
  43. package/dist/homebridge-ui/public/js/discovery.ts +1344 -142
  44. package/dist/homebridge-ui/public/js/modals.d.ts.map +1 -1
  45. package/dist/homebridge-ui/public/js/modals.js +42 -0
  46. package/dist/homebridge-ui/public/js/modals.js.map +1 -1
  47. package/dist/homebridge-ui/public/js/modals.ts +50 -1
  48. package/dist/homebridge-ui/public/js/render.d.ts +3 -0
  49. package/dist/homebridge-ui/public/js/render.d.ts.map +1 -1
  50. package/dist/homebridge-ui/public/js/render.js +389 -36
  51. package/dist/homebridge-ui/public/js/render.js.map +1 -1
  52. package/dist/homebridge-ui/public/js/render.ts +421 -38
  53. package/dist/platform.d.ts +1 -0
  54. package/dist/platform.d.ts.map +1 -1
  55. package/dist/platform.js +3 -4
  56. package/dist/platform.js.map +1 -1
  57. package/dist/switchbotClient.d.ts.map +1 -1
  58. package/dist/switchbotClient.js +51 -5
  59. package/dist/switchbotClient.js.map +1 -1
  60. package/docs/assets/highlight.css +9 -2
  61. package/docs/index.html +28 -2
  62. package/docs/variables/default.html +1 -1
  63. package/package.json +9 -8
  64. package/src/device-types.ts +95 -64
  65. package/src/deviceFactory.ts +55 -33
  66. package/src/devices/genericDevice.ts +113 -1
  67. package/src/errors.ts +43 -0
  68. package/src/homebridge-ui/endpoints/devices.ts +82 -1
  69. package/src/homebridge-ui/endpoints/discovery.ts +78 -44
  70. package/src/homebridge-ui/public/css/styles.css +209 -16
  71. package/src/homebridge-ui/public/index.html +87 -56
  72. package/src/homebridge-ui/public/js/api.ts +52 -3
  73. package/src/homebridge-ui/public/js/app.ts +2 -1
  74. package/src/homebridge-ui/public/js/devices.ts +13 -1
  75. package/src/homebridge-ui/public/js/discovery.ts +1344 -142
  76. package/src/homebridge-ui/public/js/modals.ts +50 -1
  77. package/src/homebridge-ui/public/js/render.ts +421 -38
  78. package/src/platform.ts +3 -4
  79. package/src/switchbotClient.ts +44 -9
  80. package/test/e2e/run-e2e.spec.ts +12 -10
  81. package/test/helpers/matter-harness.ts +2 -2
  82. package/test/matter-integration.spec.ts +21 -0
  83. package/todo/COMPLETED.md +313 -0
  84. package/todo/TODO.md +80 -66
  85. package/switchbot-homebridge-switchbot-5.0.0.tgz +0 -0
package/todo/TODO.md CHANGED
@@ -1,104 +1,118 @@
1
- # SwitchBot Plugin TODO List
1
+ # SwitchBot Plugin TODO List (2026)
2
2
 
3
- ## Active Tasks
4
3
 
5
- ### Bug Fixes (Priority: Critical)
4
+ #### 8. Batch Import
6
5
 
7
- - No active critical bug fixes right now.
6
+ - [x] Add checkboxes to select multiple devices
7
+ - [x] Add "Add Selected to Config" button
8
+ - [x] Implement bulk configuration with smart defaults
9
+
10
+ - [x] Show firmware update available indicators
11
+ - [x] Show offline/unreachable warnings
12
+ - [x] Add "Needs Attention" section at top
13
+ - [ ] Implement battery level trending (if historical data available)
14
+
15
+ #### 10. Export/Import Discovery
16
+
17
+ - [ ] Add "Export Results" button (JSON format)
18
+ - [ ] Add "Import Results" for comparison or troubleshooting
19
+ - [ ] Share with support for debugging
20
+ - [ ] Compare current vs previous discovery (show differences)
21
+ - [ ] Generate discovery report (formatted summary)
8
22
 
9
23
  ---
10
24
 
11
- ## Discovery System Enhancements
25
+ ## Bug Fixes & Technical Debt
12
26
 
13
- ### Quick Wins (Priority: High)
27
+ ### Testing & Quality Assurance
14
28
 
15
- #### 1. Better Loading States
29
+ - [ ] **Test discovery with real hardware**
30
+ - [ ] Test BLE discovery with nearby devices
31
+ - [ ] Test OpenAPI discovery with cloud-registered devices
32
+ - [ ] Test with mixed BLE+API devices
33
+ - [ ] Test connection type badge display
34
+ - [ ] Verify deduplication works correctly
16
35
 
17
- - [ ] Show progress indicator: "Scanning BLE... (5s)" → "Fetching OpenAPI..." → "Complete"
18
- - [ ] Add progress bar or spinner for each discovery phase
19
- - [ ] Display partial results as they arrive (streaming)
20
- - [ ] Show elapsed time for each phase
21
- - [ ] Add "Cancel" button to abort long scans
36
+ - [ ] **Add error handling improvements**
37
+ - [ ] Better error messages for users
38
+ - [ ] Retry logic with exponential backoff
39
+ - [ ] Graceful degradation when BLE unavailable
40
+ - [ ] Network timeout handling
22
41
 
23
- ### Medium Effort (Priority: Medium)
42
+ ---
24
43
 
25
- #### 2. Device Grouping
44
+ ## Documentation
26
45
 
27
- - [ ] Implement grouping by Hub (show which devices are on which hub)
28
- - [ ] Implement grouping by Connection Type
29
- - [ ] Add expandable/collapsible group headers
30
- - [ ] Show device count per group
31
- - [ ] Remember expanded/collapsed state
46
+ - [ ] **Update README with discovery features**
47
+ - [ ] Document BLE vs OpenAPI discovery
48
+ - [ ] Add screenshots of new UI features
49
+ - [ ] Explain connection type badges
50
+ - [ ] Add troubleshooting guide for discovery issues
32
51
 
33
- #### 3. Connection Recommendations
52
+ - [ ] **Create developer documentation**
53
+ - [ ] Document new modular structure
54
+ - [ ] API documentation for endpoints
55
+ - [ ] Contributing guidelines for UI changes
34
56
 
35
- - [ ] Add badge: "⚡ Recommended: BLE" for devices with strong signal (> -70 dBm)
36
- - [ ] Add badge: "☁️ Recommended: API" for hub-dependent devices
37
- - [ ] Show tooltip explaining why recommendation is made
38
- - [ ] Consider device type (some work better with BLE vs API)
57
+ ---
39
58
 
40
- #### 4. Configurable BLE Scan
59
+ ## Priority Summary
41
60
 
42
- - [ ] Add settings panel with scan duration options (3s/5s/10s/15s)
43
- - [ ] Add option to disable BLE scanning if no Bluetooth adapter
44
- - [ ] Add option to adjust BLE timeout
45
- - [ ] Remember user preferences in localStorage
46
- - [ ] Show system Bluetooth availability status
61
+ ### Must Do (Next Release)
47
62
 
48
- #### 5. Discovery History/Cache
63
+ 1. Better Loading States
49
64
 
50
- - [ ] Cache last discovery results for 5 minutes
51
- - [ ] Show "Last scanned: X minutes ago" with timestamp
52
- - [ ] Add "Refresh" button to re-scan
53
- - [ ] Show cached results immediately on page load
54
- - [ ] Auto-refresh option with configurable interval
65
+ ### Should Do (Soon)
55
66
 
56
- #### 6. Detailed Device Info Panel
67
+ 1. Connection Recommendations
68
+ 2. Device Grouping
69
+ 3. Test discovery with real hardware
70
+ 4. Update README with new features
57
71
 
58
- - [ ] Add click-to-expand device details panel
59
- - [ ] Show extended information:
60
- - [ ] Battery level (if available)
61
- - [ ] Firmware version
62
- - [ ] Cloud service enabled/disabled status
63
- - [ ] Last seen timestamp
64
- - [ ] Full MAC address
65
- - [ ] Device capabilities/features
66
- - [ ] Add "Copy ID" and "Copy MAC" buttons
72
+ ### Nice to Have (Future)
67
73
 
68
- ### Advanced Features (Priority: Low)
74
+ 1. Configurable BLE Scan
75
+ 2. Discovery History/Cache
76
+ 3. Connection Testing
77
+ 4. Batch Import
78
+ 5. Device Health Dashboard
69
79
 
70
- #### 7. Real-Time BLE Scanning
80
+ ---
81
+
82
+ ## Notes
83
+
84
+ - See [COMPLETED.md](COMPLETED.md) for all completed features
85
+ - UI mockups available in [mockups/](mockups/) directory
86
+ - Consider user feedback on most-wanted features
87
+ - Test all changes with real SwitchBot devices
88
+ - Maintain backwards compatibility with existing configs
89
+ - Keep UI responsive and fast (< 500ms interactions)
90
+ - Follow Homebridge UI/UX conventions
91
+ # Integration: node-switchbot Beta Updates (March 2026)
92
+
93
+ ## Tasks to Integrate Latest node-switchbot Features
94
+
95
+
96
+ ## Next Features
97
+
98
+ ### Advanced Features (Priority: Low)
71
99
 
72
- - [ ] Show devices as they're discovered (streaming results)
73
- - [ ] Add animated "pulsing" indicator for active BLE scan
74
- - [ ] Update RSSI values in real-time during scan
75
- - [ ] Show "X devices found..." counter during scan
76
100
 
77
- #### 8. Connection Testing
78
101
 
79
- - [ ] Add "Test Connection" button per device
80
- - [ ] Attempt to connect and read basic device status
81
- - [ ] Show success/failure indicator with details
82
- - [ ] Display connection latency
83
- - [ ] Show which connection method succeeded (BLE/API)
84
102
 
85
- #### 9. Batch Import
103
+ #### 8. Batch Import
86
104
 
87
105
  - [ ] Add checkboxes to select multiple devices
88
106
  - [ ] Add "Add Selected to Config" button
89
107
  - [ ] Implement bulk configuration with smart defaults
90
- - [ ] Show progress for batch operations
91
- - [ ] Allow batch enable/disable of devices
92
108
 
93
- #### 10. Device Health Dashboard
94
109
 
95
- - [ ] Show battery warnings (< 20%) with yellow/red indicators
96
- - [ ] Show firmware update available indicators
97
- - [ ] Show offline/unreachable warnings
110
+ - [x] Show firmware update available indicators
111
+ - [x] Show offline/unreachable warnings
98
112
  - [ ] Add "Needs Attention" section at top
99
113
  - [ ] Implement battery level trending (if historical data available)
100
114
 
101
- #### 11. Export/Import Discovery
115
+ #### 10. Export/Import Discovery
102
116
 
103
117
  - [ ] Add "Export Results" button (JSON format)
104
118
  - [ ] Add "Import Results" for comparison or troubleshooting