rules

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadZoneRules added in v0.15.0

func LoadZoneRules(cfg configuration.ZoneConfiguration, update poller.Update, logger *slog.Logger) (rules.Rules, error)

Types

type AutoAwayRule

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

func LoadAutoAwayRule added in v0.15.0

func LoadAutoAwayRule(id int, name string, cfg configuration.AutoAwayConfiguration, update poller.Update, logger *slog.Logger) (AutoAwayRule, error)

func (AutoAwayRule) Evaluate

func (r AutoAwayRule) Evaluate(update poller.Update) (action.Action, error)

type HomeAwayRule added in v0.15.0

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

func LoadHomeAwayRule added in v0.15.0

func LoadHomeAwayRule(id int, name string, _ poller.Update, _ *slog.Logger) (HomeAwayRule, error)

func (HomeAwayRule) Evaluate added in v0.15.0

func (r HomeAwayRule) Evaluate(update poller.Update) (action.Action, error)

type LimitOverlayRule

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

func LoadLimitOverlay added in v0.15.0

func LoadLimitOverlay(id int, name string, cfg configuration.LimitOverlayConfiguration, _ poller.Update, logger *slog.Logger) (LimitOverlayRule, error)

func (LimitOverlayRule) Evaluate

func (r LimitOverlayRule) Evaluate(update poller.Update) (action.Action, error)

type NightTimeRule

type NightTimeRule struct {
	GetCurrentTime func() time.Time
	// contains filtered or unexported fields
}

func LoadNightTime added in v0.15.0

func LoadNightTime(id int, name string, cfg configuration.NightTimeConfiguration, _ poller.Update, logger *slog.Logger) (NightTimeRule, error)

func (NightTimeRule) Evaluate

func (r NightTimeRule) Evaluate(update poller.Update) (action.Action, error)

type State added in v0.15.0

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

func (State) Do added in v0.15.0

func (s State) Do(ctx context.Context, setter action.TadoSetter) error

func (State) IsEqual added in v0.15.0

func (s State) IsEqual(i action.State) bool

func (State) LogValue added in v0.15.0

func (s State) LogValue() slog.Value

func (State) Mode added in v0.15.0

func (s State) Mode() action.Mode

func (State) String added in v0.15.0

func (s State) String() string

type TadoSetter

type TadoSetter interface {
}

Jump to

Keyboard shortcuts

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