fromString static method

DeviceState fromString(
  1. String raw
)

Implementation

static DeviceState fromString(String raw) {
  return switch (raw.toLowerCase()) {
    'booted' || 'running' => booted,
    'booting' => booting,
    _ => shutdown,
  };
}