Skip to content

Commit

Permalink
VW ID: fix json error
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Dec 7, 2022
1 parent c726a03 commit d1ebd72
Showing 1 changed file with 2 additions and 77 deletions.
79 changes: 2 additions & 77 deletions vehicle/vw/id/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ type Status struct {
RemainingChargingTimeToCompleteMin int `json:"remainingChargingTimeToComplete_min"`
ChargingState string `json:"chargingState"` // readyForCharging/off
ChargeMode string `json:"chargeMode"` // invalid
ChargePowerKW int `json:"chargePower_kW"`
ChargeRateKmph int `json:"chargeRate_kmph"`
ChargePowerKW float64 `json:"chargePower_kW"`
ChargeRateKmph float64 `json:"chargeRate_kmph"`
ChargeType string `json:"chargeType"`
ChargingSettings string `json:"chargingSettings"`
} `json:"value"`
Expand Down Expand Up @@ -194,81 +194,6 @@ type Status struct {
} `json:"chargingProfiles"`
}

// BatteryStatus is the /status.batteryStatus api
type BatteryStatus struct {
CarCapturedTimestamp Timestamp
CurrentSOCPercent int `json:"currentSOC_pct"`
CruisingRangeElectricKm int `json:"cruisingRangeElectric_km"`
}

// ChargingStatus is the /status.chargingStatus api
type ChargingStatus struct {
CarCapturedTimestamp Timestamp
ChargingState string // readyForCharging/off
ChargeMode string // invalid
RemainingChargingTimeToCompleteMin int `json:"remainingChargingTimeToComplete_min"`
ChargePowerKW float64 `json:"chargePower_kW"`
ChargeRateKmph float64 `json:"chargeRate_kmph"`
}

// ChargingSettings is the /status.chargingSettings api
type ChargingSettings struct {
CarCapturedTimestamp Timestamp
MaxChargeCurrentAC string // reduced, maximum
AutoUnlockPlugWhenCharged string
TargetSOCPercent int `json:"targetSOC_pct"`
}

// PlugStatus is the /status.plugStatus api
type PlugStatus struct {
CarCapturedTimestamp Timestamp
PlugConnectionState string // connected, disconnected
PlugLockState string // locked, unlocked
}

// ClimatisationStatus is the /status.climatisationStatus api
type ClimatisationStatus struct {
CarCapturedTimestamp Timestamp
RemainingClimatisationTimeMin int `json:"remainingClimatisationTime_min"`
ClimatisationState string // off
}

// ClimatisationSettings is the /status.climatisationSettings api
type ClimatisationSettings struct {
CarCapturedTimestamp Timestamp
TargetTemperatureK float64 `json:"targetTemperature_K"`
TargetTemperatureC float64 `json:"targetTemperature_C"`
ClimatisationWithoutExternalPower bool
ClimatisationAtUnlock bool // ClimatizationAtUnlock?
WindowHeatingEnabled bool
ZoneFrontLeftEnabled bool
ZoneFrontRightEnabled bool
ZoneRearLeftEnabled bool
ZoneRearRightEnabled bool
}

// RangeStatus is the /status.rangeStatus api
type RangeStatus struct {
CarCapturedTimestamp Timestamp
CarType string
PrimaryEngine struct {
Type string
CurrentSOCPercent int `json:"currentSOC_pct"`
RemainingRangeKm int `json:"remainingRange_km"`
}
TotalRangeKm int `json:"totalRange_km"`
}

// MaintenanceStatus is the /status.maintenanceStatus api
type MaintenanceStatus struct {
CarCapturedTimestamp Timestamp // "2021-09-04T14:59:10Z",
InspectionDueDays int `json:"inspectionDue_days"`
InspectionDueKm int `json:"inspectionDue_km"`
MileageKm int `json:"mileage_km"`
OilServiceDueDays int `json:"oilServiceDue_days"`
OilServiceDueKm int `json:"oilServiceDue_km"`
}

// Timestamp implements JSON unmarshal
type Timestamp struct {
time.Time
Expand Down

0 comments on commit d1ebd72

Please sign in to comment.