Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the current screen brightness level.
my.getScreenBrightness({ success(res) { console.log('Current brightness:', res.brightness); } });
Page({ data: { brightnessPercent: 0 }, onLoad() { my.getScreenBrightness({ success: (res) => { this.setData({ brightnessPercent: Math.round(res.brightness * 100) }); } }); } });
Page({ data: { brightness: 0.5 }, onLoad() { my.getScreenBrightness({ success: (res) => { this.setData({ brightness: res.brightness }); } }); }, onBrightnessChange(e) { const value = e.detail.value / 100; my.setScreenBrightness({ brightness: value, success: () => { this.setData({ brightness: value }); } }); } });