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
Click to show internal directories.
Click to hide internal directories.