parse static method

Given a hotspot mode from JSON, return the enumerated value.

Throws HeliumException if the mode is not recognized.

Implementation

static HeliumHotspotMode parse(String s) {
  final mode = _lookup[s];

  if (mode != null) {
    return mode;
  }

  throw HeliumException('Unknown hotspot mode "$s"');
}