# powermgr_powermgr_lite **Repository Path**: silence2455/powermgr_powermgr_lite ## Basic Information - **Project Name**: powermgr_powermgr_lite - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 97 - **Created**: 2021-04-13 - **Last Updated**: 2021-06-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Power Manager - [Introduction](#section11660541593) - [Directory Structure](#section19472752217) - [Usage](#section146636391856) - [Available APIs](#section481251394) - [Usage Guidelines](#section12620311012) - [Repositories Involved](#section63151229062) ## Introduction The power manager provides the following capabilities: 1. Querying the battery level 2. Keeping the device screen always on using a lock **Figure 1** Power manager architecture ![](figures/en-us_image_0000001079710638.png) ## Directory Structure ``` base/powermgr/powermgr_lite ├── interfaces # APIs │ └── kits │ └── battery # API for querying the battery level └── services # Services ├── include └── source ``` ## Usage ### Available APIs The following table lists the JavaScript APIs provided by the power manager.

API

Description

battery.getStatus(OBJECT)

Obtains the battery level.

### Usage Guidelines **Obtaining the battery level** Use the JavaScript API to obtain the battery level. The sample code is as follows: ``` battery.getStatus({ success: function(data) { console.log('success get battery level:' + data.level); }, fail: function(data, code) { console.log('fail to get battery level code:' + code + ', data: ' + data); }, }); ``` ## Repositories Involved [Power management subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/power-management.md) **powermgr_powermgr_lite**