Home: https://github.com/asmagill/mjolnir_asm.sys
Functions for getting battery info. All functions here may return nil, if the information requested is not available.
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
mjolnir._asm.sys.battery.amperage() -> number
Returns the amperage of the battery in mA. (will be negative if battery is discharging)
mjolnir._asm.sys.battery.capacity() -> number
Returns the current capacity of the battery in mAh.
mjolnir._asm.sys.battery.cycles() -> number
Returns the number of cycles the connected battery has went through.
mjolnir._asm.sys.battery.designcapacity() -> number
Returns the design capacity of the battery in mAh.
mjolnir._asm.sys.battery.get_all() -> table
Iterates through all informational functions defined in this module and returns a table containing the current information. Useful if you want more than one piece of information at a given time.
mjolnir._asm.sys.battery.health() -> string
Returns the health status of the battery. One of {Good, Fair, Poor}
mjolnir._asm.sys.battery.healthcondition() -> string
Returns the health condition status of the battery. One of {Check Battery, Permanent Battery Failure}. Nil if there is no health condition set.
mjolnir._asm.sys.battery.ischarged() -> boolean
Returns true if battery is charged.
mjolnir._asm.sys.battery.ischarging() -> boolean
Returns true if the battery is charging.
mjolnir._asm.sys.battery.isfinishingcharge() -> boolean
Returns true if battery is finishing charge.
mjolnir._asm.sys.battery.maxcapacity() -> number
Returns the current maximum capacity of the battery in mAh.
mjolnir._asm.sys.battery.name() -> string
Returns the name of the battery.
mjolnir._asm.sys.battery.percentage() -> number
Returns the current percentage of the battery between 0 and 100.
mjolnir._asm.sys.battery.powersource() -> boolean
Returns current source of power. One of {AC Power, Battery Power, Off Line}.
mjolnir._asm.sys.battery.timeremaining() -> number
Returns the time remaining in minutes. Or a negative value: -1 = calculating time remaining, -2 = unlimited (i.e. you're charging, or apple has somehow discovered an infinite power source.)
mjolnir._asm.sys.battery.timetofullcharge() -> number
Returns the time remaining to a full charge in minutes. Or a negative value, -1 = calculating time remaining.
mjolnir._asm.sys.battery.voltage() -> number
Returns the voltage flow of the battery in mV.
mjolnir._asm.sys.battery.watts() -> number
Returns the watts into or out of the battery in Watt (will be negative if battery is discharging)