Closed patrick-dmxc closed 2 years ago
Yea that's true. I'm aready working on that (as described here)
Hi. If you are still interested in a better way of discovering new devices you can check out v4.0.0-preview.
You can now create a DeviceContext
which basically collects events from "device listeners" (IObservable<DeviceStateReport>
) to generate a collection of known devices.
// ## create a new device context and register some listeners
using var deviceDiscoveryContext = DeviceContext.Create()
.AddListener<StreamDeckListener>()
.AddListener(new SocketIOBoardListener(IPAddress.Loopback));
// ## A few options to open a device:
// Get it from the KnownDevices list
using var device1 = deviceDiscoveryContext.KnownDevices[0].Open();
// Wait for a device with a custom condition
using var device2 = await deviceDiscoveryContext.OpenAsync(r => r.Keys.Count == 15, default);
// Subscribe to device events to do other custom stuff
using var sub = deviceDiscoveryContext.DeviceStateReports.Subscribe(YourEventHandler);
static void YourEventHandler(DeviceStateReport report)
{
// ...
}
Note that v4 is a breaking change but it should be straightforward to migrate
At the moment i have to discover every diferent Macroboard by my selve
Whats missing is a static Methode which returns all Availlable IMacroBoards