class OpenBsdPowerSource extends AbstractPowerSource {

    public OpenBsdPowerSource(String psName, String psDeviceName, double psRemainingCapacityPercent,
            double psTimeRemainingEstimated, double psTimeRemainingInstant, double psPowerUsageRate, double psVoltage,
            double psAmperage, boolean psPowerOnLine, boolean psCharging, boolean psDischarging,
            CapacityUnits psCapacityUnits, int psCurrentCapacity, int psMaxCapacity, int psDesignCapacity,
            int psCycleCount, String psChemistry, LocalDate psManufactureDate, String psManufacturer,
            String psSerialNumber, double psTemperature) {
        super(psName, psDeviceName, psRemainingCapacityPercent, psTimeRemainingEstimated, psTimeRemainingInstant,
                psPowerUsageRate, psVoltage, psAmperage, psPowerOnLine, psCharging, psDischarging, psCapacityUnits,
                psCurrentCapacity, psMaxCapacity, psDesignCapacity, psCycleCount, psChemistry, psManufactureDate,
                psManufacturer, psSerialNumber, psTemperature);
    }

    /**
     * Gets Battery Information
     *
     * @return An array of PowerSource objects representing batteries, etc.
     */
    public static List<PowerSource> getPowerSources() {
        Set<String> psNames = new HashSet<>();
        for (String line : ExecutingCommand.runNative("systat -ab sensors")) {
            if (line.contains(".amphour") || line.contains(".watthour")) {
                int dot = line.indexOf('.');
                psNames.add(line.substring(0, dot));
            }
        }
        List<PowerSource> psList = new ArrayList<>();
        for (String name : psNames) {
            psList.add(getPowerSource(name));
        }
        return psList;
    }

    private static OpenBsdPowerSource getPowerSource(String name) {<FILL_FUNCTION_BODY>}
}

        String psName = name.startsWith("acpi") ? name.substring(4) : name;
        double psRemainingCapacityPercent = 1d;
        double psTimeRemainingEstimated = -1d; // -1 = unknown, -2 = unlimited
        double psPowerUsageRate = 0d;
        double psVoltage = -1d;
        double psAmperage = 0d;
        boolean psPowerOnLine = false;
        boolean psCharging = false;
        boolean psDischarging = false;
        CapacityUnits psCapacityUnits = CapacityUnits.RELATIVE;
        int psCurrentCapacity = 0;
        int psMaxCapacity = 1;
        int psDesignCapacity = 1;
        int psCycleCount = -1;
        LocalDate psManufactureDate = null;

        double psTemperature = 0d;

        for (String line : ExecutingCommand.runNative("systat -ab sensors")) {
            String[] split = ParseUtil.whitespaces.split(line);
            if (split.length > 1 && split[0].startsWith(name)) {
                if (split[0].contains("volt0") || split[0].contains("volt") && line.contains("current")) {
                    psVoltage = ParseUtil.parseDoubleOrDefault(split[1], -1d);
                } else if (split[0].contains("current0")) {
                    psAmperage = ParseUtil.parseDoubleOrDefault(split[1], 0d);
                } else if (split[0].contains("temp0")) {
                    psTemperature = ParseUtil.parseDoubleOrDefault(split[1], 0d);
                } else if (split[0].contains("watthour") || split[0].contains("amphour")) {
                    psCapacityUnits = split[0].contains("watthour") ? CapacityUnits.MWH : CapacityUnits.MAH;
                    if (line.contains("remaining")) {
                        psCurrentCapacity = (int) (1000d * ParseUtil.parseDoubleOrDefault(split[1], 0d));
                    } else if (line.contains("full")) {
                        psMaxCapacity = (int) (1000d * ParseUtil.parseDoubleOrDefault(split[1], 0d));
                    } else if (line.contains("new") || line.contains("design")) {
                        psDesignCapacity = (int) (1000d * ParseUtil.parseDoubleOrDefault(split[1], 0d));
                    }
                }
            }
        }

        int state = ParseUtil.parseIntOrDefault(ExecutingCommand.getFirstAnswer("apm -b"), 255);
        // state 0=high, 1=low, 2=critical, 3=charging, 4=absent, 255=unknown
        if (state < 4) {
            psPowerOnLine = true;
            if (state == 3) {
                psCharging = true;
            } else {
                int time = ParseUtil.parseIntOrDefault(ExecutingCommand.getFirstAnswer("apm -m"), -1);
                // time is in minutes
                psTimeRemainingEstimated = time < 0 ? -1d : 60d * time;
                psDischarging = true;
            }
        }
        // life is in percent
        int life = ParseUtil.parseIntOrDefault(ExecutingCommand.getFirstAnswer("apm -l"), -1);
        if (life > 0) {
            psRemainingCapacityPercent = life / 100d;
        }
        if (psMaxCapacity < psDesignCapacity && psMaxCapacity < psCurrentCapacity) {
            psMaxCapacity = psDesignCapacity;
        } else if (psDesignCapacity < psMaxCapacity && psDesignCapacity < psCurrentCapacity) {
            psDesignCapacity = psMaxCapacity;
        }

        String psDeviceName = Constants.UNKNOWN;
        String psSerialNumber = Constants.UNKNOWN;
        String psChemistry = Constants.UNKNOWN;
        String psManufacturer = Constants.UNKNOWN;

        double psTimeRemainingInstant = psTimeRemainingEstimated;
        if (psVoltage > 0) {
            if (psAmperage > 0 && psPowerUsageRate == 0) {
                psPowerUsageRate = psAmperage * psVoltage;
            } else if (psAmperage == 0 && psPowerUsageRate > 0) {
                psAmperage = psPowerUsageRate / psVoltage;
            }
        }

        return new OpenBsdPowerSource(psName, psDeviceName, psRemainingCapacityPercent, psTimeRemainingEstimated,
                psTimeRemainingInstant, psPowerUsageRate, psVoltage, psAmperage, psPowerOnLine, psCharging,
                psDischarging, psCapacityUnits, psCurrentCapacity, psMaxCapacity, psDesignCapacity, psCycleCount,
                psChemistry, psManufactureDate, psManufacturer, psSerialNumber, psTemperature);
    
<methods>public double getAmperage() ,public oshi.hardware.PowerSource.CapacityUnits getCapacityUnits() ,public java.lang.String getChemistry() ,public int getCurrentCapacity() ,public int getCycleCount() ,public int getDesignCapacity() ,public java.lang.String getDeviceName() ,public java.time.LocalDate getManufactureDate() ,public java.lang.String getManufacturer() ,public int getMaxCapacity() ,public java.lang.String getName() ,public double getPowerUsageRate() ,public double getRemainingCapacityPercent() ,public java.lang.String getSerialNumber() ,public double getTemperature() ,public double getTimeRemainingEstimated() ,public double getTimeRemainingInstant() ,public double getVoltage() ,public boolean isCharging() ,public boolean isDischarging() ,public boolean isPowerOnLine() ,public java.lang.String toString() ,public boolean updateAttributes() <variables>private double amperage,private oshi.hardware.PowerSource.CapacityUnits capacityUnits,private boolean charging,private java.lang.String chemistry,private int currentCapacity,private int cycleCount,private int designCapacity,private java.lang.String deviceName,private boolean discharging,private java.time.LocalDate manufactureDate,private java.lang.String manufacturer,private int maxCapacity,private java.lang.String name,private boolean powerOnLine,private double powerUsageRate,private double remainingCapacityPercent,private java.lang.String serialNumber,private double temperature,private double timeRemainingEstimated,private double timeRemainingInstant,private double voltage