homebridge-midea-platform 1.2.6-beta.8 → 1.2.6-beta.9
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.
|
@@ -199,6 +199,7 @@
|
|
|
199
199
|
createForm(configSchema, configuration);
|
|
200
200
|
homebridge.hideSpinner();
|
|
201
201
|
|
|
202
|
+
const main = document.getElementById('main');
|
|
202
203
|
const loginSection = document.getElementById('login')
|
|
203
204
|
const userPass = document.getElementById('userPass');
|
|
204
205
|
|
|
@@ -304,11 +305,13 @@
|
|
|
304
305
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
305
306
|
</div>
|
|
306
307
|
<div class="modal-body">
|
|
307
|
-
<div class="mb-3">
|
|
308
|
-
<
|
|
309
|
-
|
|
308
|
+
<div class="mb-3 btn-toolbar">
|
|
309
|
+
<div class="btn-group me-2">
|
|
310
|
+
<button id="selectAllLuaBtn" class="btn btn-secondary">Select All</button>
|
|
311
|
+
</div>
|
|
312
|
+
<small class="text-warning ms-2 align-self-center">Save this as ${device.type.toString(16)}_${device.model}.lua</small>
|
|
310
313
|
</div>
|
|
311
|
-
<pre style="
|
|
314
|
+
<pre id="luaCodePre"><code style="color: var(--bs-body-color);">${file_data_str}</code></pre>
|
|
312
315
|
</div>
|
|
313
316
|
<div class="modal-footer">
|
|
314
317
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
@@ -317,25 +320,25 @@
|
|
|
317
320
|
</div>
|
|
318
321
|
`;
|
|
319
322
|
|
|
320
|
-
|
|
323
|
+
main.appendChild(modal);
|
|
321
324
|
|
|
322
325
|
// Initialize the Bootstrap modal
|
|
323
326
|
const bootstrapModal = new bootstrap.Modal(modal);
|
|
324
327
|
bootstrapModal.show();
|
|
325
328
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
329
|
+
document.getElementById('selectAllLuaBtn').addEventListener('click', () => {
|
|
330
|
+
const codeElement = document.getElementById('luaCodePre');
|
|
331
|
+
const selection = window.getSelection();
|
|
332
|
+
const range = document.createRange();
|
|
333
|
+
|
|
334
|
+
range.selectNodeContents(codeElement);
|
|
335
|
+
selection.removeAllRanges();
|
|
336
|
+
selection.addRange(range);
|
|
334
337
|
});
|
|
335
338
|
|
|
336
339
|
// Clean up when modal is hidden
|
|
337
340
|
modal.addEventListener('hidden.bs.modal', () => {
|
|
338
|
-
|
|
341
|
+
main.removeChild(modal);
|
|
339
342
|
});
|
|
340
343
|
|
|
341
344
|
homebridge.hideSpinner();
|
package/homebridge-ui/server.js
CHANGED
|
@@ -253,8 +253,10 @@ class UiServer extends HomebridgePluginUiServer {
|
|
|
253
253
|
msg: 'Start device discovery',
|
|
254
254
|
});
|
|
255
255
|
// If IP addresses provided then probe them directly
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
if (ipAddrs && ipAddrs.length > 0) {
|
|
257
|
+
for (const ip of ipAddrs) {
|
|
258
|
+
discover.discoverDeviceByIP(ip);
|
|
259
|
+
}
|
|
258
260
|
}
|
|
259
261
|
// And then send broadcast to network(s)
|
|
260
262
|
discover.startDiscover();
|
package/package.json
CHANGED