HomeDocs
Skip to main content

dlt.getScreenBrightness

Introduction​

The dlt.getScreenBrightness function is used to retrieve the current screen brightness of the device.

Parameters​

Object object​

PropertyTypeDefault ValueRequiredDescription
successfunctionNoCallback function for a successful API call.
failfunctionNoCallback function for a failed API call.
completefunctionNoCallback function that is called when the API call is complete (whether successful or not).

object.success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
screenBrightnessnumberThe 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);
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.