Link Search Menu Expand Document

Root.GetPowerState Property

Explanation Gets the AC Power and battery status.
Can only be used with Mobile and AI
Only supported since Mobile Ver.3.2.1, AI Ver.1.0.0
Call format var state = //.GetPowerState( )
Return value Returns a Record object with the following child objects :
Type Name Description
Number ACPower -1: Unknown, 0: No power connection, 1: Power connection
Number BatteryLifeLevel -1: unknown, 0 ( minimum ) to 100 ( maximum )
Number BatteryLifeTime -1: Unknown, 0 or more : Time remaining ( seconds )
Arguments None
Exception None
Example of use
    var state = //.GetPowerState();
    if (state.BatteryLifeLevel >= 0) {
        print("Battery level ", state.BatteryLifeLevel, "%\n");
    }
    
Related item