PowerUtils

PowerUtils

Functions

Functions

getBatteryIconName ()


getBatteryIconName (percentage,
                    state);

Returns the appropriate xsi-battery-level icon name for the given battery percentage and charging state.

Parameters

percentage

battery percentage (0-100)

 

state

UPDeviceState value

 

deviceLevelToString ()


deviceLevelToString (level);

Returns a human-readable string describing the battery level.

Parameters

level

UPDeviceLevel value

 

deviceKindToString ()


deviceKindToString (kind);

Returns a human-readable string describing the device type.

Parameters

kind

UPDeviceKind value

 

deviceKindToIcon ()


deviceKindToIcon (kind,
                  fallbackIcon);

Returns an icon name appropriate for the device kind.

Parameters

kind

UPDeviceKind value

 

fallbackIcon

icon name to use if no specific icon for this device kind

 

reportsPreciseLevels ()


reportsPreciseLevels (batteryLevel);

Returns true if the device reports precise percentage levels (battery_level == NONE indicates percentage reporting is available).

Parameters

batteryLevel

UPDeviceLevel value