Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Dec 30, 2024
1 parent 789db65 commit bf1957c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions charger/nrgble_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions vehicle/porsche/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit bf1957c

Please sign in to comment.