code: def _get_battery(self):
          
          try:
              battery = {
                  "charge": self._dev.charge(),
                  "isCharging": self._dev.isCharging() == 1,
              }
          except Exception:
              return None
  
          return battery
docs: Get the battery