plan

package
v0.0.0-...-b058989 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(logger *slog.Logger, path string) Handler

func (Handler) GetCurrentInterval

func (p Handler) GetCurrentInterval(targetTime time.Time) (OptimisationInterval, error)

func (Handler) ReadPlan

func (p Handler) ReadPlan() (OptimisationPlan, error)

func (Handler) WritePlan

func (p Handler) WritePlan(optPlan OptimisationPlan) error

type OptimisationInterval

type OptimisationInterval struct {
	Interval      OptimisationIntervalTimestamp `json:"optimisation_interval"`
	BatteryPower  OptimisationValue             `json:"battery_power"`
	StateOfCharge float32                       `json:"state_of_charge"`
	MeterPower    OptimisationValue             `json:"meter_power"`
}

func (OptimisationInterval) IsCurrent

func (i OptimisationInterval) IsCurrent(targetTime time.Time) bool

func (OptimisationInterval) IsEmpty

func (i OptimisationInterval) IsEmpty() bool

func (OptimisationInterval) LogFormat

func (i OptimisationInterval) LogFormat() map[string]string

type OptimisationIntervalTimestamp

type OptimisationIntervalTimestamp struct {
	StartTime OptimisationTimestamp `json:"start_time"`
	EndTime   OptimisationTimestamp `json:"end_time"`
}

type OptimisationPlan

type OptimisationPlan struct {
	SiteID                string                 `json:"site_id"`
	OptimisationTimestamp OptimisationTimestamp  `json:"optimisation_timestamp"`
	OptimisationIntervals []OptimisationInterval `json:"optimisation_intervals"`
	SetpointType          int                    `json:"setpoint_type"`
}

func (OptimisationPlan) IsEmpty

func (o OptimisationPlan) IsEmpty() bool

type OptimisationTimestamp

type OptimisationTimestamp struct {
	Seconds int64 `json:"seconds"`
	Nanos   int64 `json:"nanos"`
}

type OptimisationValue

type OptimisationValue struct {
	Value float32 `json:"value"`
	Unit  int     `json:"unit"`
}

Jump to

Keyboard shortcuts

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