events

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: 8 Imported by: 1

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func EventName

func EventName(event interface{}) string

Types

type CommandClearStorage

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

type CommandCreateBackup

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

type CommandDisableTask

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

CommandDisableTask ...

type CommandDisableTrigger

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

CommandDisableTrigger ...

type CommandEnableTask

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

CommandEnableTask ...

type CommandEnableTrigger

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

CommandEnableTrigger ...

type CommandLoadEntity

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

CommandLoadEntity ...

type CommandSTT

type CommandSTT struct {
	Payload io.Reader `json:"payload,omitempty"`
}

CommandSTT ...

type CommandSendFileToTelegram

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

type CommandTerminal

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

CommandTerminal ...

type CommandUnloadEntity

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

CommandUnloadEntity ...

type Common

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

func (Common) UserId

func (c Common) UserId() int64

type EntityState

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

EntityState ...

type EventActionCompleted

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

type EventActionLoaded

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

EventActionLoaded ...

type EventActionUnloaded

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

EventActionUnloaded ...

type EventAddedActionModel

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

EventAddedActionModel ...

type EventAddedConditionModel

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

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

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

EventCallTrigger ...

type EventCreatedBackup

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

type EventCreatedEntityModel

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

EventCreatedEntityModel ...

type EventCreatedScriptModel

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

EventCreatedScriptModel ...

type EventCreatedTaskModel

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

EventCreatedTaskModel ...

type EventCreatedTriggerModel

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

EventCreatedTriggerModel ...

type EventCreatedZigbee2mqttModel

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

EventCreatedZigbee2mqttModel ...

type EventDirectMessage

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

type EventEntityLoaded

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

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

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

Compare ...

type EventEntityUnloaded

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

type EventGetServerVersion struct {
	Common
}

EventGetServerVersion ...

type EventGetStateById

type EventGetStateById struct {
	Common
	EntityId  common.EntityId `json:"entity_id"`
	StorageId int64           `json:"storage_id"`
}

EventGetStateById ...

type EventLastStateChanged

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

type EventMqttNewClient struct {
	ClientId string
}

type EventPluginLoaded

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

EventPluginLoaded ...

type EventPluginUnloaded

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

EventPluginUnloaded ...

type EventRemovedActionModel

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

EventRemovedActionModel ...

type EventRemovedBackup

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

type EventRemovedConditionModel

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

EventRemovedConditionModel ...

type EventRemovedScriptModel

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

EventRemovedScriptModel ...

type EventRemovedTaskModel

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

EventRemovedTaskModel ...

type EventRemovedTriggerModel

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

EventRemovedTriggerModel ...

type EventRemovedVariableModel

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

EventRemovedVariableModel ...

type EventRemovedZigbee2mqttModel

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

EventRemovedZigbee2mqttModel ...

type EventServerVersion

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

EventServerVersion ...

type EventServiceRestarted

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

type EventServiceStarted

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

type EventServiceStopped

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

type EventStartedRestore

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

type EventStateById

type EventStateById struct {
	UserID     int64            `json:"user_id"`
	SessionID  string           `json:"session_id"`
	EntityId   common.EntityId  `json:"entity_id"`
	StorageId  int64            `json:"storage_id"`
	PluginName string           `json:"plugin_name"`
	OldState   EventEntityState `json:"old_state"`
	NewState   EventEntityState `json:"new_state"`
}

EventStateById ...

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

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

type EventTaskLoaded

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

EventTaskLoaded ...

type EventTaskUnloaded

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

EventTaskUnloaded ...

type EventTriggerCompleted

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

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

EventTriggerLoaded ...

type EventTriggerUnloaded

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

EventTriggerUnloaded ...

type EventUpdateUserLocation

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

EventUpdateUserLocation ...

type EventUpdatedActionModel

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

EventUpdatedActionModel ...

type EventUpdatedConditionModel

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

EventUpdatedConditionModel ...

type EventUpdatedEntityModel

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

EventUpdatedEntityModel ...

type EventUpdatedMetric

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

EventUpdatedMetric ...

type EventUpdatedScriptModel

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

EventUpdatedScriptModel ...

type EventUpdatedTaskModel

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

EventUpdatedTaskModel ...

type EventUpdatedTriggerModel

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

EventUpdatedTriggerModel ...

type EventUpdatedVariableModel

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

EventUpdatedVariableModel ...

type EventUpdatedZigbee2mqttModel

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

EventUpdatedZigbee2mqttModel ...

type EventUploadedBackup

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

type EventUserSignedIn

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

type OwnerType

type OwnerType string

type TriggerMessage

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