@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.
- package/MIGRATION.md +10 -0
- package/README.md +43 -0
- package/TODO.md +263 -0
- package/config.schema.json +27 -10
- package/dist/device-types.d.ts.map +1 -1
- package/dist/device-types.js +93 -63
- package/dist/device-types.js.map +1 -1
- package/dist/deviceFactory.d.ts.map +1 -1
- package/dist/deviceFactory.js +55 -33
- package/dist/deviceFactory.js.map +1 -1
- package/dist/devices/genericDevice.d.ts +12 -1
- package/dist/devices/genericDevice.d.ts.map +1 -1
- package/dist/devices/genericDevice.js +121 -1
- package/dist/devices/genericDevice.js.map +1 -1
- package/dist/errors.d.ts +5 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +51 -0
- package/dist/errors.js.map +1 -0
- package/dist/homebridge-ui/endpoints/devices.d.ts.map +1 -1
- package/dist/homebridge-ui/endpoints/devices.js +80 -1
- package/dist/homebridge-ui/endpoints/devices.js.map +1 -1
- package/dist/homebridge-ui/endpoints/discovery.d.ts.map +1 -1
- package/dist/homebridge-ui/endpoints/discovery.js +73 -41
- package/dist/homebridge-ui/endpoints/discovery.js.map +1 -1
- package/dist/homebridge-ui/public/css/styles.css +209 -16
- package/dist/homebridge-ui/public/index.html +87 -56
- package/dist/homebridge-ui/public/js/api.d.ts +24 -1
- package/dist/homebridge-ui/public/js/api.d.ts.map +1 -1
- package/dist/homebridge-ui/public/js/api.js +33 -2
- package/dist/homebridge-ui/public/js/api.js.map +1 -1
- package/dist/homebridge-ui/public/js/api.ts +52 -3
- package/dist/homebridge-ui/public/js/app.js +1604 -143
- package/dist/homebridge-ui/public/js/app.js.map +3 -3
- package/dist/homebridge-ui/public/js/app.ts +2 -1
- package/dist/homebridge-ui/public/js/devices.d.ts.map +1 -1
- package/dist/homebridge-ui/public/js/devices.js +2 -0
- package/dist/homebridge-ui/public/js/devices.js.map +1 -1
- package/dist/homebridge-ui/public/js/devices.ts +13 -1
- package/dist/homebridge-ui/public/js/discovery.d.ts +1 -0
- package/dist/homebridge-ui/public/js/discovery.d.ts.map +1 -1
- package/dist/homebridge-ui/public/js/discovery.js +1244 -124
- package/dist/homebridge-ui/public/js/discovery.js.map +1 -1
- package/dist/homebridge-ui/public/js/discovery.ts +1344 -142
- package/dist/homebridge-ui/public/js/modals.d.ts.map +1 -1
- package/dist/homebridge-ui/public/js/modals.js +42 -0
- package/dist/homebridge-ui/public/js/modals.js.map +1 -1
- package/dist/homebridge-ui/public/js/modals.ts +50 -1
- package/dist/homebridge-ui/public/js/render.d.ts +3 -0
- package/dist/homebridge-ui/public/js/render.d.ts.map +1 -1
- package/dist/homebridge-ui/public/js/render.js +389 -36
- package/dist/homebridge-ui/public/js/render.js.map +1 -1
- package/dist/homebridge-ui/public/js/render.ts +421 -38
- package/dist/platform.d.ts +1 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +3 -4
- package/dist/platform.js.map +1 -1
- package/dist/switchbotClient.d.ts.map +1 -1
- package/dist/switchbotClient.js +51 -5
- package/dist/switchbotClient.js.map +1 -1
- package/docs/assets/highlight.css +9 -2
- package/docs/index.html +28 -2
- package/docs/variables/default.html +1 -1
- package/package.json +9 -8
- package/src/device-types.ts +95 -64
- package/src/deviceFactory.ts +55 -33
- package/src/devices/genericDevice.ts +113 -1
- package/src/errors.ts +43 -0
- package/src/homebridge-ui/endpoints/devices.ts +82 -1
- package/src/homebridge-ui/endpoints/discovery.ts +78 -44
- package/src/homebridge-ui/public/css/styles.css +209 -16
- package/src/homebridge-ui/public/index.html +87 -56
- package/src/homebridge-ui/public/js/api.ts +52 -3
- package/src/homebridge-ui/public/js/app.ts +2 -1
- package/src/homebridge-ui/public/js/devices.ts +13 -1
- package/src/homebridge-ui/public/js/discovery.ts +1344 -142
- package/src/homebridge-ui/public/js/modals.ts +50 -1
- package/src/homebridge-ui/public/js/render.ts +421 -38
- package/src/platform.ts +3 -4
- package/src/switchbotClient.ts +44 -9
- package/test/e2e/run-e2e.spec.ts +12 -10
- package/test/helpers/matter-harness.ts +2 -2
- package/test/matter-integration.spec.ts +21 -0
- package/todo/COMPLETED.md +313 -0
- package/todo/TODO.md +80 -66
- package/switchbot-homebridge-switchbot-5.0.0.tgz +0 -0
|
@@ -111,6 +111,47 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
|
|
|
111
111
|
macInput.style.fontSize = '14px'
|
|
112
112
|
macInput.style.boxSizing = 'border-box'
|
|
113
113
|
|
|
114
|
+
|
|
115
|
+
// BLE Encryption Key
|
|
116
|
+
const encryptionKeyLabel = document.createElement('label')
|
|
117
|
+
encryptionKeyLabel.textContent = 'BLE Encryption Key (optional)'
|
|
118
|
+
encryptionKeyLabel.style.display = 'block'
|
|
119
|
+
encryptionKeyLabel.style.marginBottom = '6px'
|
|
120
|
+
encryptionKeyLabel.style.fontWeight = '500'
|
|
121
|
+
encryptionKeyLabel.style.fontSize = '12px'
|
|
122
|
+
encryptionKeyLabel.style.color = '#6b7280'
|
|
123
|
+
|
|
124
|
+
const encryptionKeyInput = document.createElement('input')
|
|
125
|
+
encryptionKeyInput.type = 'password'
|
|
126
|
+
encryptionKeyInput.value = device.encryptionKey || ''
|
|
127
|
+
encryptionKeyInput.placeholder = 'Paste device BLE encryption key'
|
|
128
|
+
encryptionKeyInput.style.width = '100%'
|
|
129
|
+
encryptionKeyInput.style.marginBottom = '12px'
|
|
130
|
+
encryptionKeyInput.style.padding = '8px 10px'
|
|
131
|
+
encryptionKeyInput.style.borderRadius = '6px'
|
|
132
|
+
encryptionKeyInput.style.fontSize = '14px'
|
|
133
|
+
encryptionKeyInput.style.boxSizing = 'border-box'
|
|
134
|
+
|
|
135
|
+
// BLE Key ID
|
|
136
|
+
const keyIdLabel = document.createElement('label')
|
|
137
|
+
keyIdLabel.textContent = 'BLE Key ID (optional)'
|
|
138
|
+
keyIdLabel.style.display = 'block'
|
|
139
|
+
keyIdLabel.style.marginBottom = '6px'
|
|
140
|
+
keyIdLabel.style.fontWeight = '500'
|
|
141
|
+
keyIdLabel.style.fontSize = '12px'
|
|
142
|
+
keyIdLabel.style.color = '#6b7280'
|
|
143
|
+
|
|
144
|
+
const keyIdInput = document.createElement('input')
|
|
145
|
+
keyIdInput.type = 'text'
|
|
146
|
+
keyIdInput.value = device.keyId || ''
|
|
147
|
+
keyIdInput.placeholder = 'e.g. ff'
|
|
148
|
+
keyIdInput.style.width = '100%'
|
|
149
|
+
keyIdInput.style.marginBottom = '12px'
|
|
150
|
+
keyIdInput.style.padding = '8px 10px'
|
|
151
|
+
keyIdInput.style.borderRadius = '6px'
|
|
152
|
+
keyIdInput.style.fontSize = '14px'
|
|
153
|
+
keyIdInput.style.boxSizing = 'border-box'
|
|
154
|
+
|
|
114
155
|
const buttons = document.createElement('div')
|
|
115
156
|
buttons.style.display = 'flex'
|
|
116
157
|
buttons.style.gap = '10px'
|
|
@@ -132,7 +173,8 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
|
|
|
132
173
|
importBtn.style.padding = '8px 20px'
|
|
133
174
|
importBtn.style.fontSize = '13px'
|
|
134
175
|
|
|
135
|
-
|
|
176
|
+
|
|
177
|
+
const cleanup = (result: { configDeviceName: string, configDeviceType: string, address?: string, encryptionKey?: string, keyId?: string } | null) => {
|
|
136
178
|
div.remove()
|
|
137
179
|
resolve(result)
|
|
138
180
|
}
|
|
@@ -142,6 +184,8 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
|
|
|
142
184
|
configDeviceName: nameInput.value || device.name || device.id,
|
|
143
185
|
configDeviceType: typeSelect.value || device.type,
|
|
144
186
|
address: macInput.value || undefined,
|
|
187
|
+
encryptionKey: encryptionKeyInput.value || undefined,
|
|
188
|
+
keyId: keyIdInput.value || undefined,
|
|
145
189
|
})
|
|
146
190
|
|
|
147
191
|
div.addEventListener('click', (event) => {
|
|
@@ -150,6 +194,7 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
|
|
|
150
194
|
}
|
|
151
195
|
})
|
|
152
196
|
|
|
197
|
+
|
|
153
198
|
buttons.appendChild(cancelBtn)
|
|
154
199
|
buttons.appendChild(importBtn)
|
|
155
200
|
contentDiv.appendChild(nameLabel)
|
|
@@ -158,6 +203,10 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
|
|
|
158
203
|
contentDiv.appendChild(typeSelect)
|
|
159
204
|
contentDiv.appendChild(macLabel)
|
|
160
205
|
contentDiv.appendChild(macInput)
|
|
206
|
+
contentDiv.appendChild(encryptionKeyLabel)
|
|
207
|
+
contentDiv.appendChild(encryptionKeyInput)
|
|
208
|
+
contentDiv.appendChild(keyIdLabel)
|
|
209
|
+
contentDiv.appendChild(keyIdInput)
|
|
161
210
|
contentDiv.appendChild(buttons)
|
|
162
211
|
|
|
163
212
|
modal.appendChild(title)
|