Nightstand Clock: make Up/Down actually change the screen brightness (closes #245) - #246
Merged
Conversation
…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>
Repository owner
locked as resolved and limited conversation to collaborators
Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_onand setsdisplay_off_delay_ms = 0. On Unleashed,notification_apply_notification_led_layerearly-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. Soset_backlight_brightness()'s plainsequence_display_backlight_onupdated the setting and the transient layer but never pushed the new level to the panel.Fix
Use
sequence_display_backlight_force_on, whose handler clearslcd_backlight_is_onbefore applying, so the new brightness reaches the panel.set_enforced_brightness()(Up/Down):force_on->enforce_auto->enforce_on. The leadingforce_onmoves 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 toforce_onso the saved brightness is reapplied immediately after the enforce lock is released.Firmware dependency
sequence_display_backlight_force_onexists 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_version1.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