evcc-io/core/vehicle/api.go
2026-07-09 19:27:36 +02:00

46 lines
1.2 KiB
Go

package vehicle
import (
"time"
"github.com/evcc-io/evcc/api"
)
//go:generate go tool mockgen -package vehicle -destination mock.go -mock_names API=MockAPI github.com/evcc-io/evcc/core/vehicle API
type API interface {
// Instance returns the vehicle instance
Instance() api.Vehicle
// Name returns the vehicle name
Name() string
// GetMode returns the charge mode
GetMode() api.ChargeMode
// SetMode sets the charge mode
SetMode(api.ChargeMode)
// GetMinSoc returns the min soc
GetMinSoc() int
// SetMinSoc sets the min soc
SetMinSoc(soc int)
// GetLimitSoc returns the limit soc
GetLimitSoc() int
// SetLimitSoc sets the limit soc
SetLimitSoc(soc int)
// GetPlanSoc returns the charge plan soc
GetPlanSoc() (time.Time, int)
// SetPlanSoc sets the charge plan time and soc
SetPlanSoc(time.Time, int) error
// GetRepeatingPlans returns every repeating plan
GetRepeatingPlans() []api.RepeatingPlan
// SetRepeatingPlans stores every repeating plan
SetRepeatingPlans([]api.RepeatingPlan) error
// GetPlanStrategy returns the plan strategy
GetPlanStrategy() api.PlanStrategy
// SetPlanStrategy sets the plan strategy
SetPlanStrategy(api.PlanStrategy) error
}