From 3b2a8b8154fbdd704f185bb1b819bc4db832a9b1 Mon Sep 17 00:00:00 2001 From: Tobias Lindberg Date: Tue, 7 Jul 2026 23:06:29 +0200 Subject: [PATCH] fix(api): handle null car exterior fields Fixes a corner case on fresh TeslaMate setups where car profile fields may still be NULL before the vehicle has come online. Update the /api/v1/cars endpoint to scan exterior_color, spoiler_type, and wheel_type with NullString so the endpoint stays resilient until TeslaMate populates the profile. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/v1_TeslaMateAPICars.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/v1_TeslaMateAPICars.go b/src/v1_TeslaMateAPICars.go index fa262ea6..84c46204 100644 --- a/src/v1_TeslaMateAPICars.go +++ b/src/v1_TeslaMateAPICars.go @@ -30,9 +30,9 @@ func TeslaMateAPICarsV1(c *gin.Context) { } // CarExterior struct - child of Cars type CarExterior struct { - ExteriorColor string `json:"exterior_color"` // text - SpoilerType string `json:"spoiler_type"` // text - WheelType string `json:"wheel_type"` // text + ExteriorColor NullString `json:"exterior_color"` // text + SpoilerType NullString `json:"spoiler_type"` // text + WheelType NullString `json:"wheel_type"` // text } // CarSettings struct - child of Cars type CarSettings struct {