Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.25 KB

battery_fromidasync_1322863552.md

File metadata and controls

30 lines (21 loc) · 1.25 KB
-api-id -api-type
M:Windows.Devices.Power.Battery.FromIdAsync(System.String)
winrt method

Windows.Devices.Power.Battery.FromIdAsync

-description

Gets a Battery object that represents an individual battery controller connected to the device.

-parameters

-param deviceId

The device ID of the battery controller (DeviceId).

-returns

A Battery object that corresponds to the specified battery controller.

-remarks

FromIdAsync will return null if the battery controller does not exist and the deviceId value is well-formed. If the deviceId value is not well-formed, such as "AggregateBattery," then the method will fail with STATUS_OBJECT_NAME_INVALID.

You can use a DeviceInformation object for a battery controller to use that object's Id property value as the deviceId parameter in FromIdAsync to create a Battery object

-examples

-see-also

Get battery information