code: public double getLevel() {
          final Object value = getInput().get("level");
          if (value instanceof Long) {
              return ((Long) value).doubleValue();
          }
          return (double) value;
      }
docs: Returns battery level.
  
  @return Battery level in range [0.0, 1.0], where 1.0 means 100% charge.