Skip to content

Day/night backlight color#265

Open
nick1udwig wants to merge 6 commits into
coredevices:masterfrom
nick1udwig:day-night-backlight
Open

Day/night backlight color#265
nick1udwig wants to merge 6 commits into
coredevices:masterfrom
nick1udwig:day-night-backlight

Conversation

@nick1udwig

Copy link
Copy Markdown

Problem

Would be nice if watches with RGB backlight could automatically switch backlight color, with one color for day and one for night.

See coredevices/PebbleOS#1139.

Solution

For watches that have RGB backlight, add default_color_night state along with time tracking for sunset/sunrise.

Notes

  1. Sister PR manages displays color based on day/night and manages changing based on sunset/sunrise: Day/night backlight color PebbleOS#1596
  2. I considered allowing user to set sunrise/set. Instead I decided to have it default to 6am/6pm and have the mobileapp code here supply more accurate times (based on location) if available. The light color logic lives in Day/night backlight color PebbleOS#1596
  3. UI changes: in Settings > Watch > Display under Backlight Color there is (for supported watches):
    • A checkbox Change Backlight Color at Night; when checked, show two Colors: Day Color and Night Color

Signed-off-by: Nick Ludwig <nick.b.ludwig@gmail.com>
Co-Authored-By: GPT-5.5-xhigh
Signed-off-by: Nick Ludwig <nick.b.ludwig@gmail.com>
Co-Authored-By: GPT-5.5-xhigh
Signed-off-by: Nick Ludwig <nick.b.ludwig@gmail.com>
Co-Authored-By: GPT-5.5-xhigh
Signed-off-by: Nick Ludwig <nick.b.ludwig@gmail.com>
Co-Authored-By: GPT-5.5-xhigh
@CLAassistant

CLAassistant commented Jun 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@machinaeZER0

machinaeZER0 commented Jun 23, 2026

Copy link
Copy Markdown

Per your sunrise/sunset comment - any way this could be tied to the timeline pins the watch is already generating for this? If so, then there would be no need to set manually (this might be what you're doing already!)

@sjp4

sjp4 commented Jun 24, 2026

Copy link
Copy Markdown
Member

This is way too complicated - the watch already knows sunrise/sunset times via the weather blobdb. This only needs to be literally adding two prefs (enabled/color). Also this doesn't need a capability bit - the watch will ignore unknown pref keys.

@nick1udwig

Copy link
Copy Markdown
Author

This is way too complicated - the watch already knows sunrise/sunset times via the weather blobdb. This only needs to be literally adding two prefs (enabled/color). Also this doesn't need a capability bit - the watch will ignore unknown pref keys.

Thanks for the review, will take another crack at it today or tomorrow.

Signed-off-by: Nick Ludwig <nick.b.ludwig@gmail.com>
Co-Authored-By: GPT-5.5-xhigh
@nick1udwig

Copy link
Copy Markdown
Author

I spent some time thinking about your review and also the feedback I got over on coredevices/PebbleOS#1596, specifically the desire to allow user configuration of when to start/end night ("sunset and sunrise"). Changes in c2ad6c6

Currently, sunrise/sunset from the weather API is communicated to timeline via timelinedb, not weatherdb. And although we could, in principle, read out those pins for the original scope (where user cannot configure night start/stop), that won't work well for a user-configurable case: we need to be able to send the times over whether they're sourced from the weather API or from the user setting them manually.

Hence, I ripped out the (overcomplicated, as you said) solar calculation code and replaced it with code to grab the times from the weather API -- if the user has so configured. There are also some UI changes to allow user to choose to set by weather API or manually. Screenshots attached.

I left in the prefs for sunrise/sunset times, since:

  1. They'd be required for user-input transition times, so seem like the correct way to do it
  2. Scope crept and so wanted to implement the user-input transition times immediately (and did so)

The other thing worth calling out here is that I left in the cap bit. The reason is that the UI should not display the options for night time color setting if the watch doesn't have firmware to support it. The only other way I could figure to do this would be to have a condition around the firmware version i.e.

if (version < preDayNightVersion) {
  // render UI with day only
} else {
  // render UI with day/night
}

Open to alternatives here.

signal-2026-06-26-14-16-04-149_002 signal-2026-06-26-14-16-04-149_003 signal-2026-06-26-14-16-04-149_004

Signed-off-by: Nick Ludwig <nick.b.ludwig@gmail.com>
Co-Authored-By: GPT-5.5-xhigh
@nick1udwig

Copy link
Copy Markdown
Author

@sjp4 PTAL again when you have time

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.

4 participants