Custom vehicle: add charge controller (#13119)

This commit is contained in:
andig 2024-03-23 18:14:14 +01:00 • committed by GitHub
parent 6f8d0b8a89
commit a5c7b9fd64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 1684 additions and 259 deletions

View file

@ -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