Fiat: allow float values for soc

This commit is contained in:
andig 2021-10-20 13:57:09 +02:00
parent a924483398
commit 43c40f01be
2 changed files with 6 additions and 6 deletions

View file

@ -89,7 +89,7 @@ func (v *Provider) status(statusG func() (StatusResponse, error)) (StatusRespons
func (v *Provider) SoC() (float64, error) {
res, err := v.statusG()
if res, ok := res.(StatusResponse); err == nil && ok {
return float64(res.EvInfo.Battery.StateOfCharge), nil
return res.EvInfo.Battery.StateOfCharge, nil
}
return 0, err

View file

@ -31,11 +31,11 @@ type StatusResponse struct {
Value int
Unit string
}
PlugInStatus bool // true
StateOfCharge int // 75
TimeToFullyChargeL1 int // 0
TimeToFullyChargeL2 int // 540
TotalRange int // 17
PlugInStatus bool // true
StateOfCharge float64 // 75
TimeToFullyChargeL1 int // 0
TimeToFullyChargeL2 int // 540
TotalRange int // 17
}
Timestamp TimeMillis
}