dlt.getScreenBrightness
Introduction
The dlt.getScreenBrightness function is used to retrieve the current screen brightness of the device.
Parameters
Object object
| Property | Type | Default Value | Required | Description |
|---|---|---|---|---|
| success | function | No | Callback function for a successful API call. | |
| fail | function | No | Callback function for a failed API call. | |
| complete | function | No | Callback function that is called when the API call is complete (whether successful or not). |
object.success Callback Function
Parameters
Object res
| Property | Type | Description |
|---|---|---|
| screenBrightness | number | The current screen brightness. |
The screenBrightness value ranges from 0 to 1, with 0 representing the lowest brightness and 1 representing the highest brightness.
Example Code
dlt.getScreenBrightness({
success(res) {
console.log(res.screenBrightness);
},
});