Custom vehicle: add charge controller (#13119)
This commit is contained in:
parent
6f8d0b8a89
commit
a5c7b9fd64
18 changed files with 1684 additions and 259 deletions
|
|
@ -72,13 +72,18 @@ func main() {
|
|||
|
||||
switch action {
|
||||
case "wakeup":
|
||||
vv, ok := v.(api.VehicleChargeController)
|
||||
if !ok {
|
||||
switch vv := v.(type) {
|
||||
case api.Resurrector:
|
||||
if err := vv.WakeUp(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
case api.ChargeController:
|
||||
if err := vv.ChargeEnable(true); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
default:
|
||||
log.Fatal("not supported:", action)
|
||||
}
|
||||
if err := vv.StartCharge(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
case "soc":
|
||||
var soc float64
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue