Skip to content

Apply keypad brightness ratio immediately + drop dead UIStatus code#430

Merged
brickbots merged 2 commits into
mainfrom
apply_backlight_immediately
May 24, 2026
Merged

Apply keypad brightness ratio immediately + drop dead UIStatus code#430
brickbots merged 2 commits into
mainfrom
apply_backlight_immediately

Conversation

@brickbots
Copy link
Copy Markdown
Owner

@brickbots brickbots commented May 24, 2026

Summary

  • fix: Settings → User Pref → "Key Bright" now applies the new keypad_brightness ratio immediately. The menu used the generic config_option path in text_menu.py, which only wrote to config and never signaled the main loop, so the new ratio didn't take effect until something else (e.g. ALT_+/ALT_-) re-triggered main.set_brightness. Added an apply_brightness post_callback that puts "set_brightness" on the ui_queue; the existing handler in main.py already re-reads keypad_brightness and updates the keypad PWM.
  • refactor: Drop the dead _config_options hint-menu dict from UIStatus and the ten unreferenced callbacks below it (update_software, set_key_brightness, set_sleep_timeout, set_hint_timeout, set_screen_off_timeout, mount_switch, side_switch, wifi_switch, shutdown, restart) plus the active() method and version_txt attr that only existed to feed the dead dict. Nothing iterates _config_options anywhere in the codebase, and the duplicated update_software shadowed the live implementation in ui/software.py. Preserved the wifi_status.txt read that seeds status_dict["WIFI"]. Net: −179 / +3 in ui/status.py.

Test plan

  • In Settings → User Pref → Key Bright, pick a different ratio (e.g. +3 then -2) and confirm the keypad LEDs change immediately, without needing to also touch display brightness.
  • Visit the STATUS screen and confirm it still renders all fields (LAST SLV, RA/DEC, AZ/ALT, WIFI, IP, SSID, IMU, GPS, times, CPU TMP) and that up/down still scroll long content.
  • Confirm WiFi indicator shows correctly on first entry to STATUS after boot in both AP and Client modes.

🤖 Generated with Claude Code

brickbots and others added 2 commits May 23, 2026 18:31
The Settings > User Pref > "Key Bright" menu wrote keypad_brightness to
config but never asked main to re-apply it, so the new ratio only took
effect on the next display-brightness adjustment. Add an apply_brightness
post_callback that signals the existing "set_brightness" handler in main,
which re-reads keypad_brightness from config and updates the keypad PWM.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remove the _config_options dict and all of its associated callbacks
(set_key_brightness, set_sleep_timeout, set_hint_timeout,
set_screen_off_timeout, mount_switch, side_switch, wifi_switch, shutdown,
restart, update_software) along with the now-unused active() method and
version_txt attribute. The hint-menu system that consumed _config_options
no longer exists; nothing iterates the dict and the duplicate
update_software shadowed the live implementation in ui/software.py. Keep
the wifi_status.txt read that seeds status_dict["WIFI"], inlined as a
local.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brickbots brickbots merged commit 82f7fa0 into main May 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant