未验证 提交 5aa0f83a 编写于 作者: O openharmony_ci 提交者: Gitee

!15831 翻译已完成15656

Merge pull request !15831 from shawn_he/15656-b
......@@ -203,7 +203,7 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
```js
try {
var value = batteryStats.getHardwareUnitPowerValue(ConsumptionType.CONSUMPTION_TYPE_SCREEN);
console.info('battery statistics percent of hardware is: ' + percent);
console.info('battery statistics value of hardware is: ' + value);
} catch(err) {
console.error('get battery statistics percent of hardware failed, err: ' + err);
}
......@@ -243,7 +243,7 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
```js
try {
var value = batteryStats.getHardwareUnitPowerPercent(ConsumptionType.CONSUMPTION_TYPE_SCREEN);
var percent = batteryStats.getHardwareUnitPowerPercent(ConsumptionType.CONSUMPTION_TYPE_SCREEN);
console.info('battery statistics percent of hardware is: ' + percent);
} catch(err) {
console.error('get battery statistics percent of hardware failed, err: ' + err);
......
......@@ -44,7 +44,9 @@ battery.getStatus({
## GetStatusOptions
Object that contains the API calling result.
Obtains the object that contains the API calling result.
**System capability**: SystemCapability.PowerManager.BatteryManager.Core
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ---- | ------------------------------------------------------------ |
......@@ -56,7 +58,9 @@ Object that contains the API calling result.
Defines a response that returns the charging status and remaining power of the device.
| Name| Type| Description|
| -------- | -------- | -------- |
| charging | boolean | Whether the battery is being charged.|
| level | number | Current battery level, which ranges from **0.00** to **1.00**.|
**System capability**: SystemCapability.PowerManager.BatteryManager.Core
| Name| Type| Readable | Writable | Description|
| -------- | -------- | -------- | -------- | -------- |
| charging | boolean | Yes | No | Whether the battery is being charged.|
| level | number | Yes | No | Current battery level, which ranges from **0.00** to **1.00**.|
......@@ -45,7 +45,7 @@ Obtains the current screen brightness.
## brightness.setValue
etValue(options?: SetBrightnessOptions): void
setValue(options?: SetBrightnessOptions): void
Sets the screen brightness.
......@@ -74,7 +74,7 @@ Sets the screen brightness.
## brightness.getMode
getMode(options?: GetBrightnessModeOptions: void
getMode(options?: GetBrightnessModeOptions): void
Obtains the screen brightness adjustment mode.
......@@ -132,7 +132,8 @@ Sets the screen brightness adjustment mode.
setKeepScreenOn(options?: SetKeepScreenOnOptions): void
>This API is no longer maintained since API version 7. It is recommended that you use [window.setKeepScreenOn](js-apis-window.md#setkeepscreenon) instead.
> NOTE<br>
> This API is no longer maintained since API version 7. It is recommended that you use [window.setKeepScreenOn](js-apis-window.md#setkeepscreenon) instead.
Sets whether to always keep the screen on. Call this API in **onShow()**.
......@@ -161,6 +162,8 @@ Sets whether to always keep the screen on. Call this API in **onShow()**.
Defines the options for obtaining the screen brightness.
**System capability**: SystemCapability.PowerManager.DisplayPowerManager
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| success | (data: [BrightnessResponse](#brightnessresponse)) => void | No | Called when API call is successful. **data** is a return value of the [BrightnessResponse](#brightnessresponse) type.|
......@@ -171,6 +174,8 @@ Defines the options for obtaining the screen brightness.
Defines the options for setting the screen brightness.
**System capability**: SystemCapability.PowerManager.DisplayPowerManager
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | ------------------------------------------------------------ |
| value | number | Yes | Screen brightness. The value is an integer ranging from **1** to **255**.<br>-&nbsp;If the value is less than or equal to **0**, value **1** will be used.<br>-&nbsp;If the value is greater than **255**, value **255** will be used.<br>-&nbsp;If the value contains decimals, the integral part of the value will be used. For example, if value **8.1** is set, value **8** will be used.|
......@@ -182,13 +187,15 @@ Defines the options for setting the screen brightness.
Defines a response that returns the screen brightness.
| Parameter| Type | Description|
| -------- | -------- | -------- |
| value | number | Screen brightness. The value ranges from 1 to 255.|
| Parameter| Type | Readable | Writable | Description|
| -------- | -------- | -------- | -------- | -------- |
| value | number | Yes | No | Screen brightness. The value ranges from 1 to 255.|
## GetBrightnessModeOptions
Defines the options for obtaining the screen brightness mode.
Gets the options of the screen brightness mode.
**System capability**: SystemCapability.PowerManager.DisplayPowerManager
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
......@@ -198,7 +205,9 @@ Defines the options for obtaining the screen brightness mode.
## SetBrightnessModeOptions
Defines the options for setting the screen brightness mode.
Sets the options of the screen brightness mode.
**System capability**: SystemCapability.PowerManager.DisplayPowerManager
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | ------------------------------------------------------ |
......@@ -211,13 +220,15 @@ Defines the options for setting the screen brightness mode.
Defines a response that returns the screen brightness mode.
| Name| Type | Description|
| -------- | -------- | -------- |
| mode | number | The value **0** indicates the manual adjustment mode, and the value **1** indicates the automatic adjustment mode.|
| Parameter| Type | Readable | Writable | Description|
| -------- | -------- | -------- | -------- | -------- |
| mode | number | Yes | No | The value **0** indicates the manual adjustment mode, and the value **1** indicates the automatic adjustment mode.|
## SetKeepScreenOnOptions
Defines the options for setting the screen to be steady on.
Sets the options for keeping the screen steady on.
**System capability**: SystemCapability.PowerManager.DisplayPowerManager
| Name | Type | Mandatory| Description |
| ------------ | ------------------------------------ | ---- | ------------------------------------------------------ |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册