publisher

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InverterUpdate added in v0.14.0

type InverterUpdate struct {
	Name         string
	SerialNumber string
	Telemetry    solaredge.InverterTelemetry
}

type Publisher

type Publisher[T any] struct {
	Updater[T]
	Interval time.Duration
	Logger   *slog.Logger
	pubsub.Publisher[T]
}

func (*Publisher[T]) Run

func (p *Publisher[T]) Run(ctx context.Context) error

type SiteUpdate added in v0.14.0

type SiteUpdate struct {
	ID              int
	Name            string
	PowerOverview   solaredge.PowerOverview
	InverterUpdates []InverterUpdate
}

type SolarEdgeClient added in v0.14.0

type SolarEdgeClient interface {
	GetSites(ctx context.Context) (solaredge.GetSitesResponse, error)
	GetPowerOverview(ctx context.Context, id int) (solaredge.GetPowerOverviewResponse, error)
	GetComponents(ctx context.Context, id int) (solaredge.GetComponentsResponse, error)
	GetInverterTechnicalData(ctx context.Context, id int, serialNr string, startTime time.Time, endTime time.Time) (solaredge.GetInverterTechnicalDataResponse, error)
}

type SolarEdgeUpdate added in v0.14.0

type SolarEdgeUpdate []SiteUpdate

type SolarEdgeUpdater

type SolarEdgeUpdater struct {
	SolarEdgeClient
}

func (SolarEdgeUpdater) GetUpdate

type TadoUpdater

type TadoUpdater struct {
	Client WeatherGetter
	HomeId tado.HomeId
}

func (TadoUpdater) GetUpdate

func (c TadoUpdater) GetUpdate(ctx context.Context) (*tado.Weather, error)

type Updater

type Updater[T any] interface {
	GetUpdate(context.Context) (T, error)
}

type WeatherGetter

type WeatherGetter interface {
	GetWeatherWithResponse(ctx context.Context, homeId tado.HomeId, reqEditors ...tado.RequestEditorFn) (*tado.GetWeatherResponse, error)
}

Jump to

Keyboard shortcuts

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