Vehicle (VW/EU Data Act): add Skoda Enyaq soc key (#32060)
This commit is contained in:
parent
19c4e06391
commit
e3a48e42f9
3 changed files with 10 additions and 1 deletions
|
|
@ -218,6 +218,14 @@ func TestSocBatteryStateReportField(t *testing.T) {
|
|||
assert.Equal(t, 36.0, soc)
|
||||
}
|
||||
|
||||
func TestSocEnyaqField(t *testing.T) {
|
||||
data := []point{{Key: KeyEnyaqSoc, Name: "currentSoc", Value: "60"}}
|
||||
|
||||
soc, err := testProvider(data).Soc()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 60.0, soc)
|
||||
}
|
||||
|
||||
func TestSocBatteryStateReportOnlyFallbackField(t *testing.T) {
|
||||
data := []point{
|
||||
{Key: KeyBatteryStateReportSoc, Name: "battery_state_report.soc", Value: "36"},
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ func (v *Provider) Soc() (float64, error) {
|
|||
return 0, err
|
||||
}
|
||||
|
||||
if p := lookup(data, FieldHvBatteryLevelValue, FieldSoc, FieldHvSoc, KeyBatteryStateReportSoc); p != nil {
|
||||
if p := lookup(data, FieldHvBatteryLevelValue, FieldSoc, FieldHvSoc, KeyBatteryStateReportSoc, KeyEnyaqSoc); p != nil {
|
||||
return strconv.ParseFloat(p.Value, 64)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ const (
|
|||
FieldRangeSecondary = "cruising_range_secondary_engine"
|
||||
KeyRangeID3 = "0ca40e18-0564-3eda-bcc0-7aee9ef44f04" // VW ID.3 range
|
||||
KeyBatteryStateReportSoc = "506cb83e-f99f-3af3-bbeb-0429b69a78d9" // VW ID.3 soc
|
||||
KeyEnyaqSoc = "0a18a053-b4b0-3db1-be44-a6c5dba629b1" // Skoda Enyaq soc
|
||||
|
||||
// odo
|
||||
FieldOdometer = "mileage"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue