parseDeviceState function

DeviceState parseDeviceState(
  1. String state
)

Implementation

DeviceState parseDeviceState(String state) {
  final lower = state.toLowerCase();
  return DeviceState.values.firstWhere(
    (e) => e.name == lower,
    orElse: () => DeviceState.unregistered,
  );
}