fromValue static method

POWER_ACTION fromValue(
  1. int value
)

Implementation

static POWER_ACTION fromValue(int value) => switch (value) {
      0 => PowerActionNone,
      1 => PowerActionReserved,
      2 => PowerActionSleep,
      3 => PowerActionHibernate,
      4 => PowerActionShutdown,
      5 => PowerActionShutdownReset,
      6 => PowerActionShutdownOff,
      7 => PowerActionWarmEject,
      8 => PowerActionDisplayOff,
      _ => throw ArgumentError('Unknown value for POWER_ACTION: $value'),
    };