circuit

package
v0.0.0-...-f411113 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromConfig

func NewFromConfig(log *util.Logger, other map[string]interface{}) (api.Circuit, error)

NewFromConfig creates a new Circuit

func Root

func Root() api.Circuit

Types

type Circuit

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

the circuit instances to control the load

func New

func New(log *util.Logger, title string, maxCurrent, maxPower float64, meter api.Meter, timeout time.Duration) (*Circuit, error)

New creates a circuit

func (*Circuit) GetChargePower

func (c *Circuit) GetChargePower() float64

GetChargePower returns the actual power

func (*Circuit) GetMaxCurrent

func (c *Circuit) GetMaxCurrent() float64

GetMaxCurrent returns the max current setting

func (*Circuit) GetMaxPhaseCurrent

func (c *Circuit) GetMaxPhaseCurrent() float64

GetMaxPhaseCurrent returns the actual current

func (*Circuit) GetMaxPower

func (c *Circuit) GetMaxPower() float64

GetMaxPower returns the max power setting

func (*Circuit) GetParent

func (c *Circuit) GetParent() api.Circuit

GetParent returns the parent circuit

func (*Circuit) GetTitle

func (c *Circuit) GetTitle() string

func (*Circuit) HasMeter

func (c *Circuit) HasMeter() bool

HasMeter returns the max power setting

func (*Circuit) RegisterChild

func (c *Circuit) RegisterChild(child api.Circuit)

RegisterChild registers child circuit

func (*Circuit) SetMaxCurrent

func (c *Circuit) SetMaxCurrent(current float64)

SetMaxCurrent sets the max current

func (*Circuit) SetMaxPower

func (c *Circuit) SetMaxPower(power float64)

SetMaxPower sets the max power

func (*Circuit) SetTitle

func (c *Circuit) SetTitle(title string)

func (*Circuit) Update

func (c *Circuit) Update(loadpoints []api.CircuitLoad) (err error)

func (*Circuit) ValidateCurrent

func (c *Circuit) ValidateCurrent(old, new float64) float64

ValidateCurrent validates current request

func (*Circuit) ValidatePower

func (c *Circuit) ValidatePower(old, new float64) float64

ValidatePower validates power request

func (*Circuit) Wrap

func (c *Circuit) Wrap(parent api.Circuit) error

Wrap wraps circuit with parent, keeping the original meter

Jump to

Keyboard shortcuts

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