The Environment object includes eight new properties for determining the status of the device battery or power source. The following table lists and describes these properties.
Environment object property |
Datatype |
Description |
---|---|---|
PowerBatteryCharging |
Boolean |
Indicates whether the battery is being charged. |
PowerBatteryDataValid |
Boolean |
Indicates whether the values for PowerBatteryCharging, PowerBatteryFlags, PowerBatteryLifeRemaining, and PowerBatteryPercentage are valid. Values are:
|
PowerBatteryFlags |
ULong |
Reports the device battery charge status flags. Values and their meanings are: Combinations of the above values are possible. For example, a value of 10 would mean that the battery has a low charge state but is also currently charging. |
PowerBatteryLifeRemaining |
ULong |
Estimated battery life remaining in seconds. |
PowerBatteryPercentage |
Integer |
Percentage of full battery charge remaining. |
PowerLineBackup |
Boolean |
Device is on backup power. |
PowerLineDataValid |
Boolean |
Determines whether the values for PowerLineOn and PowerLineBackup are valid. Values are:
|
PowerLineOn |
Boolean |
Device is plugged in to main power source. |
For more information, see GetEnvironment and the Environment object in the online Help.