Class LinuxPowerSource
java.lang.Object
oshi.hardware.common.AbstractPowerSource
oshi.hardware.common.platform.linux.LinuxPowerSource
- All Implemented Interfaces:
PowerSource
A Power Source
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumPower supply uevent properties from sysfs.Nested classes/interfaces inherited from interface PowerSource
PowerSource.CapacityUnits -
Constructor Summary
ConstructorsModifierConstructorDescriptionLinuxPowerSource(String psName, String psDeviceName, double psRemainingCapacityPercent, double psTimeRemainingEstimated, double psTimeRemainingInstant, double psPowerUsageRate, double psVoltage, double psAmperage, boolean psPowerOnLine, boolean psCharging, boolean psDischarging, PowerSource.CapacityUnits psCapacityUnits, int psCurrentCapacity, int psMaxCapacity, int psDesignCapacity, int psCycleCount, String psChemistry, LocalDate psManufactureDate, String psManufacturer, String psSerialNumber, double psTemperature) Creates a LinuxPowerSource with the given parameters.protectedCopy constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static LinuxPowerSourcebuildPowerSource(String name, Map<LinuxPowerSource.Prop, String> props) Builds a LinuxPowerSource from parsed uevent properties.static List<PowerSource> Gets Battery Informationprotected List<PowerSource> Returns a fresh list of power sources for this platform, used byAbstractPowerSource.updateAttributes().Methods inherited from class AbstractPowerSource
getAmperage, getCapacityUnits, getChemistry, getCurrentCapacity, getCycleCount, getDesignCapacity, getDeviceName, getManufactureDate, getManufacturer, getMaxCapacity, getName, getPowerUsageRate, getRemainingCapacityPercent, getSerialNumber, getTemperature, getTimeRemainingEstimated, getTimeRemainingInstant, getVoltage, isCharging, isDischarging, isPowerOnLine, toString, updateAttributes
-
Constructor Details
-
LinuxPowerSource
public LinuxPowerSource(String psName, String psDeviceName, double psRemainingCapacityPercent, double psTimeRemainingEstimated, double psTimeRemainingInstant, double psPowerUsageRate, double psVoltage, double psAmperage, boolean psPowerOnLine, boolean psCharging, boolean psDischarging, PowerSource.CapacityUnits psCapacityUnits, int psCurrentCapacity, int psMaxCapacity, int psDesignCapacity, int psCycleCount, String psChemistry, LocalDate psManufactureDate, String psManufacturer, String psSerialNumber, double psTemperature) Creates a LinuxPowerSource with the given parameters.- Parameters:
psName- power source namepsDeviceName- device namepsRemainingCapacityPercent- remaining capacity percentagepsTimeRemainingEstimated- estimated time remainingpsTimeRemainingInstant- instant time remainingpsPowerUsageRate- power usage ratepsVoltage- voltagepsAmperage- amperagepsPowerOnLine- whether on AC powerpsCharging- whether chargingpsDischarging- whether dischargingpsCapacityUnits- capacity unitspsCurrentCapacity- current capacitypsMaxCapacity- max capacitypsDesignCapacity- design capacitypsCycleCount- cycle countpsChemistry- chemistrypsManufactureDate- manufacture datepsManufacturer- manufacturerpsSerialNumber- serial numberpsTemperature- temperature
-
LinuxPowerSource
Copy constructor.- Parameters:
src- the source to copy from
-
-
Method Details
-
queryPowerSources
Description copied from class:AbstractPowerSourceReturns a fresh list of power sources for this platform, used byAbstractPowerSource.updateAttributes(). Each concrete subclass implements this by delegating to its own staticgetPowerSources()factory method.- Specified by:
queryPowerSourcesin classAbstractPowerSource- Returns:
- A list of PowerSource objects representing batteries, etc.
-
getPowerSources
Gets Battery Information- Returns:
- An array of PowerSource objects representing batteries, etc.
-
buildPowerSource
protected static LinuxPowerSource buildPowerSource(String name, Map<LinuxPowerSource.Prop, String> props) Builds a LinuxPowerSource from parsed uevent properties.- Parameters:
name- the power supply nameprops- the parsed properties map- Returns:
- a new LinuxPowerSource instance
-