DevicePowerPowerState.fromJson constructor

DevicePowerPowerState.fromJson(
  1. Map<String, dynamic> dataMap
)

Creates a DevicePowerPowerState object from the JSON response to a GET request.

Implementation

factory DevicePowerPowerState.fromJson(Map<String, dynamic> dataMap) {
  return DevicePowerPowerState(
    batteryState: dataMap[ApiFields.batteryState] ?? "",
    batteryLevel: dataMap[ApiFields.batteryLevel] ?? 0,
  );
}