Closed azuwis closed 5 months ago
Thank you for creating the PR
I think it would be better to search both lists, first paired, then recent devices (maybe easiest is to concat arrays to not do it separately). Please update documentaation describing the search by name (line starting with "ID can be either address"). I think it resolves #62, but not #58 - only addresses are used in all commands
@toy Please review the new changes.
Nice
I think it will be better to still show a separate error if there are no paired or recent devices, it will fail anyway, but error about empty list is more precise than one about not being able to find a device by name.
Also please run ./update_usage
(to copy the change in help to readme) and add an entry to CHANGELOG.md
@toy Done.
I think it is still better to print error and exit if searchDevices
is empty, not just show a warning if one of pairedDevices
and recentDevices
is nil. As is, if recent devices returns nil, but there are paired devices and there is a device by searched name, there will be a probably confusing warning message, but finding device will succeed. Sorry if I was not clear enough in previous message.
Wanted to merge, but realised that you didn't add an entry to CHANGELOG.md, please write something following examples and please link there both this PR and the issue #62
@azuwis Thank you
IOBluetoothDevice.recentDevices return empty list in macOS Monterey and later, also search paired devices to make
--info "BY NAME" --connect "BY NAME" --disconnect "BY NAME" ...
work again.
Fix #62