Interface Declaration
Import Module
Interface Definition
battery.getStatus(OBJECT)
Obtain the battery information of the current device.
Parameters:
Parameter Name | Type | Required | Description |
success | Function | No | Success callback |
fail | Function | No | Failure callback |
complete | Function | No | Callback after execution ends |
Return Values for success:
Parameter Name | Type | Description |
charging | Boolean | Whether it is currently charging |
level | Number | Current battery level, between 0.0 and 1.0 |
Example
Support Details
Device Product | Description |
Xiaomi S1 Pro Sports Health Watch | Not supported |
Xiaomi Band 8 Pro | Not supported |
Xiaomi Watch S3 | Not supported |
Redmi Watch 4 | Not supported |
Xiaomi Wrist ECG and Blood Pressure Recorder | Not supported |
Xiaomi Watch S4 | Supported |
REDMI Watch 5 | Supported |