diff --git a/vehicle/tronity.go b/vehicle/tronity.go index 3e3176da2..700ecb2cb 100644 --- a/vehicle/tronity.go +++ b/vehicle/tronity.go @@ -165,7 +165,7 @@ func (v *Tronity) SoC() (float64, error) { res, err := v.bulkG() if res, ok := res.(tronity.Bulk); err == nil && ok { - return float64(res.Level), nil + return res.Level, nil } return 0, err diff --git a/vehicle/tronity/types.go b/vehicle/tronity/types.go index 806f82a2f..d4cb50b26 100644 --- a/vehicle/tronity/types.go +++ b/vehicle/tronity/types.go @@ -1,5 +1,7 @@ package tronity +// https://app.platform.tronity.io/docs#operation + type Vehicles struct { Data []Vehicle } @@ -12,24 +14,24 @@ type Vehicle struct { } type Bulk struct { - VIN string - Odometer int - Range int - Level int - Charging string // Charging - Latitude float64 - Longitude float64 + VIN string + Odometer float64 + Range float64 + Level float64 + Charging string // Charging + // Latitude float64/string + // Longitude float64/string Timestamp int64 } type Odometer struct { - Odometer int - Timestamp int64 + Odometer float64 + Timestamp float64 } type EVBatteryLevel struct { - Range int - Level int + Range float64 + Level float64 Timestamp int64 } @@ -37,3 +39,9 @@ type EVChargingStatus struct { Charging string Timestamp int64 } + +type Location struct { + // Latitude float64/string + // Longitude float64/string + Timestamp int64 +}