Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rule ¶ added in v0.17.0
A Rule determines the next Action, given the current State.
func LoadHomeRule ¶ added in v0.17.0
func LoadHomeRule(cfg RuleConfiguration) (Rule, error)
func LoadZoneRule ¶ added in v0.17.0
func LoadZoneRule(zoneName string, cfg RuleConfiguration) (Rule, error)
type RuleConfiguration ¶ added in v0.17.0
type RuleConfiguration struct { Args Args `yaml:"args,omitempty"` Script ScriptConfig `yaml:"script"` Name string `yaml:"name"` Users []string `yaml:"users,omitempty"` }
type Rules ¶
type Rules struct { GetState func(update poller.Update) (State, error) // contains filtered or unexported fields }
Rules groups a set of rules for a zone or home. The Rules' Evaluate method runs through all contained rules and determines the required action, given the current State. The GetState function takes a poller.Update and returns the current State.
func LoadHomeRules ¶ added in v0.17.0
func LoadHomeRules(config []RuleConfiguration) (Rules, error)
LoadHomeRules create Rules as per config, for a home.
func LoadZoneRules ¶ added in v0.17.0
func LoadZoneRules(zoneName string, config []RuleConfiguration) (Rules, error)
LoadZoneRules create Rules as per config, for a zone named zoneName.
type ScriptConfig ¶ added in v0.17.0
type State ¶ added in v0.17.0
type State struct { Devices Devices HomeId tado.HomeId ZoneId tado.ZoneId HomeState HomeState ZoneState ZoneState }
State is the input argument for Evaluate() functions. It summarizes the state of a Tadoº installation, i.e. the state of the house, its registered mobile devices and its zones.
type TadoClient ¶ added in v0.17.0
type TadoClient interface { SetPresenceLockWithResponse(ctx context.Context, homeId tado.HomeId, body tado.SetPresenceLockJSONRequestBody, reqEditors ...tado.RequestEditorFn) (*tado.SetPresenceLockResponse, error) DeletePresenceLockWithResponse(ctx context.Context, homeId tado.HomeId, reqEditors ...tado.RequestEditorFn) (*tado.DeletePresenceLockResponse, error) SetZoneOverlayWithResponse(ctx context.Context, homeId tado.HomeId, zoneId tado.ZoneId, body tado.SetZoneOverlayJSONRequestBody, reqEditors ...tado.RequestEditorFn) (*tado.SetZoneOverlayResponse, error) DeleteZoneOverlayWithResponse(ctx context.Context, homeId tado.HomeId, zoneId tado.ZoneId, reqEditors ...tado.RequestEditorFn) (*tado.DeleteZoneOverlayResponse, error) }
Click to show internal directories.
Click to hide internal directories.