Class: Toybox.System.Stats

Inherits:
Toybox.Lang.Object show all

Overview

Represents various statistics available on a device, such as the battery charge and memory use.

See Also:

Example:

using Toybox.System;
var myStats = System.getSystemStats();
System.println(myStats.battery);
System.println(myStats.totalMemory);

Since:

API Level 1.0.0

Instance Member Summary collapse

Instance Attribute Details

var battery as Lang.Float

The remaining battery life as a percentage.

Note:

Some devices may report slightly less than 100% charge immediately after being removed from the charging cradle or cable. While the device is on the charger, the charger will disable itself after the battery charges to 100%. The battery will then very slowly discharge until it hits a hysteresis threshold, at which point the charger will reactivate. This is intentionally done to extend the life of the battery if the device is left on the charger for a long time. Garmin artificially locks the charge indicator on the charge page to 100% once the unit reaches full charge to mask this minor charge cycle fluctuation.

Since:

API Level 1.0.0

Returns:

var batteryInDays as Lang.Float

The remaining battery life in days.

Since:

API Level 3.3.0

Supported Devices:

Returns:

var charging as Lang.Boolean

Battery charging indicator. This will be set to true if the device is connected to the charging cradle or cable whether or not the device is fully charged.

Since:

API Level 3.0.0

See Also:

Returns:

var freeMemory as Lang.Number

The current free memory in bytes.

Since:

API Level 1.0.0

Returns:

var solarIntensity as Lang.Number or Null

A Toybox::Lang::Number value from 0-100 that describes the solar sensor's charge efficiency, if available. Will be set to null if the device doesn't support solar or a negative number when the device is not currently charging.

Since:

API Level 3.2.0

Returns:

var totalMemory as Lang.Number

The total available memory in bytes.

Since:

API Level 1.0.0

Returns:

var usedMemory as Lang.Number

The memory used by the application in bytes.

Since:

API Level 1.0.0

Returns:


Generated Apr 17, 2024 9:40:38 AM