state_change

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

TRIGGERS Plugin

Documentation

Documentation

Index

Constants

View Source
const (
	Name         = "state_change"
	FunctionName = "automationTriggerStateChanged"
	Version      = "0.0.1"
)

Variables

Functions

func New

func New() plugins.Pluggable

New ...

func NewTrigger

func NewTrigger(eventBus bus.Bus) triggers.ITrigger

func NewTriggerParams

func NewTriggerParams() m.TriggerParams

Types

type EventEntityState

type EventEntityState struct {
	EntityId    common.EntityId     `json:"entity_id"`
	Value       interface{}         `json:"value"`
	State       *events.EntityState `json:"state"`
	Attributes  m.AttributeValue    `json:"attributes"`
	Settings    m.AttributeValue    `json:"settings"`
	LastChanged *time.Time          `json:"last_changed"`
	LastUpdated *time.Time          `json:"last_updated"`
}

type Trigger

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

func (*Trigger) AsyncAttach

func (t *Trigger) AsyncAttach(wg *sync.WaitGroup)

func (*Trigger) FunctionName

func (t *Trigger) FunctionName() string

FunctionName ...

func (*Trigger) Name

func (t *Trigger) Name() string

func (*Trigger) Subscribe

func (t *Trigger) Subscribe(options triggers.Subscriber) error

Subscribe ...

func (*Trigger) Unsubscribe

func (t *Trigger) Unsubscribe(options triggers.Subscriber) error

Unsubscribe ...

type TriggerStateChangedMessage

type TriggerStateChangedMessage struct {
	StorageSave     bool             `json:"storage_save"`
	DoNotSaveMetric bool             `json:"do_not_save_metric"`
	PluginName      string           `json:"plugin_name"`
	EntityId        common.EntityId  `json:"entity_id"`
	OldState        EventEntityState `json:"old_state"`
	NewState        EventEntityState `json:"new_state"`
}

Jump to

Keyboard shortcuts

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