Skip to content

Backlight blink and (or) vibe on charge complete#1495

Open
jmsunseri wants to merge 8 commits into
coredevices:mainfrom
jmsunseri:backlight-on-charge-complete
Open

Backlight blink and (or) vibe on charge complete#1495
jmsunseri wants to merge 8 commits into
coredevices:mainfrom
jmsunseri:backlight-on-charge-complete

Conversation

@jmsunseri

@jmsunseri jmsunseri commented Jun 12, 2026

Copy link
Copy Markdown

adding 2 new settings one for blinking the back light when charge is done and the other one for vibing when full charged.

PXL_20260612_101242268.TS.mp4
Screencast.From.2026-06-12.15-01-44.webm

jmsunseri and others added 4 commits June 12, 2026 13:28
Add a new Charging settings menu entry below Health with two boolean
toggles: Blink When Full and Vibe When Full. Both default to enabled.
The toggles are wired to persisted preferences but the behavior hooks
are not yet connected.

Co-authored-by: GLM-5.1 <glm-5.1@z.ai>
Signed-off-by: Justin Sunseri <jmsunseri@gmail.com>
Add two new persisted boolean preferences:
- chargingBlinkWhenFull (default: true)
- chargingVibeWhenFull (default: true)

These are registered in the prefs table and exposed via getter/setter
functions in shell/prefs.h.

Co-authored-by: GLM-5.1 <glm-5.1@z.ai>
Signed-off-by: Justin Sunseri <jmsunseri@gmail.com>
When the watch reaches the BatteryFullyCharged state:
- If Vibe When Full is enabled, fire a short vibe pulse
- If Blink When Full is enabled, start a 2s on/off backlight blink
  cycle that stops when the watch leaves the fully-charged state
  (e.g. unplugged)

Add unit tests for both behaviors in test_battery_ui_fsm.

Co-authored-by: GLM-5.1 <glm-5.1@z.ai>
Signed-off-by: Justin Sunseri <jmsunseri@gmail.com>
- Split weak compound asserts into separate cl_assert calls
- Reset light_enable state in test initialize
- Add test verifying fully-charged vibe intentionally ignores DND
- Merge redundant vibe_on_charge_complete_default into
  vibe_on_charge_complete with modal state asserts
- Enhance stubs_new_timer.h to track timer callbacks and allow
  manual firing via stub_timer_fire_all()
- Add blink_toggle_cycle test verifying the on/off blink cycle
  by exercising the timer callback

Co-authored-by: GLM-5.1 <glm-5.1@z.ai>
Signed-off-by: Justin Sunseri <jmsunseri@gmail.com>
@jmsunseri jmsunseri force-pushed the backlight-on-charge-complete branch from 381cf39 to 280d241 Compare June 12, 2026 07:12
@jmsunseri jmsunseri marked this pull request as ready for review June 12, 2026 07:21
Restore original include order and append new includes at the end
of the include block, rather than inserting them alphabetically in
the middle. Also fix missing trailing newline.

Co-authored-by: GLM-5.1 <noreply@z.ai>
Signed-off-by: Justin Sunseri <jmsunseri@gmail.com>
@jmsunseri

Copy link
Copy Markdown
Author

cc @ericmigi

jmsunseri and others added 2 commits June 12, 2026 17:18
Replace the simple blink toggle in battery_ui_fsm with a smooth
breathing animation driven by the light service state machine.

New light service states: BREATHE_FADE_IN, BREATHE_HOLD,
BREATHE_FADE_OUT, BREATHE_OFF. The cycle fades in over 750ms
(20 steps), holds at full brightness for 750ms, fades out over
750ms, stays off for 2000ms, then repeats.

New public API:
- light_start_charge_breathe() begins the cycle
- light_stop_charge_breathe() cancels it and turns the light off

battery_ui_fsm no longer manages its own timer; it delegates to
the light service via start/stop calls.

Co-authored-by: GLM-5.1 <noreply@z.ai>
Signed-off-by: Justin Sunseri <jmsunseri@gmail.com>
Preserve current brightness on FADE_OUT entry instead of dropping to
0, which caused a visible flash. Use inclusive interpolation
(step / STEPS-1) so fade-in reaches full target and fade-out starts
from full target without a brightness jump.

Also change breathe timing to 500ms fade-in, 500ms hold, 500ms
fade-out, 2000ms off.

Co-authored-by: GLM-5.1 <noreply@z.ai>
Signed-off-by: Justin Sunseri <jmsunseri@gmail.com>
@gmarull gmarull requested a review from ericmigi June 12, 2026 10:47
@ericmigi

Copy link
Copy Markdown
Collaborator

nice!

@ericmigi ericmigi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice as long as it's off by default and settings are available in phone app

@jmsunseri

Copy link
Copy Markdown
Author

nice as long as it's off by default and settings are available in phone app

currently it's on by default but I agree I think the light should be off by default. I do think though that the watch should vibe by default when it's done charging. What do you think about leaving the vibe on by default? If this get's merged i'll follow up with a patch for the mobile app

@ericmigi

Copy link
Copy Markdown
Collaborator

both should be off by default. people charge while sleeping

@jmsunseri

Copy link
Copy Markdown
Author

both should be off by default. people charge while sleeping

fair enough! i'll get these updated to be off by default in a little bit

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.

2 participants