Polestar: fix api

This commit is contained in:
andig 2025-06-03 18:28:37 +02:00
parent 53e19a4efc
commit 9ea6ed6d1c
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ func NewProvider(log *util.Logger, api *API, vin string, timeout, cache time.Dur
// SOC via car telemetry
func (v *Provider) Soc() (float64, error) {
res, err := v.telemetryG()
return float64(res.Battery[0].BatteryChargeLevelPercentage), err
return res.Battery[0].BatteryChargeLevelPercentage, err
}
var _ api.ChargeState = (*Provider)(nil)

View file

@ -23,7 +23,7 @@ type HealthData struct {
type BatteryData struct {
VIN string
BatteryChargeLevelPercentage int64
BatteryChargeLevelPercentage float64
ChargingStatus string
EstimatedChargingTimeToFullMinutes int64
EstimatedDistanceToEmptyKm int64