plant

package
v0.0.0-...-95ec5d6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContinuousFetchPlant

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

func FetchContinuously

func FetchContinuously(ctx context.Context, plant *Plant) *ContinuousFetchPlant

func (*ContinuousFetchPlant) FetchSummary

func (c *ContinuousFetchPlant) FetchSummary() (Summary, error)

type GridMeter

type GridMeter struct {
	EM           *meter.EnergyMeter
	SerialNumber uint32
}

func (*GridMeter) ReadGrid

func (g *GridMeter) ReadGrid() (float32, error)

type Plant

type Plant struct {
	Inverters []powerReader
	Bat       batteryReader
	Meter     gridReader
}

func NewPlant

func NewPlant(em gridReader, readers ...PointReader) (*Plant, error)

func (*Plant) FetchSummary

func (p *Plant) FetchSummary() (Summary, error)

type PointReader

type PointReader interface {
	GetAnyPoint(ps ...sunspec.Point) (float64, error)
	HasAnyPoint(ps ...sunspec.Point) (bool, sunspec.Point, error)
}

type Summary

type Summary struct {
	Grid                         float32
	PV, Bat                      float32
	SelfConsumption              float32
	BatPercentage                uint
	TimestampStart, TimestampEnd time.Time
}

Jump to

Keyboard shortcuts

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