Skip to content

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

Description

@mishamyte

Summary

In Nightstand Clock (non_catalog_apps/FlipperNightStand_clock), pressing Up/Down moves the on-screen brightness bar but the actual screen backlight does not change - it stays at whatever brightness the app started with. Since brightness control is the app's headline feature, it is effectively non-functional. Confirmed on-device (unleashed, API 88.0).

Root cause

At startup the app pins the backlight on with sequence_display_backlight_enforce_on and sets display_off_delay_ms = 0. In the notification service, enforce_on writes the brightness into the locked "internal" LED layer - and only once, at startup.

set_backlight_brightness() (clock_app.c:52-55), called from handle_up/handle_down, only updates app->settings.display_brightness and sends sequence_display_backlight_on, which writes the transient "notification" layer. The display reset path then restores the notification layer back to the stale internal layer, so the new brightness is reverted and the screen stays at the startup level.

The app author already hit this: the render callback contains a commented-out per-frame re-apply with the note "avoids a bug with the brightness being reverted after the backlight-off period" - the same issue, worked around rather than fixed.

Location

clock_app.c:52-55 (set_backlight_brightness), invoked from handle_up (~:65) and handle_down (~:85).

Suggested fix

Update the enforced (internal) layer when brightness changes, via a dedicated helper used by Up/Down:

void set_enforced_brightness(float brightness) {
    notif->settings.display_brightness = brightness;
    notification_message(notif, &sequence_display_backlight_on);           // show now (notification layer)
    notification_message(notif, &sequence_display_backlight_enforce_auto); // update the locked...
    notification_message(notif, &sequence_display_backlight_enforce_on);   // ...internal layer to the new brightness
}

The on first moves the display to the notification layer, so the enforce_auto step (which momentarily sets the internal layer to 0) does not flicker the screen; enforce_on then reloads the internal layer at the new brightness. The lock stays balanced (enforce_on at startup, auto+on per change, enforce_auto on exit). The exit path keeps using the plain set_backlight_brightness after releasing the lock, so normal auto-backlight resumes.

This is a pre-existing defect, independent of #243/#244, surfaced during on-device testing of that work. The app is third-party (@nymda & @Willy-JL), so the fix may want mirroring upstream.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

category/toolsApp category: toolspack/non-catalogApp in non_catalog_appsstatus/third-partyApp is authored/maintained outside our team; coordinate fixes with upstreamtype/bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions