Skip to content

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

Open
ehoeve786 wants to merge 1 commit into
softwiredtech:mainfrom
ehoeve786:fix/ios-tpms-decode
Open

ehoeve786 wants to merge 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>
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