publisher

package
v0.0.0-...-7986564 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MeterPowerUnitWatt     = 1
	MeterPowerUnitKilowatt = 2
	MeterPowerUnitMegawatt = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandPayload

type CommandPayload struct {
	Action string  `json:"action"`
	Value  float64 `json:"value"`
}

func BuildCommandPayload

func BuildCommandPayload(action string, optInterval plan.OptimisationInterval) CommandPayload

type ErrorPayload

type ErrorPayload struct {
	Category  string `json:"category"`
	Message   string `json:"message"`
	Timestamp int64  `json:"timestamp"`
}

type Service

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

func NewService

func NewService(logger *slog.Logger, cfg config.Config, mqttClient mqtt.Client) *Service

func (*Service) PublishCommand

func (s *Service) PublishCommand(optInterval plan.OptimisationInterval) error

func (*Service) PublishError

func (s *Service) PublishError(message string, receivedError error)

Jump to

Keyboard shortcuts

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