Enhance session validation handling in API endpoints and refactor vehicle-related structures for improved clarity and functionality.
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 25s

This commit is contained in:
2025-07-08 22:11:16 -04:00
parent 07e3005e9c
commit 0b2ed38ca3
4 changed files with 85 additions and 60 deletions

View File

@ -227,15 +227,16 @@ type VehicleData struct {
TimeZone string `json:"timeZone"` // America/New_York
SunsetUpgraded bool `json:"sunsetUpgraded"` // true | false
PreferredDealer string `json:"preferredDealer,omitempty"` // null |
VehicleBranded bool `json:"vehicleBranded"`
}
// GeoPosition .
type GeoPosition struct {
Latitude float64 `json:"latitude"` // 40.700184
Longitude float64 `json:"longitude"` // -74.401375
Speed float64 `json:"speed,omitempty"` // 62
Heading int `json:"heading,omitempty"` // 155
Timestamp string `json:"timestamp"` // "2021-12-22T13:14:47"
Latitude float64 `json:"latitude"` // 40.700184
Longitude float64 `json:"longitude"` // -74.401375
Speed int `json:"speed,omitempty"` // 62
Heading int `json:"heading,omitempty"` // 155
Timestamp CustomTime1 `json:"timestamp"` // "2021-12-22T13:14:47"
}
// type GeoPositionTime time.Time
@ -362,6 +363,34 @@ type VehicleCondition struct {
// HeatedRearWindowActive string `json:"heatedRearWindowActive"`
// }
// ClimateProfile represents a climate control profile for a Subaru vehicle.
type ClimateProfile struct {
Name string `json:"name,omitempty"`
VehicleType string `json:"vehicleType,omitempty"` // vehicleType [ gas | phev ]
PresetType string `json:"presetType,omitempty"` // presetType [ subaruPreset | userPreset ]
CanEdit bool `json:"canEdit,string,omitempty"` // canEdit [ false | true ]
Disabled bool `json:"disabled,string,omitempty"` // disabled [ false | true ]
RunTimeMinutes int `json:"runTimeMinutes,string"` // runTimeMinutes [ 5 | 10 ]
ClimateZoneFrontTemp int `json:"climateZoneFrontTemp,string"` // climateZoneFrontTemp: [ for _ in range(60, 85 + 1)] // climateZoneFrontTempCelsius: [for _ in range(15, 30 + 1) ]
ClimateZoneFrontAirMode string `json:"climateZoneFrontAirMode"` // climateZoneFrontAirMode: [ WINDOW | FEET_WINDOW | FACE | FEET | FEET_FACE_BALANCED | AUTO ]
ClimateZoneFrontAirVolume string `json:"climateZoneFrontAirVolume"` // climateZoneFrontAirVolume: [ AUTO | 2 | 4 | 7 ]
OuterAirCirculation string `json:"outerAirCirculation"` // outerAirCirculation: [ outsideAir, recirculation ]
HeatedRearWindowActive bool `json:"heatedRearWindowActive,string"` // heatedRearWindowActive: [ false | true ]
AirConditionOn bool `json:"airConditionOn,string"` // airConditionOn: [ false | true ]
HeatedSeatFrontLeft string `json:"heatedSeatFrontLeft"` // heatedSeatFrontLeft: [ OFF | LOW_HEAT | MEDIUM_HEAT | HIGH_HEAT ]
HeatedSeatFrontRight string `json:"heatedSeatFrontRight"` // heatedSeatFrontRight: [ OFF | LOW_HEAT | MEDIUM_HEAT | HIGH_HEAT ]
StartConfiguration string `json:"startConfiguration"` // startConfiguration [ START_ENGINE_ALLOW_KEY_IN_IGNITION (gas) | START_CLIMATE_CONTROL_ONLY_ALLOW_KEY_IN_IGNITION (phev) ]
}
// GeoLocation represents the geographical location of a Subaru vehicle.
type GeoLocation struct {
Latitude float64 `json:"latitude"` // 40.700184
Longitude float64 `json:"longitude"` // -74.401375
Heading int `json:"heading,omitempty"` // 189
Speed int `json:"speed,omitempty"` // 0.00
Updated CustomTime1 `json:"timestamp"` // "2025-07-08T19:05:07"
}
// ServiceRequest .
// "dataName": "remoteServiceStatus"
type ServiceRequest struct {