foxxyz / loupedeck

Node.js API for Loupedeck Controllers
MIT License
87 stars 10 forks source link

feat: add listDevices method #12

Closed Julusian closed 2 years ago

Julusian commented 2 years ago

Expose a listDevices() method which will list all of the connected devices.

This will make it much easier to handle multiple devices connected to a single machine, without having to write the scanning logic manually.

Example output:

[
  {
    type: 'serial',
    path: '/dev/ttyACM0',
    vendorId: '2ec2',
    productId: '0004',
    serialNumber: 'LDD2001014021480700360B0010'
  }
]

Websocket devices do not provide any additional data, as I do not know where to source it and would not be able to test it

Julusian commented 2 years ago

Regarding the ws devices: You'd have to connect to it in order to retrieve info like serial number, etc, which is kinda annoying. That's probably why they switched to a more standard serial connection the firmware update.

Yeah that is what I was expecting. I did try using my loupedeck on the old firmware at first, but on linux the interface didnt get an ip address, so it was never detected.

I'm ok with not having the extra info on the ws connections.

Perfect. that makes it easy for me :)

In my uses of this library I will probably explicitly not support the old websocket firmware, and so will set ignoreWebsockets: true when calling LoupedeckDevice.list(). Hopefully that will keep it nice and simple and avoid the known issues with their websocket api

foxxyz commented 2 years ago

@Julusian are you still interested in merging this PR?

foxxyz commented 2 years ago

Merged in 2827c89. Thank you for contributing!

Julusian commented 2 years ago

Sorry, Ive been distracted on other things recently. Thanks for finishing this up