v2.0.6
Display Brightness Control & Admin UI Improvements
New Features
Display Brightness Control
- Hardware brightness support: Direct AMOLED brightness control via RM67162 command (0x51), with a range of 0 (off) to 255 (maximum).
- JavaScript API: New
set_brightness(value)andget_brightness()functions available in JavaScript applications. - Serial command: New
/brightness <0-255>serial command to set or query display brightness interactively. - Configuration persistence: Brightness is stored in
webscreen.jsonunderdisplay.brightnessand applied automatically on boot. - Default value: 200 (approximately 78% brightness).
Admin Tool UI
- Real-time brightness slider: Adjusting the brightness slider in the Admin tool sends the change to the device immediately.
Configuration
Add brightness to your webscreen.json:
{
"settings": {
"wifi": {
"ssid": "MyNetwork",
"pass": "MyPassword"
}
},
"display": {
"brightness": 200
},
"script": "app.js"
}JavaScript API Usage
// Set brightness
set_brightness(200);
// Read current brightness
let level = get_brightness();
print("Brightness: " + numberToString(level));Serial Command Usage
WebScreen> /brightness
Current brightness: 200
WebScreen> /brightness 150
[OK] Brightness set to 150
Full Changelog: 2.0.5...2.0.6