PowerSourceImpl

class PowerSourceImpl(val powerSourceInfo: PowerSource) : PowerSource

Implementation of the PowerSource interface. This class provides details about a power source, including its name, device name, capacity, voltage, amperage, and more. It also offers methods for accessing information about the power source's status, such as whether it is charging or discharging, as well as the estimated remaining time for use.

Author

N7ghtm4r3

Parameters

powerSourceInfo

The PowerSource object containing the actual power source data retrieved from the hardware.

See also

Constructors

Link copied to clipboard
constructor(powerSourceInfo: PowerSource)

Properties

Link copied to clipboard
open override val amperage: Double

amperage The amperage of the power source in amperes

Link copied to clipboard
open override val capacityUnits: CapacityUnits

capacityUnits The capacity units of the power source (e.g., "mWh", "Wh")

Link copied to clipboard
open override val chemistry: String

chemistry The chemistry of the power source (e.g., "Li-ion", "Li-Po")

Link copied to clipboard
open override val currentCapacity: Int

currentCapacity The current capacity of the power source in the given capacity units

Link copied to clipboard
open override val cycleCount: Int

cycleCount The cycle count of the power source, representing the number of charge-discharge cycles

Link copied to clipboard
open override val designCapacity: Int

designCapacity The design capacity of the power source in the given capacity units

Link copied to clipboard
open override val deviceName: String

deviceName The device name of the power source (e.g., "BAT0", "AC")

Link copied to clipboard
open override val isCharging: Boolean

isCharging Whether the power source is currently charging

Link copied to clipboard
open override val isDischarging: Boolean

isDischarging Whether the power source is currently discharging

Link copied to clipboard
open override val isPowerOnLine: Boolean

isPowerOnLine Whether the power source is currently connected to the power line (e.g., AC power)

Link copied to clipboard
open override val manufacturer: String

manufacturer The manufacturer of the power source (e.g., "Samsung", "LG")

Link copied to clipboard
open override val maxCapacity: Int

maxCapacity The maximum capacity of the power source in the given capacity units

Link copied to clipboard
open override val name: String

name The name of the power source (e.g., "Battery 1")

Link copied to clipboard
private val powerSourceInfo: PowerSource
Link copied to clipboard
open override val powerUsageRate: Double

powerUsageRate The current power usage rate of the power source in watts

Link copied to clipboard
open override val remainingCapacityPercent: Double

remainingCapacityPercent The remaining battery capacity as a percentage of the total capacity (0-100%)

Link copied to clipboard
open override val serialNumber: String

serialNumber The serial number of the power source

Link copied to clipboard
open override val temperature: Double

temperature The temperature of the power source in Celsius

Link copied to clipboard
open override val timeRemainingEstimated: Double

timeRemainingEstimated The estimated time remaining on the power source, in minutes

Link copied to clipboard
open override val timeRemainingInstant: Double

timeRemainingInstant The instantaneous time remaining on the power source, in minutes

Link copied to clipboard
open override val updateAttributes: Boolean

updateAttributes Whether the attributes of the power source have been updated

Link copied to clipboard
open override val voltage: Double

voltage The voltage of the power source in volts

Functions

Link copied to clipboard

Returns the manufacture date of the power source