getDeviceFromRoleName method

DeviceConfiguration<DeviceRegistration>? getDeviceFromRoleName(
  1. String roleName
)

The primary or connected device with roleName, or null if not found.

Implementation

DeviceConfiguration? getDeviceFromRoleName(String roleName) {
  try {
    return devices.firstWhere((device) => device.roleName == roleName);
  } catch (_) {
    return null;
  }
}