diff --git a/charger/nrgble_linux.go b/charger/nrgble_linux.go index 54cfc85227..943c21a8f3 100644 --- a/charger/nrgble_linux.go +++ b/charger/nrgble_linux.go @@ -214,7 +214,7 @@ func (wb *NRGKickBLE) mergeSettings(info ble.Info) ble.Settings { func (wb *NRGKickBLE) Status() (api.ChargeStatus, error) { var res ble.Power if err := wb.read(ble.PowerService, &res); err != nil { - return api.StatusF, err + return api.StatusNone, err } wb.log.TRACE.Printf("read power: %+v", res) @@ -226,9 +226,9 @@ func (wb *NRGKickBLE) Status() (api.ChargeStatus, error) { return api.StatusC, nil case 4: return api.StatusA, nil + default: + return api.StatusNone, fmt.Errorf("invalid status: %d", res.CPSignal) } - - return api.StatusA, fmt.Errorf("unexpected cp signal: %d", res.CPSignal) } // Enabled implements the api.Charger interface diff --git a/vehicle/porsche/provider.go b/vehicle/porsche/provider.go index f7d3bd588c..577c5c227a 100644 --- a/vehicle/porsche/provider.go +++ b/vehicle/porsche/provider.go @@ -107,14 +107,12 @@ func (v *Provider) Status() (api.ChargeStatus, error) { return api.StatusA, nil } switch res2.BatteryChargeStatus.ChargingState { - case "ERROR": - return api.StatusF, nil case "OFF", "COMPLETED": return api.StatusB, nil case "ON", "CHARGING": return api.StatusC, nil default: - return api.StatusNone, errors.New("emobility - unknown charging state: " + res2.BatteryChargeStatus.ChargingState) + return api.StatusNone, errors.New("emobility - invalid status: " + res2.BatteryChargeStatus.ChargingState) } } }