automation

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ActionFunc = "automationAction"

ActionFunc ...

View Source
const ConditionFunc = "automationCondition"

ConditionFunc ...

View Source
const TriggerFunc = "automationTrigger"

TriggerFunc ...

Variables

This section is empty.

Functions

func NewTaskManager added in v0.12.0

func NewTaskManager(
	eventBus bus.Bus,
	scriptService scripts.ScriptService,
	sup supervisor.Supervisor,
	adaptors *adaptors.Adaptors) (manager *taskManager)

NewTaskManager ...

func NewTriggerManager added in v0.12.0

func NewTriggerManager(eventBus bus.Bus,
	scriptService scripts.ScriptService,
	sup supervisor.Supervisor,
	adaptors *adaptors.Adaptors) (manager *triggerManager)

Types

type Action

type Action struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Action ...

func NewAction

func NewAction(scriptService scripts.ScriptService,
	eventBus bus.Bus,
	model *m.Action) (action *Action, err error)

NewAction ...

func (*Action) Remove added in v0.12.0

func (a *Action) Remove()

func (*Action) Run

func (a *Action) Run(entityId *common.EntityId) (result string, err error)

Run ...

type ActionBind

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

Javascript Binding

Action

.callAction(entityId, action, args)

func NewActionBind

func NewActionBind(action *Action) *ActionBind

NewActionBind...

type Automation

type Automation interface {
	Start() (err error)
	Shutdown() (err error)
	Restart()
	TaskIsLoaded(id int64) bool
	TriggerIsLoaded(id int64) bool
	TaskTelemetry(id int64) telemetry.Telemetry
}

Automation ...

func NewAutomation

func NewAutomation(lc fx.Lifecycle,
	eventBus bus.Bus,
	scriptService scripts.ScriptService,
	sup supervisor.Supervisor,
	adaptors *adaptors.Adaptors) (auto Automation)

NewAutomation ...

type Condition

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

Condition ...

func NewCondition

func NewCondition(scriptService scripts.ScriptService,
	model *m.Condition) (condition *Condition, err error)

NewCondition ...

func (*Condition) Check

func (r *Condition) Check(ctx context.Context) (result string, err error)

Check ...

func (*Condition) Status

func (r *Condition) Status() bool

Status ...

func (*Condition) Stop added in v0.12.0

func (r *Condition) Stop()

type ConditionBind

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

ConditionBind...

func NewConditionBind

func NewConditionBind(condition *Condition) *ConditionBind

Javascript Binding

Condition

type ConditionGroup

type ConditionGroup struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ConditionGroup ...

func NewConditionGroup

func NewConditionGroup(t common.ConditionType) *ConditionGroup

NewConditionGroup ...

func (*ConditionGroup) AddCondition

func (c *ConditionGroup) AddCondition(condition *Condition)

AddCondition ...

func (*ConditionGroup) Check

func (c *ConditionGroup) Check(entityId *common.EntityId) (state bool, err error)

Check ...

func (*ConditionGroup) Stop added in v0.12.0

func (c *ConditionGroup) Stop()

type Task

type Task struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Task ...

func NewTask

func NewTask(eventBus bus.Bus,
	scriptService scripts.ScriptService,
	model *m.Task) *Task

NewTask ...

func (*Task) Id

func (t *Task) Id() int64

Id ...

func (*Task) Name

func (t *Task) Name() string

Name ...

func (*Task) Start

func (t *Task) Start()

Start ...

func (*Task) Stop

func (t *Task) Stop()

Stop ...

func (*Task) Telemetry added in v0.12.0

func (t *Task) Telemetry() telemetry.Telemetry

type Trigger

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

Trigger ...

func NewTrigger

func NewTrigger(
	eventBus bus.Bus,
	scriptService scripts.ScriptService,
	model *m.Trigger,
	rawPlugin triggers.IGetTrigger) (tr *Trigger, err error)

NewTrigger ...

func (*Trigger) Start

func (tr *Trigger) Start()

Start ...

func (*Trigger) Stop

func (tr *Trigger) Stop()

Stop ...

type TriggerBind

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

Javascript Binding

Trigger

func NewTriggerBind

func NewTriggerBind(tr *Trigger) *TriggerBind

NewTriggerBind...

type TriggerSubscriber added in v0.13.2

type TriggerSubscriber struct {
	Engine     *scripts.EngineWatcher
	Subscriber triggers.Subscriber
}

Jump to

Keyboard shortcuts

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