Skip to content

Nightstand Clock: make Up/Down actually change the screen brightness (closes #245) - #246

Merged
mishamyte merged 1 commit into
devfrom
nightstand-brightness
Jul 24, 2026
Merged

Nightstand Clock: make Up/Down actually change the screen brightness (closes #245)#246
mishamyte merged 1 commit into
devfrom
nightstand-brightness

Conversation

@mishamyte

Copy link
Copy Markdown
Collaborator

Fixes #245.

Pressing Up/Down in Nightstand Clock moved the on-screen brightness bar but did not change the actual screen backlight - it stayed at the brightness the app started with. Confirmed on-device (Unleashed, API 88.0), and now confirmed fixed on-device.

Root cause

The app pins the backlight on with sequence_display_backlight_enforce_on and sets display_off_delay_ms = 0. On Unleashed, notification_apply_notification_led_layer early-returns without touching the hardware when the backlight is already on ((light == LightBacklight) & lcd_backlight_is_on), and with the auto-off delay forced to 0 that flag never clears. So set_backlight_brightness()'s plain sequence_display_backlight_on updated the setting and the transient layer but never pushed the new level to the panel.

Fix

Use sequence_display_backlight_force_on, whose handler clears lcd_backlight_is_on before applying, so the new brightness reaches the panel.

  • set_enforced_brightness() (Up/Down): force_on -> enforce_auto -> enforce_on. The leading force_on moves the display to the notification layer and updates the panel; the enforce pair then refreshes the locked "internal" layer at the new level (suppressed from the panel because the index is now the notification layer, so no flicker) and keeps the enforce lock balanced.
  • set_backlight_brightness() (exit restore): also switched to force_on so the saved brightness is reapplied immediately after the enforce lock is released.
  • Removed the author's obsolete commented-out per-frame re-apply workaround.

Firmware dependency

sequence_display_backlight_force_on exists in Unleashed/RM-family firmware (and the ufbt SDK this repo builds against) but not in stock OFW, where it would fail to link. This is consistent with all-the-plugins targeting Unleashed.

fap_version 1.1 -> 1.2, CHANGELOG updated. Pre-existing and independent of #243 / #244; surfaced during on-device testing of that work. Third-party app (@nymda & @Willy-JL), so the fix may want mirroring upstream.

Reviewed with the code-reviewer and code-simplifier agents (traced against the Unleashed notification-service source); on-device confirmed (brightness changes and holds, exit restores). clang-formatted with the project style.

🤖 Generated with Claude Code

…loses #245)

The app pins the backlight with enforce_on and forces display_off_delay_ms=0, so
on unleashed the notification service early-returns from a plain
sequence_display_backlight_on while the backlight is already on
(lcd_backlight_is_on stays true and, with no auto-off delay, never clears) - the
on-screen bar moved but the panel never changed.

Use sequence_display_backlight_force_on, which clears lcd_backlight_is_on before
applying so the new level reaches the panel. Up/Down go through a new
set_enforced_brightness (force_on + enforce_auto + enforce_on) that also
refreshes the locked internal layer; the exit restore uses force_on too so the
saved brightness is reapplied immediately. Removes the author's obsolete
commented-out per-frame workaround.

Bump fap_version 1.1 -> 1.2 and add the CHANGELOG entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mishamyte mishamyte added type/bug Something isn't working category/tools App category: tools pack/non-catalog App in non_catalog_apps status/third-party App is authored/maintained outside our team; coordinate fixes with upstream labels Jul 24, 2026
@mishamyte
mishamyte merged commit 1d0e551 into dev Jul 24, 2026
2 checks passed
@mishamyte
mishamyte deleted the nightstand-brightness branch July 24, 2026 23:14
Repository owner locked as resolved and limited conversation to collaborators Jul 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

category/tools App category: tools pack/non-catalog App in non_catalog_apps status/third-party App is authored/maintained outside our team; coordinate fixes with upstream type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightstand Clock: Up/Down does not actually change screen brightness (enforced backlight layer never updated)

1 participant