Instead of filtering out all the available/connected devices every time it would be good to have a method that returns all the devices of a specific type and get the first available device from a type.
Something like:
// List all available motion sensors
DeviceManager.listMotionSensors()
.then((devices) => {
console.log(devices.lenght, 'motion sensors were found')
});
// Get first available motion sensor
DeviceManager.getMotionSensor()
.then((msk) => {
console.log('motion sensor found');
});
# List all available motion sensors
devices = list_motion_sensors()
# Get first available motion sensor
msk = get_motion_sensor()
Instead of filtering out all the available/connected devices every time it would be good to have a method that returns all the devices of a specific type and get the first available device from a type.
Something like: