capper

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PowerCapReset = &CapInstruction{
	OpCode: OpReset,
}

Functions

This section is empty.

Types

type CapInstruction

type CapInstruction struct {
	OpCode         PowerCapOpCode
	OpCurrentValue string
	OpTargetValue  string
}

func GetCappingInstructions

func GetCappingInstructions(response *advisorsvc.ListAndWatchResponse) ([]*CapInstruction, error)

func NewCapInstruction

func NewCapInstruction(targetWatts, currWatt int) (*CapInstruction, error)

func (CapInstruction) ToCapRequest

func (c CapInstruction) ToCapRequest() (opCode PowerCapOpCode, targetValue, currentValue int)

func (CapInstruction) ToListAndWatchResponse

func (c CapInstruction) ToListAndWatchResponse() *advisorsvc.ListAndWatchResponse

type PowerCapOpCode

type PowerCapOpCode string
const (
	OpCap     PowerCapOpCode = "4"
	OpReset   PowerCapOpCode = "-1"
	OpUnknown PowerCapOpCode = "-2"
)

type PowerCapper

type PowerCapper interface {
	Init() error
	Start() error
	Stop() error
	Reset()
	Cap(ctx context.Context, targetWatts, currWatt int)
}

func NewNoopCapper

func NewNoopCapper() PowerCapper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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