Skip to content

iOS: decode TPMS fields when CarState comes from JSON - #276

Merged
wpmed92 merged 1 commit into
softwiredtech:mainfrom
ehoeve786:fix/ios-tpms-decode
Nov 15, 2026
Merged

wpmed92 merged 1 commit into
softwiredtech:mainfrom
ehoeve786:fix/ios-tpms-decode

Conversation

@ehoeve786

Copy link
Copy Markdown
Collaborator

Follow-up to #275. CarState's custom init(from:) on iOS skipped the 12 TPMS fields (tpmsPressure*, tpmsTemp*, tpmsBatt*), so a state decoded from JSON (the WebSocket data source) always kept the no-reading defaults and tyre widgets showed nothing.

This adds the 12 decodeIfPresent lines with the same defaults as the stored properties (-1 for pressure and battery, -100 for temperature). Every stored property of CarState is now decoded; DashKit and comma are unaffected (they build CarState from the bridge struct).

Not compiled locally (no Xcode on this machine); the change mirrors the existing lines next to it.

🤖 Generated with Claude Code

The custom init(from:) skipped the 12 tpmsPressure/tpmsTemp/tpmsBatt fields
added in softwiredtech#275, so the WebSocket data source always showed no tyre readings.
Defaults match the stored properties (-1 / -100 = no reading).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpmed92
wpmed92 merged commit b10712f into softwiredtech:main Nov 15, 2026
2 checks passed
@ehoeve786
ehoeve786 deleted the fix/ios-tpms-decode branch November 15, 2026 16:50
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