manual add button
Build Images and Deploy / Update-PROD-Stack (push) Successful in 18s

This commit is contained in:
2026-03-30 22:10:30 -04:00
parent 0977a610ff
commit 70c98af759
2 changed files with 89 additions and 0 deletions
+4
View File
@@ -94,6 +94,10 @@ async function handleRequest(req, res) {
if (url === '/api/devices/discover' && method === 'POST') {
const saved = store.getDevices();
const manual = saved.map((d) => ({ host: d.host, port: d.port }));
// Add any manual entries from the request body
if (body.manualEntries && Array.isArray(body.manualEntries)) {
manual.push(...body.manualEntries);
}
const devs = await wemo.discoverDevices(8000, manual);
store.saveDevices(devs);
return json(res, devs);