Battery constructor

Battery(
  1. dynamic battery
)

Implementation

Battery(dynamic battery) {
  this.isCharging = battery['is_charging'];
  this.level = battery['level'] * 1.0;
}