System attributes

System information is represented as system attributes. Each system attribute consists of an entity and a key. The entity broadly represents a device component or feature, such as battery or connectivity. The key is an attribute of the entity. Entities can have multiple keys, with each entity-key pair representing a single system attribute. For example, battery strength and charging status are attributes of battery. The system attributes for these are Battery - BatteryStrength and Battery - ChargingStatus, respectively (see Table: Battery system attributes). Each system attribute has a value that contains data about the attribute. For some system attributes, the value can be modified.

For more information about the supported system attributes, see section Supported system attributes (entities and keys).

For more information about the system data types that determine system attribute values, see section System data types.

In JavaScript, a system attribute is represented as an object, with the entity, key, and value as properties of that object:

Table: System attribute object

Property

Description

Type

Value

Entity

Specifies the entity of the system attribute.

Together with Key, this specifies the system attribute.

string

For a complete list of supported entities, see section Supported system attributes (entities and keys).

Key

Specifies the key of the system attribute. The available keys depend on the entity.

Together with Entity, this specifies the system attribute.

string

For a complete list of supported keys per entity, see the Key column of the tables in section Supported system attributes (entities and keys).

<Value>

Specifies the value of the system attribute.

The name, type, and content of this property depend on the system attribute and whether the system attribute object is used as input or output:

INPUT

If the system attribute object is used as input for a method call, this property is an object named SystemData. The actual system attribute value is represented as one or more properties of the SystemData object. The exact set of properties depends on the specific system attribute and its system data type for input.

For example: If you input the Battery - BatteryStrength system attribute, whose input data type is Status, the criteria argument takes the following properties:

  • criteria.Entity

  • criteria.Key

  • criteria.SystemData.Status

Here, criteria is the input object representing the system attribute, SystemData is the object containing the system attribute value, and Status is the object property specifying the actual value (as defined by the system data type).

Similarly, if you input the Memory - DriveInfo system attribute, whose input data type is DriveInfo, the criteria argument takes the following properties:

  • criteria.Entity

  • criteria.Key

  • criteria.SystemData.Drive

  • criteria.SystemData.<...> (other properties associated with DriveInfo)

OUTPUT

If the system attribute object is received as output from a method call, the system attribute value is represented as one or more properties of the ReturnValue object returned by the call. The exact set of properties depends on the specific system attribute and its system data type for output.

For example: If the Battery - BatteryStrength system attribute, whose output data type is Status, is received as output, the ReturnValue object contains the following properties:

  • ReturnValue.Entity

  • ReturnValue.Key

  • ReturnValue.Status

Here, ReturnValue is the output object representing the system attribute, and Status is the object property specifying the system attribute value (as defined by the system data type).

Similarly, if the Memory - DriveInfo system attribute, whose output data type is DriveInfo, is received as output, the ReturnValue object contains the following properties:

  • ReturnValue.Entity

  • ReturnValue.Key

  • ReturnValue.Drive

  • ReturnValue.TotalSpace

  • ReturnValue.FreeSpace

  • ReturnValue.CriticalSpace

  • ReturnValue.MediaType

  • ReturnValue.BatteryState

  • ReturnValue.DriveName

 

See the Input and Output columns of the tables in section Supported system attributes (entities and keys).