Skip to content

Report a negative clock offset as negative in sysinfo.json - #1298

Open
gskjold wants to merge 1 commit into
mainfrom
fix-negative-clock-offset
Open

gskjold wants to merge 1 commit into
mainfrom
fix-negative-clock-offset

Conversation

@gskjold

@gskjold gskjold commented Oct 25, 2026

Copy link
Copy Markdown
Member

Problem

sysinfoJson() cast the UTC offset to uint16_t before formatting it with %d, so a device west of UTC (e.g. UTC-5) reported "clock_offset": 65531. The UI uses clock_offset to place the day plot, month plot, price plot and clock labels, so all of those would be wrong there.

Fix

Cast to int16_t instead. It promotes to int for %d and keeps the sign.

Verification

  • Host check of the same expression: offset -5 h prints 65531 with the old cast and -5 with the new one; +2 h prints 2 with both.
  • pio run -e esp32s2dev builds.

Found while fixing the DST label shift in #1297.

🤖 Generated with Claude Code

clock_offset was cast to uint16_t before being formatted with %d, so a
device in a time zone west of UTC reported 65531 instead of -5. The UI
uses it to place the day plot, price plot and clock labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔧 PR Build Artifacts

Version: 4f68e21

All environments built successfully. Download the zip files:

Artifacts expire after 7 days. View workflow run

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.

1 participant