From 5360092de93cea9e041e1c27618e53981d15d24c Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Thu, 21 Nov 2024 17:30:42 +0100 Subject: [PATCH] Add support for displaying unknown devices --- assets/boards/Generic Device.svg | 102 +++++++++++++++++++++++++++++++ main.js | 3 +- renderer.js | 8 ++- 3 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 assets/boards/Generic Device.svg diff --git a/assets/boards/Generic Device.svg b/assets/boards/Generic Device.svg new file mode 100644 index 0000000..b9126d4 --- /dev/null +++ b/assets/boards/Generic Device.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main.js b/main.js index 9769a71..a3ced3d 100644 --- a/main.js +++ b/main.js @@ -66,7 +66,8 @@ ipcMain.handle('get-packages', async () => { ipcMain.handle('get-boards', async () => { const boardManager = new upyPackage.DeviceManager(); try { - return await boardManager.getConnectedDevices(ARDUINO_VID); + // Pass ARDUINO_VID to filter for Arduino boards + return await boardManager.getConnectedDevices(); } catch (error) { console.error('Failed to fetch boards:', error); return []; diff --git a/renderer.js b/renderer.js index 0b6fa52..836fc81 100644 --- a/renderer.js +++ b/renderer.js @@ -75,7 +75,13 @@ function selectDevice(deviceItem) { } function createDeviceSelectorItem(device, showPort) { - const fullDeviceName = device.manufacturer + " " + device.name; + let fullDeviceName; + + if(device.name == "Generic Device"){ + fullDeviceName = device.name; + } else { + fullDeviceName = `${device.manufacturer} ${device.name}`; + } const deviceItem = document.createElement("button"); deviceItem.classList.add("selection-item");