Page 1 of 1

Feature Request: is device found

Posted: 05 Jun 2016, 11:02
by Scratch
Should return a boolean if a device exists / set to a name

My use case is that I have a keypad that changes ID every time I switch it's port.
I want to be able to check to see that the device is set up correctly on macro start

for example

Code: Select all

lmc_device_set_name('kp', '12AAE65F') --Set Device

if (!lmc_device_exists('kp')) then --Check if it did not work
lmc_print_devices() --so print out our list
lmc.minimizeToTray = false

end
unsure if you want to allow it to also take the device id

Re: Feature Request: is device found

Posted: 06 Jun 2016, 08:25
by admin
AFAIR function lmc_device_set_name returns string with real device name so I assume it return empty value if device is not found. This should solve your problem, please try.

Re: Feature Request: is device found

Posted: 08 Jun 2016, 10:46
by Scratch
Perfect, managed to get it done with

Code: Select all

kp = lmc_device_set_name('kp', '25649703')

if (kp == "") then 
lmc_assign_keyboard('kp')  
I don't suppose you could add this functionality to the lmc_assign_keyboard function?
would save me having to list every device and instead just popping out what devices need configuring in the buffer

Re: Feature Request: is device found

Posted: 09 Jun 2016, 08:47
by admin
Could be done, noted...