soc

package
v0.0.0-...-e6e1b3f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Publish(key string, val interface{})
	SocEstimator() *Estimator
	ActivePhases() int64
	Voltage() float64
}

Adapter provides the required methods for interacting with the loadpoint

type Estimator

type Estimator struct {
	// contains filtered or unexported fields
}

Estimator provides vehicle soc and charge duration Vehicle SoC can be estimated to provide more granularity

func NewEstimator

func NewEstimator(log *util.Logger, vehicle api.Vehicle, estimate bool) *Estimator

NewEstimator creates new estimator

func (*Estimator) CacheReset

func (s *Estimator) CacheReset() error

func (*Estimator) RemainingChargeDuration

func (s *Estimator) RemainingChargeDuration(chargePower float64, targetSoC int) time.Duration

RemainingChargeDuration returns the remaining duration estimate based on SoC, target and charge power

func (*Estimator) RemainingChargeEnergy

func (s *Estimator) RemainingChargeEnergy(targetSoC int) float64

RemainingChargeEnergy returns the remaining charge energy in kWh

func (*Estimator) Reset

func (s *Estimator) Reset()

Reset resets the estimation process to default values

func (*Estimator) SoC

func (s *Estimator) SoC(chargedEnergy float64) (float64, error)

SoC replaces the api.Vehicle.SoC interface to take charged energy into account

type Timer

type Timer struct {
	Adapter

	SoC  int
	Time time.Time
	// contains filtered or unexported fields
}

Timer is the target charging handler

func NewTimer

func NewTimer(log *util.Logger, adapter Adapter, maxCurrent int64) *Timer

NewTimer creates a Timer

func (*Timer) Handle

func (lp *Timer) Handle() float64

Handle adjusts current up/down to achieve desired target time taking.

func (*Timer) Reset

func (lp *Timer) Reset()

Reset resets the target charging request

func (*Timer) StartRequired

func (lp *Timer) StartRequired() bool

StartRequired calculates remaining charge duration and returns true if charge start is required to achieve target soc in time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL