-api-id | -api-type |
---|---|
M:Windows.Devices.Power.Battery.FromIdAsync(System.String) |
winrt method |
Gets a Battery object that represents an individual battery controller connected to the device.
The device ID of the battery controller (DeviceId).
A Battery object that corresponds to the specified battery controller.
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