This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user