events

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OwnerUser   = OwnerType("user")
	OwnerSystem = OwnerType("system")
)

Variables

This section is empty.

Functions

func EventName added in v0.12.0

func EventName(event interface{}) string

Types

type CommandClearStorage added in v0.13.0

type CommandClearStorage struct {
	Num int64 `json:"num"`
}

type CommandCreateBackup added in v0.13.0

type CommandCreateBackup struct {
	Scheduler bool `json:"scheduler"`
}

type CommandDisableTask added in v0.12.0

type CommandDisableTask struct {
	Id int64 `json:"id"`
}

CommandDisableTask ...

type CommandDisableTrigger added in v0.12.0

type CommandDisableTrigger struct {
	Id int64 `json:"id"`
}

CommandDisableTrigger ...

type CommandEnableTask added in v0.12.0

type CommandEnableTask struct {
	Id int64 `json:"id"`
}

CommandEnableTask ...

type CommandEnableTrigger added in v0.12.0

type CommandEnableTrigger struct {
	Id int64 `json:"id"`
}

CommandEnableTrigger ...

type CommandLoadEntity added in v0.12.0

type CommandLoadEntity struct {
	EntityId common.EntityId `json:"entity_id"`
}

CommandLoadEntity ...

type CommandSendFileToTelegram added in v0.13.0

type CommandSendFileToTelegram struct {
	Filename  string          `json:"filename"`
	EntityId  common.EntityId `json:"entity_id"`
	Chunks    bool            `json:"chunks"`
	ChunkSize int             `json:"chunk_size"`
}

type CommandTerminal added in v0.15.0

type CommandTerminal struct {
	Common
	Text string `json:"text"`
}

CommandTerminal ...

type CommandUnloadEntity added in v0.12.0

type CommandUnloadEntity struct {
	EntityId common.EntityId `json:"entity_id"`
}

CommandUnloadEntity ...

type Common added in v0.15.0

type Common struct {
	Owner     OwnerType `json:"owner"`
	SessionID string    `json:"session_id"`
	User      *m.User   `json:"user"`
}

func (Common) UserId added in v0.17.0

func (c Common) UserId() int64

type EntityState added in v0.15.0

type EntityState struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	ImageUrl    *string `json:"image_url"`
	Icon        *string `json:"icon"`
}

EntityState ...

type EventActionCompleted added in v0.12.0

type EventActionCompleted struct {
	Id  int64           `json:"id"`
	Ctx context.Context `json:"ctx"`
}

type EventActionLoaded added in v0.12.0

type EventActionLoaded struct {
	Id int64 `json:"id"`
}

EventActionLoaded ...

type EventActionUnloaded added in v0.12.0

type EventActionUnloaded struct {
	Id int64 `json:"id"`
}

EventActionUnloaded ...

type EventAddedActionModel added in v0.12.0

type EventAddedActionModel struct {
	Id int64 `json:"id"`
}

EventAddedActionModel ...

type EventAddedConditionModel added in v0.12.0

type EventAddedConditionModel struct {
	Id int64 `json:"id"`
}

EventAddedConditionModel ...

type EventCallAction

type EventCallAction struct {
	Id  int64           `json:"id"`
	Ctx context.Context `json:"ctx"`
}

EventCallAction ...

type EventCallEntityAction added in v0.12.0

type EventCallEntityAction struct {
	PluginName *string                `json:"plugin_name"`
	EntityId   *common.EntityId       `json:"entity_id"`
	ActionName string                 `json:"action_name"`
	Args       map[string]interface{} `json:"args"`
	AreaId     *int64                 `json:"area_id"`
	Tags       []string               `json:"tags"`
}

EventCallEntityAction ...

type EventCallScene

type EventCallScene struct {
	PluginName string                 `json:"type"`
	EntityId   common.EntityId        `json:"entity_id"`
	Args       map[string]interface{} `json:"args"`
}

EventCallScene ...

type EventCallTaskAction

type EventCallTaskAction struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

EventCallTaskAction ...

type EventCallTrigger added in v0.12.0

type EventCallTrigger struct {
	Id  int64           `json:"id"`
	Ctx context.Context `json:"ctx"`
}

EventCallTrigger ...

type EventCreatedBackup added in v0.12.0

type EventCreatedBackup struct {
	Name      string `json:"name"`
	Scheduler bool   `json:"scheduler"`
}

type EventCreatedEntityModel added in v0.12.0

type EventCreatedEntityModel struct {
	EntityId common.EntityId `json:"entity_id"`
}

EventCreatedEntityModel ...

type EventCreatedScriptModel added in v0.12.0

type EventCreatedScriptModel struct {
	Common
	ScriptId int64     `json:"script_id"`
	Script   *m.Script `json:"script"`
}

EventCreatedScriptModel ...

type EventCreatedTaskModel added in v0.12.0

type EventCreatedTaskModel struct {
	Id int64 `json:"id"`
}

EventCreatedTaskModel ...

type EventCreatedTriggerModel added in v0.12.0

type EventCreatedTriggerModel struct {
	Id int64 `json:"id"`
}

EventCreatedTriggerModel ...

type EventCreatedZigbee2mqttModel added in v0.12.0

type EventCreatedZigbee2mqttModel struct {
	Id     int64          `json:"id"`
	Bridge *m.Zigbee2mqtt `json:"bridge"`
}

EventCreatedZigbee2mqttModel ...

type EventDirectMessage added in v0.9.5

type EventDirectMessage struct {
	UserID    int64       `json:"user_id"`
	SessionID string      `json:"session_id"`
	Query     string      `json:"query"`
	Message   interface{} `json:"message"`
}

type EventEntityLoaded added in v0.12.0

type EventEntityLoaded struct {
	EntityId   common.EntityId `json:"entity_id"`
	PluginName string          `json:"plugin_name"`
}

EventEntityLoaded ...

type EventEntitySetState

type EventEntitySetState struct {
	EntityId        common.EntityId  `json:"entity_id"`
	NewState        *string          `json:"new_state"`
	AttributeValues m.AttributeValue `json:"attribute_values"`
	SettingsValue   m.AttributeValue `json:"settings_value"`
	StorageSave     bool             `json:"storage_save"`
}

EventEntitySetState ...

type EventEntityState added in v0.15.0

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

EventEntityState ...

func (EventEntityState) Compare added in v0.15.0

func (e1 EventEntityState) Compare(e2 EventEntityState) (ident bool)

Compare ...

type EventEntityUnloaded added in v0.12.0

type EventEntityUnloaded struct {
	EntityId   common.EntityId `json:"entity_id"`
	PluginName string          `json:"plugin_name"`
}

EventEntityUnloaded ...

type EventGetLastState

type EventGetLastState struct {
	EntityId common.EntityId `json:"entity_id"`
}

EventGetLastState ...

type EventGetServerVersion added in v0.17.0

type EventGetServerVersion struct {
	Common
}

EventGetServerVersion ...

type EventLastStateChanged added in v0.8.6

type EventLastStateChanged struct {
	PluginName string           `json:"plugin_name"`
	EntityId   common.EntityId  `json:"entity_id"`
	OldState   EventEntityState `json:"old_state"`
	NewState   EventEntityState `json:"new_state"`
}

EventLastStateChanged ...

type EventMqttNewClient added in v0.12.0

type EventMqttNewClient struct {
	ClientId string
}

type EventPluginLoaded added in v0.12.0

type EventPluginLoaded struct {
	PluginName string `json:"plugin_name"`
}

EventPluginLoaded ...

type EventPluginUnloaded added in v0.12.0

type EventPluginUnloaded struct {
	PluginName string `json:"plugin_name"`
}

EventPluginUnloaded ...

type EventRemovedActionModel added in v0.12.0

type EventRemovedActionModel struct {
	Id int64 `json:"id"`
}

EventRemovedActionModel ...

type EventRemovedBackup added in v0.12.0

type EventRemovedBackup struct {
	Name string `json:"name"`
}

type EventRemovedConditionModel added in v0.12.0

type EventRemovedConditionModel struct {
	Id int64 `json:"id"`
}

EventRemovedConditionModel ...

type EventRemovedScriptModel added in v0.12.0

type EventRemovedScriptModel struct {
	Common
	ScriptId int64     `json:"script_id"`
	Script   *m.Script `json:"script"`
}

EventRemovedScriptModel ...

type EventRemovedTaskModel added in v0.12.0

type EventRemovedTaskModel struct {
	Id int64 `json:"id"`
}

EventRemovedTaskModel ...

type EventRemovedTriggerModel added in v0.12.0

type EventRemovedTriggerModel struct {
	Id int64 `json:"id"`
}

EventRemovedTriggerModel ...

type EventRemovedVariableModel added in v0.12.0

type EventRemovedVariableModel struct {
	Name string `json:"name"`
}

EventRemovedVariableModel ...

type EventRemovedZigbee2mqttModel added in v0.12.0

type EventRemovedZigbee2mqttModel struct {
	Id int64 `json:"id"`
}

EventRemovedZigbee2mqttModel ...

type EventServerVersion added in v0.17.0

type EventServerVersion struct {
	Common
	Version version.Version `json:"version"`
}

EventServerVersion ...

type EventServiceRestarted added in v0.12.0

type EventServiceRestarted struct {
	Service string `json:"service"`
}

type EventServiceStarted added in v0.12.0

type EventServiceStarted struct {
	Service string `json:"service"`
}

type EventServiceStopped added in v0.12.0

type EventServiceStopped struct {
	Service string `json:"service"`
}

type EventStartedRestore added in v0.12.0

type EventStartedRestore struct {
	Name string `json:"name"`
}

type EventStateChanged

type EventStateChanged 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"`
}

EventStateChanged ...

type EventTaskCompleted added in v0.12.0

type EventTaskCompleted struct {
	Id  int64           `json:"id"`
	Ctx context.Context `json:"ctx"`
}

type EventTaskLoaded added in v0.12.0

type EventTaskLoaded struct {
	Id int64 `json:"id"`
}

EventTaskLoaded ...

type EventTaskUnloaded added in v0.12.0

type EventTaskUnloaded struct {
	Id int64 `json:"id"`
}

EventTaskUnloaded ...

type EventTriggerCompleted added in v0.12.0

type EventTriggerCompleted struct {
	Id       int64            `json:"id"`
	Args     *TriggerMessage  `json:"args"`
	EntityId *common.EntityId `json:"entity_id,omitempty"`
	Ctx      context.Context  `json:"ctx"`
}

type EventTriggerLoaded added in v0.12.0

type EventTriggerLoaded struct {
	Id int64 `json:"id"`
}

EventTriggerLoaded ...

type EventTriggerUnloaded added in v0.12.0

type EventTriggerUnloaded struct {
	Id int64 `json:"id"`
}

EventTriggerUnloaded ...

type EventUpdateUserLocation added in v0.9.5

type EventUpdateUserLocation struct {
	UserID   int64   `json:"user_id"`
	Lat      float32 `json:"lat"`
	Lon      float32 `json:"lon"`
	Accuracy float32 `json:"accuracy"`
}

EventUpdateUserLocation ...

type EventUpdatedActionModel added in v0.12.0

type EventUpdatedActionModel struct {
	Id     int64     `json:"id"`
	Action *m.Action `json:"action"`
}

EventUpdatedActionModel ...

type EventUpdatedConditionModel added in v0.12.0

type EventUpdatedConditionModel struct {
	Id int64 `json:"id"`
}

EventUpdatedConditionModel ...

type EventUpdatedEntityModel added in v0.12.0

type EventUpdatedEntityModel struct {
	EntityId common.EntityId `json:"entity_id"`
}

EventUpdatedEntityModel ...

type EventUpdatedMetric added in v0.13.0

type EventUpdatedMetric struct {
	EntityId common.EntityId `json:"entity_id"`
}

EventUpdatedMetric ...

type EventUpdatedScriptModel added in v0.12.0

type EventUpdatedScriptModel struct {
	Common
	ScriptId  int64     `json:"script_id"`
	Script    *m.Script `json:"script"`
	OldScript *m.Script `json:"old_script"`
}

EventUpdatedScriptModel ...

type EventUpdatedTaskModel added in v0.12.0

type EventUpdatedTaskModel struct {
	Id int64 `json:"id"`
}

EventUpdatedTaskModel ...

type EventUpdatedTriggerModel added in v0.12.0

type EventUpdatedTriggerModel struct {
	Id int64 `json:"id"`
}

EventUpdatedTriggerModel ...

type EventUpdatedVariableModel added in v0.12.0

type EventUpdatedVariableModel struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

EventUpdatedVariableModel ...

type EventUpdatedZigbee2mqttModel added in v0.12.0

type EventUpdatedZigbee2mqttModel struct {
	Id     int64          `json:"id"`
	Bridge *m.Zigbee2mqtt `json:"bridge"`
}

EventUpdatedZigbee2mqttModel ...

type EventUploadedBackup added in v0.12.0

type EventUploadedBackup struct {
	Name string `json:"name"`
}

type EventUserSignedIn added in v0.17.1

type EventUserSignedIn struct {
	User *m.User `json:"user"`
}

type OwnerType added in v0.15.0

type OwnerType string

type TriggerMessage added in v0.16.1

type TriggerMessage struct {
	Payload     interface{}      `json:"payload"`
	TriggerName string           `json:"trigger_name"`
	EntityId    *common.EntityId `json:"entity_id"`
}

Jump to

Keyboard shortcuts

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