Documentation
¶
Index ¶
- Constants
- func NewAttributes() map[string]*Attribute
- func PreviewTemplate(items []*Template, template *TemplateContent) (data string, err error)
- func TemplateGetParents(items Templates, result *Templates, s string)
- type Action
- type AlexaIntent
- type AlexaSkill
- type AppConfig
- type Area
- type AreaPayload
- type Attribute
- func (a Attribute) ArrayString() (result []string)
- func (a *Attribute) Bool() bool
- func (a Attribute) Compare(b *Attribute) (ident bool)
- func (a Attribute) Decrypt() string
- func (a *Attribute) Float64() float64
- func (a Attribute) Int64() int64
- func (a Attribute) Map() Attributes
- func (a Attribute) Point() (point Point)
- func (a Attribute) String() string
- func (a *Attribute) Time() time.Time
- type AttributeValue
- type Attributes
- type AutomationStatistic
- type Backup
- type Backups
- type Condition
- type Dashboard
- type DashboardCard
- type DashboardCardItem
- type DashboardTab
- type EntitiesStatistic
- type Entity
- type EntityAction
- type EntityActionShort
- type EntityPayload
- type EntitySettings
- type EntityShort
- type EntityState
- type EntityStateShort
- type EntityStorage
- type EntityStorageList
- type GateConfig
- type GeoLocation
- type Image
- type ImageFilterList
- type Keys
- type Log
- type LogQuery
- type Message
- type MessageDelivery
- type MessageDeliveryQuery
- type MessagePayload
- type MessageStatus
- type MessageType
- type Metric
- type MetricDataItem
- type MetricOptions
- type MetricOptionsItem
- type NewNotifrMessage
- type NewTask
- type NewTrigger
- type Permission
- type Plugin
- type PluginOptions
- type PluginOptionsJs
- type PluginSettings
- type Plugins
- type Point
- type RegionInfo
- type Role
- type RunHistory
- type RunStory
- type Script
- type ScriptInfo
- type ScriptVersion
- type ScriptVersions
- type ScriptsStatistic
- type Statistic
- type Subscription
- type Tag
- type Task
- type TelegramChat
- type Template
- type TemplateContent
- type TemplateField
- type TemplateRender
- type TemplateStatus
- type TemplateTree
- type TemplateType
- type Templates
- type Trigger
- type TriggerParams
- type TriggerPayload
- type UpdateTask
- type UpdateTrigger
- type User
- type UserDevice
- type UserHistory
- type UserMeta
- type Validity
- type Variable
- type Version
- type Zigbee2mqtt
- type Zigbee2mqttDevice
- type Zigbee2mqttInfo
Constants ¶
const ( // MessageStatusNew ... MessageStatusNew = MessageStatus("new") // MessageStatusInProgress ... MessageStatusInProgress = MessageStatus("in_progress") // MessageStatusSucceed ... MessageStatusSucceed = MessageStatus("succeed") // MessageStatusError ... MessageStatusError = MessageStatus("error") )
const ( // TemplateStatusActive ... TemplateStatusActive = TemplateStatus("active") // TemplateStatusUnactive ... TemplateStatusUnactive = TemplateStatus("inactive") // TemplateTypeItem ... TemplateTypeItem = TemplateType("item") // TemplateTypeTemplate ... TemplateTypeTemplate = TemplateType("template") )
const HistoryMax = 8
HistoryMax ...
Variables ¶
This section is empty.
Functions ¶
func NewAttributes ¶
func PreviewTemplate ¶
func PreviewTemplate(items []*Template, template *TemplateContent) (data string, err error)
PreviewTemplate ...
func TemplateGetParents ¶
TemplateGetParents ...
Types ¶
type Action ¶
type Action struct {
Id int64 `json:"id"`
Name string `json:"name" validate:"required,lte=255"`
Script *Script `json:"script"`
ScriptId *int64 `json:"script_id"`
Entity *Entity `json:"entity"`
EntityId *common.EntityId `json:"entity_id"`
EntityActionName *string `json:"entity_action_name"`
AreaId *int64 `json:"area_id"`
Area *Area `json:"area"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Action ...
type AlexaIntent ¶
type AlexaIntent struct {
Name string `json:"name"`
AlexaSkillId int64 `json:"alexa_skill_id" validate:"required"`
Script *Script `json:"script"`
ScriptId int64 `json:"script_id" validate:"required"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
AlexaIntent ...
type AlexaSkill ¶
type AlexaSkill struct {
Id int64 `json:"id"`
SkillId string `json:"skill_id" validate:"required"`
Description string `json:"description"`
Status common.StatusType `json:"status" validate:"required"`
Intents []*AlexaIntent `json:"intents"`
Script *Script `json:"script"`
ScriptId *int64 `json:"script_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
AlexaSkill ...
type AppConfig ¶
type AppConfig struct {
PgUser string `json:"pg_user" env:"PG_USER"`
PgPass string `json:"pg_pass" env:"PG_PASS"`
PgHost string `json:"pg_host" env:"PG_HOST"`
PgName string `json:"pg_name" env:"PG_NAME"`
PgPort string `json:"pg_port" env:"PG_PORT"`
SnapshotDir string `json:"snapshot_dir" env:"SNAPSHOT_DIR"`
Mode common.RunMode `json:"mode" env:"MODE"`
AlexaHost string `json:"alexa_host" env:"ALEXA_HOST"`
Lang string `json:"lang" env:"LANG"`
Domain string `json:"domain" env:"DOMAIN"`
PgMaxIdleConns int `json:"pg_max_idle_conns" env:"PG_MAX_IDLE_CONNS"`
PgMaxOpenConns int `json:"pg_max_open_conns" env:"PG_MAX_OPEN_CONNS"`
PgConnMaxLifeTime int `json:"pg_conn_max_life_time" env:"PG_CONN_MAX_LIFE_TIME"`
MqttPort int `json:"mqtt_port" env:"MQTT_PORT"`
MqttRetryInterval time.Duration `json:"mqtt_retry_interval" env:"MQTT_RETRY_INTERVAL"`
MqttRetryCheckInterval time.Duration `json:"mqtt_retry_check_interval" env:"MQTT_RETRY_CHECK_INTERVAL"`
MqttSessionExpiryInterval time.Duration `json:"mqtt_session_expiry_interval" env:"MQTT_SESSION_EXPIRY_INTERVAL"`
MqttSessionExpireCheckInterval time.Duration `json:"mqtt_session_expire_check_interval" env:"MQTT_SESSION_EXPIRE_CHECK_INTERVAL"`
MqttMaxInflight int `json:"mqtt_max_inflight" env:"MQTT_MAX_INFLIGHT"`
MqttMaxAwaitRel int `json:"mqtt_max_await_rel" env:"MQTT_MAX_AWAIT_REL"`
MqttMaxMsgQueue int `json:"mqtt_max_msg_queue" env:"MQTT_MAX_MSG_QUEUE"`
MqttDeliverMode int `json:"mqtt_deliver_mode" env:"MQTT_DELIVER_MODE"`
AlexaPort int `json:"alexa_port" env:"ALEXA_PORT"`
ApiHttpPort int `json:"api_http_port" env:"API_HTTP_PORT"`
ApiHttpsPort int `json:"api_https_port" env:"API_HTTPS_PORT"`
PgDebug bool `json:"pg_debug" env:"PG_DEBUG"`
AutoMigrate bool `json:"auto_migrate" env:"AUTO_MIGRATE"`
MqttQueueQos0Messages bool `json:"mqtt_queue_qos_0_messages" env:"MQTT_QUEUE_QOS_0_MESSAGES"`
Logging bool `json:"logging" env:"LOGGING"`
ColoredLogging bool `json:"colored_logging" env:"COLORED_LOGGING"`
ApiSwagger bool `json:"api_swagger" env:"API_SWAGGER"`
ApiDebug bool `json:"api_debug" env:"API_DEBUG"`
ApiGzip bool `json:"api_gzip" env:"API_GZIP"`
RootMode bool `json:"root_mode" env:"ROOT_MODE"`
RootSecret string `json:"root_secret" env:"ROOT_SECRET"`
Pprof bool `json:"pprof" env:"PPROF"`
GateClientId string `json:"gate_client_id" env:"GATE_CLIENT_ID"`
GateClientSecretKey string `json:"gate_client_secret_key" env:"GATE_CLIENT_SECRET_KEY"`
GateClientServerHost string `json:"gate_client_server_host" env:"GATE_CLIENT_SERVER_HOST"`
GateClientServerPort int `json:"gate_client_server_port" env:"GATE_CLIENT_SERVER_PORT"`
GateClientPoolIdleSize int `json:"gate_client_pool_idle_size" env:"GATE_CLIENT_POOL_IDLE_SIZE"`
GateClientPoolMaxSize int `json:"gate_client_pool_max_size" env:"GATE_CLIENT_POOL_MAX_SIZE"`
}
AppConfig ...
type Area ¶
type Area struct {
Polygon []Point `json:"polygon"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name" validate:"required"`
Description string `json:"description"`
Center Point `json:"center"`
Id int64 `json:"id"`
Zoom float32 `json:"zoom"`
Resolution float32 `json:"resolution"`
}
Area ...
type AreaPayload ¶
type Attribute ¶
type Attribute struct {
Name string `json:"name"`
Type common.AttributeType `json:"type"`
Value interface{} `json:"value,omitempty"`
}
Attribute ...
type Attributes ¶
Attributes ...
func (Attributes) Deserialize ¶
func (a Attributes) Deserialize(data AttributeValue) (changed bool, err error)
Deserialize ...
type AutomationStatistic ¶
type Condition ¶
type Condition struct {
Id int64 `json:"id"`
Name string `json:"name" validate:"required,lte=255"`
Script *Script `json:"script"`
ScriptId *int64 `json:"script_id" validate:"required"`
AreaId *int64 `json:"area_id"`
Area *Area `json:"area"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Condition ...
type Dashboard ¶
type Dashboard struct {
Tabs []*DashboardTab `json:"tabs"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name" validate:"required"`
Description string `json:"description"`
Id int64 `json:"id"`
AreaId *int64 `json:"area_id"`
Area *Area `json:"area"`
Entities map[common.EntityId]*Entity `json:"entities"`
Enabled bool `json:"enabled"`
}
Dashboard ...
type DashboardCard ¶
type DashboardCard struct {
Payload json.RawMessage `json:"payload"`
Items []*DashboardCardItem `json:"items"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Title string `json:"title" validate:"required"`
Id int64 `json:"id"`
Height int `json:"height" validate:"required"`
Width int `json:"width" validate:"required"`
Background *string `json:"background"`
Weight int `json:"weight"`
DashboardTabId int64 `json:"dashboard_tab_id" validate:"required"`
DashboardTab *DashboardTab `json:"dashboard_tab"`
Entities map[common.EntityId]*Entity `json:"entities"`
EntityId *common.EntityId `json:"entity_id"`
Entity *Entity `json:"entity"`
Enabled bool `json:"enabled"`
Hidden bool `json:"hidden"`
}
DashboardCard ...
type DashboardCardItem ¶
type DashboardCardItem struct {
Payload json.RawMessage `json:"payload"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Title string `json:"title" validate:"required"`
Type string `json:"type" validate:"required"`
Id int64 `json:"id"`
Weight int `json:"weight"`
DashboardCardId int64 `json:"dashboard_card_id" validate:"required"`
DashboardCard *DashboardCard `json:"dashboard_card"`
EntityId *common.EntityId `json:"entity_id"`
Entity *Entity `json:"entity"`
Enabled bool `json:"enabled"`
Hidden bool `json:"hidden"`
Frozen bool `json:"frozen"`
}
DashboardCardItem ...
type DashboardTab ¶
type DashboardTab struct {
Payload json.RawMessage `json:"payload"`
Cards []*DashboardCard `json:"cards"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name" validate:"required"`
Icon string `json:"icon"`
Id int64 `json:"id"`
ColumnWidth int `json:"column_width"`
Background *string `json:"background"`
Weight int `json:"weight"`
DashboardId int64 `json:"dashboard_id" validate:"required"`
Dashboard *Dashboard `json:"dashboard"`
Entities map[common.EntityId]*Entity `json:"entities"`
Gap bool `json:"gap"`
Enabled bool `json:"enabled"`
}
DashboardTab ...
type EntitiesStatistic ¶
type Entity ¶
type Entity struct {
Actions []*EntityAction `json:"actions"`
States []*EntityState `json:"states"`
Metrics []*Metric `json:"metrics"`
Scripts []*Script `json:"scripts"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Id common.EntityId `json:"id"`
Description string `json:"description"`
PluginName string `json:"plugin_name" validate:"required"`
Icon *string `json:"icon"`
Image *Image `json:"image"`
ImageId *int64 `json:"image_id"`
Area *Area `json:"area"`
AreaId *int64 `json:"area_id"`
Attributes Attributes `json:"attributes"`
Settings Attributes `json:"settings"`
ParentId *common.EntityId `json:"parent_id"`
Storage []*EntityStorage `json:"storage"`
Hidden bool `json:"hidden"`
AutoLoad bool `json:"auto_load"`
IsLoaded bool `json:"is_loaded"`
RestoreState bool `json:"restore_state"`
Tags []*Tag `json:"tags"`
}
Entity ...
type EntityAction ¶
type EntityAction struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Icon *string `json:"icon"`
EntityId common.EntityId `json:"entity_id" validate:"required"`
Image *Image `json:"image"`
ImageId *int64 `json:"image_id" validate:"required"`
Script *Script `json:"script"`
ScriptId *int64 `json:"script_id" validate:"required"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
EntityAction ...
type EntityActionShort ¶
type EntityActionShort struct {
Name string `json:"name"`
Description string `json:"description"`
ImageUrl *string `json:"image_url"`
Icon *string `json:"icon"`
}
EntityActionShort ...
type EntityPayload ¶
type EntityPayload struct {
AttributeSignature Attributes `json:"attribute_signature"`
}
EntityPayload ...
type EntitySettings ¶
type EntitySettings struct {
Settings Attributes `json:"settings"`
}
EntitySettings ...
type EntityShort ¶
type EntityShort struct {
Id common.EntityId `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Icon *string `json:"icon"`
ImageUrl *string `json:"image_url"`
Actions []EntityActionShort `json:"actions"`
States []EntityStateShort `json:"states"`
State *EntityStateShort `json:"state"`
Attributes Attributes `json:"attributes"`
Settings Attributes `json:"settings"`
Area *Area `json:"area"`
Metrics []*Metric `json:"metrics"`
Hidden bool `json:"hidden"`
}
todo: check EntityShort ...
type EntityState ¶
type EntityState struct {
Id int64 `json:"id"`
Name string `json:"name" validate:"max=254;required"`
Description string `json:"description"`
Icon *string `json:"icon"`
EntityId common.EntityId `json:"entity_id" validate:"required"`
Image *Image `json:"image"`
ImageId *int64 `json:"image_id" validate:"required"`
Style string `json:"style"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
EntityState ...
type EntityStateShort ¶
type EntityStateShort struct {
Name string `json:"name"`
Description string `json:"description"`
ImageUrl *string `json:"image_url"`
Icon *string `json:"icon"`
}
EntityStateShort ...
type EntityStorage ¶
type EntityStorage struct {
Id int64
State string
StateDescription string
EntityId common.EntityId
EntityDescription string
Attributes AttributeValue
CreatedAt time.Time
}
EntityStorage ...
type EntityStorageList ¶
type EntityStorageList struct {
Items []*EntityStorage
Attributes map[common.EntityId]Attributes
}
type GateConfig ¶
type GateConfig struct {
ApiHttpPort int `json:"api_http_port" env:"API_HTTP_PORT"`
ApiHttpsPort int `json:"api_https_port" env:"API_HTTPS_PORT"`
ApiDebug bool `json:"api_debug" env:"API_DEBUG"`
ApiGzip bool `json:"api_gzip" env:"API_GZIP"`
Domain string `json:"domain" env:"DOMAIN"`
Pprof bool `json:"pprof" env:"PPROF"`
Https bool `json:"https" env:"HTTPS"`
ProxyTimeout int `json:"proxy_timeout" env:"PROXY_TIMEOUT"`
ProxyIdleTimeout int `json:"proxy_idle_timeout" env:"PROXY_IDLE_TIMEOUT"`
ProxySecretKey string `json:"proxy_secret_key" env:"PROXY_SECRET_KEY"`
}
GateConfig ...
func (*GateConfig) ApiFullAddress ¶
func (c *GateConfig) ApiFullAddress() (scheme string)
func (*GateConfig) ApiScheme ¶
func (c *GateConfig) ApiScheme() (scheme string)
type GeoLocation ¶
type GeoLocation struct {
Status string `json:"status"`
Country string `json:"country"`
CountryCode string `json:"countryCode"`
Region string `json:"region"`
RegionName string `json:"regionName"`
City string `json:"city"`
Zip string `json:"zip"`
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
Timezone string `json:"timezone"`
Isp string `json:"isp"`
Org string `json:"org"`
As string `json:"as"`
Query string `json:"query"`
}
"status": "success", "country": "Russia", "countryCode": "RU", "region": "NVS", "regionName": "Novosibirsk Oblast", "city": "Novosibirsk", "zip": "630008", "lat": 54.9022, "lon": 83.0335, "timezone": "Asia/Novosibirsk", "isp": "Novotelecom Ltd.", "org": "Novotelecom ltd.", "as": "AS31200 Novotelecom Ltd", "query": "xxx.xxx.xxx.xxx"
type Image ¶
type Image struct {
Id int64 `json:"id"`
Thumb string `json:"thumb"`
Url string `json:"url"`
Image string `json:"image"`
MimeType string `json:"mime_type"`
Title string `json:"title"`
Size int64 `json:"size"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
}
Image ...
type ImageFilterList ¶
ImageFilterList ...
type Log ¶
type Log struct {
Id int64 `json:"id"`
Body string `json:"body" validate:"required"`
Level common.LogLevel `json:"level" validate:"required"`
Owner string `json:"owner"`
CreatedAt time.Time `json:"created_at"`
}
Log ...
type LogQuery ¶
type LogQuery struct {
StartDate *time.Time `json:"start_date"`
EndDate *time.Time `json:"end_date"`
Levels []string `json:"levels"`
}
LogQuery ...
type Message ¶
type Message struct {
Id int64 `json:"id"`
Type string `json:"type"`
Attributes AttributeValue `json:"attributes"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Message ...
type MessageDelivery ¶
type MessageDelivery struct {
Id int64 `json:"id"`
Message *Message `json:"message"`
MessageId int64 `json:"message_id"`
Address string `json:"address"`
EntityId *common.EntityId `json:"entity_id"`
Status MessageStatus `json:"status"`
ErrorMessageStatus *string `json:"error_message_status"`
ErrorMessageBody *string `json:"error_message_body"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
MessageDelivery ...
type MessageDeliveryQuery ¶
type MessageDeliveryQuery struct {
StartDate *time.Time `json:"start_date"`
EndDate *time.Time `json:"end_date"`
Types []string `json:"triggers"`
}
MessageDeliveryQuery ...
type MessagePayload ¶
type MessagePayload struct {
AttributeSignature Attributes `json:"attribute_signature"`
}
MessagePayload ...
type Metric ¶
type Metric struct {
Id int64 `json:"id"`
Name string `json:"name" validate:"max=254;required"`
Description string `json:"description" validate:"max=254"`
Options MetricOptions `json:"options"`
Data []*MetricDataItem `json:"data"`
Type common.MetricType `json:"type" validate:"required"`
Ranges []string `json:"ranges"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Metric ...
type MetricDataItem ¶
type MetricDataItem struct {
Value map[string]interface{} `json:"value"`
Metric *Metric `json:"metric"`
MetricId int64 `json:"metric_id"`
Time time.Time `json:"time"`
}
MetricDataItem ...
type MetricOptions ¶
type MetricOptions struct {
Items []MetricOptionsItem `json:"items"`
}
MetricOptions ...
type MetricOptionsItem ¶
type MetricOptionsItem struct {
Name string `json:"name"`
Description string `json:"description"`
Color string `json:"color"`
Translate string `json:"translate"`
Label string `json:"label"`
}
MetricOptionsItem ...
type NewNotifrMessage ¶
type NewNotifrMessage struct {
Type string `json:"type"`
BodyType string `json:"body_type"`
EmailFrom *string `json:"email_from"`
EmailSubject *string `json:"email_subject"`
EmailBody *string `json:"email_body"`
Template *string `json:"template"`
SmsText *string `json:"sms_text"`
SlackText *string `json:"slack_text"`
TelegramText *string `json:"telegram_text"`
Webpush *string `json:"webpush"`
Params map[string]interface{} `json:"params"`
Address string `json:"address"`
ChatID int64 `json:"chat_id"`
}
NewNotifrMessage ...
type NewTask ¶
type NewTask struct {
TriggerIds []int64 `json:"triggers" validate:"dive"`
ConditionIds []int64 `json:"conditions" validate:"dive"`
ActionIds []int64 `json:"actions" validate:"dive"`
Name string `json:"name" validate:"required,lte=255"`
Description string `json:"description" validate:"lte=255"`
Condition common.ConditionType `json:"condition" validate:"required,oneof=or and"`
Area *Area `json:"area"`
AreaId *int64 `json:"area_id"`
Enabled bool `json:"enabled"`
IsLoaded bool `json:"is_loaded"`
}
NewTask ...
type NewTrigger ¶
type NewTrigger struct {
Name string `json:"name" validate:"required,lte=255"`
PluginName string `json:"plugin_name" validate:"required,lte=255"`
Description string `json:"description"`
EntityIds []string `json:"entity_ids"`
ScriptId *int64 `json:"script_id"`
Payload Attributes `json:"payload"`
AreaId *int64 `json:"area_id"`
Enabled bool `json:"enabled"`
}
NewTrigger ...
type Permission ¶
type Permission struct {
Id int64 `json:"id"`
RoleName string `json:"role_name"`
PackageName string `json:"package_name"`
LevelName string `json:"level_name"`
}
Permission ...
type Plugin ¶
type Plugin struct {
Name string `json:"name"`
Version string `json:"version"`
Settings AttributeValue `json:"settings"`
Enabled bool `json:"enabled"`
System bool `json:"system"`
Actor bool `json:"actor"`
IsLoaded bool `json:"is_loaded"`
Triggers bool `json:"triggers"`
External bool `json:"external"`
}
Plugin ...
type PluginOptions ¶
type PluginOptions struct {
Javascript PluginOptionsJs `json:"javascript"`
ActorAttrs Attributes `json:"actor_attrs"`
ActorActions map[string]EntityActionShort `json:"actor_actions"`
ActorStates map[string]EntityStateShort `json:"actor_states"`
ActorSetts Attributes `json:"actor_setts"`
Setts Attributes `json:"setts"`
Triggers bool `json:"triggers"`
TriggerParams TriggerParams `json:"trigger_params"`
Actors bool `json:"actors"`
ActorCustomAttrs bool `json:"actor_custom_attrs"`
ActorCustomActions bool `json:"actor_custom_actions"`
ActorCustomStates bool `json:"actor_custom_states"`
ActorCustomSetts bool `json:"actor_custom_setts"`
}
PluginOptions ...
type PluginOptionsJs ¶
type PluginSettings ¶
type PluginSettings struct {
Settings Attributes `json:"settings"`
}
PluginSettings ...
type RegionInfo ¶
type RegionInfo struct {
Ip string `json:"ip"`
Version string `json:"version"`
City string `json:"city"`
Region string `json:"region"`
RegionCode string `json:"region_code"`
Country string `json:"country"`
CountryName string `json:"country_name"`
CountryCode string `json:"country_code"`
CountryCodeIso3 string `json:"country_code_iso3"`
CountryCapital string `json:"country_capital"`
CountryTld string `json:"country_tld"`
ContinentCode string `json:"continent_code"`
Postal string `json:"postal"`
Timezone string `json:"timezone"`
UtcOffset string `json:"utc_offset"`
CountryCallingCode string `json:"country_calling_code"`
Currency string `json:"currency"`
CurrencyName string `json:"currency_name"`
Languages string `json:"languages"`
Asn string `json:"asn"`
Org string `json:"org"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
CountryArea float64 `json:"country_area"`
CountryPopulation float64 `json:"country_population"`
InEu bool `json:"in_eu"`
}
"ip": "xxx.xxx.xxx.xxx", "version": "IPv4", "city": "Novosibirsk", "region": "Novosibirsk Oblast", "region_code": "NVS", "country": "RU", "country_name": "Russia", "country_code": "RU", "country_code_iso3": "RUS", "country_capital": "Moscow", "country_tld": ".ru", "continent_code": "EU", "in_eu": false, "postal": "630009", "latitude": 54.9022, "longitude": 83.0335, "timezone": "Asia/Novosibirsk", "utc_offset": "+0700", "country_calling_code": "+7", "currency": "RUB", "currency_name": "Ruble", "languages": "ru,tt,xal,cau,ady,kv,ce,tyv,cv,udm,tut,mns,bua,myv,mdf,chm,ba,inh,tut,kbd,krc,av,sah,nog", "country_area": 17100000.0, "country_population": 144478050.0, "asn": "AS31200", "org": "Novotelecom Ltd"
type Role ¶
type Role struct {
Name string `json:"name" validate:"max=254,required"`
Description string `json:"description"`
Parent *Role `json:"parent"`
Children []*Role `json:"children"`
AccessList map[string][]string `json:"access_list"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Role ...
type RunStory ¶
type RunStory struct {
Id int64 `json:"id"`
Start time.Time `json:"start"`
End *time.Time `json:"end"`
}
RunStory ...
type Script ¶
type Script struct {
Id int64 `json:"id"`
Lang ScriptLang `json:"lang" validate:"required"`
Name string `json:"name" validate:"max=254,required"`
Source string `json:"source"`
Description string `json:"description"`
Compiled string `json:"-"`
Versions ScriptVersions `json:"versions"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Info *ScriptInfo `json:"info"`
}
Script ...
type ScriptInfo ¶
type ScriptInfo struct {
AlexaIntents int `json:"alexa_intents"`
EntityActions int `json:"entity_actions"`
EntityScripts int `json:"entity_scripts"`
AutomationTriggers int `json:"automation_triggers"`
AutomationConditions int `json:"automation_conditions"`
AutomationActions int `json:"automation_actions"`
}
type ScriptVersion ¶
type ScriptVersions ¶
type ScriptVersions []*ScriptVersion
func (ScriptVersions) Len ¶
func (l ScriptVersions) Len() int
func (ScriptVersions) Less ¶
func (l ScriptVersions) Less(i, j int) bool
func (ScriptVersions) Swap ¶
func (l ScriptVersions) Swap(i, j int)
type ScriptsStatistic ¶
type Subscription ¶
Subscription represents a PushSubscription object from the Push API
type Task ¶
type Task struct {
Triggers []*Trigger `json:"triggers" validate:"dive"`
Conditions []*Condition `json:"conditions" validate:"dive"`
Actions []*Action `json:"actions" validate:"dive"`
Telemetry telemetry.Telemetry `json:"telemetry"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name" validate:"required,lte=255"`
Description string `json:"description" validate:"lte=255"`
Condition common.ConditionType `json:"condition" validate:"required,oneof=or and"`
Id int64 `json:"id"`
Area *Area `json:"area"`
AreaId *int64 `json:"area_id"`
Enabled bool `json:"enabled"`
IsLoaded bool `json:"is_loaded"`
}
Task ...
type TelegramChat ¶
type TelegramChat struct {
EntityId common.EntityId
ChatId int64
Username string
CreatedAt time.Time
}
TelegramChat ...
type Template ¶
type Template struct {
Validity
Name string `json:"name" validate:"required,max=64" `
Description string `json:"description"`
Content string `json:"content"`
Status TemplateStatus `json:"status" validate:"required,max=64"`
Type TemplateType `json:"type" validate:"required,max=64"`
ParentsCount int `json:"parents_count"`
ParentName *string `json:"parent"`
Markers []string `json:"markers"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Template ...
func (*Template) GetMarkers ¶
func (i *Template) GetMarkers(items []*Template, template *TemplateContent) (markers []string, err error)
GetMarkers ...
func (*Template) GetTemplate ¶
func (i *Template) GetTemplate() (tpl *TemplateContent, err error)
GetTemplate ...
type TemplateContent ¶
type TemplateContent struct {
Items []string `json:"items"`
Title string `json:"title"`
Fields []*TemplateField `json:"fields"`
}
TemplateContent ...
type TemplateField ¶
TemplateField ...
type TemplateRender ¶
TemplateRender ...
func RenderTemplate ¶
func RenderTemplate(items []*Template, template *TemplateContent, params map[string]interface{}) (render *TemplateRender, err error)
RenderTemplate ...
type TemplateTree ¶
type TemplateTree struct {
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
Nodes []*TemplateTree `json:"nodes"`
}
TemplateTree ...
type Trigger ¶
type Trigger struct {
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name" validate:"required,lte=255"`
PluginName string `json:"plugin_name" validate:"required,lte=255"`
Description string `json:"description"`
Id int64 `json:"id"`
Entities []*Entity `json:"entities" validate:"dive"`
Script *Script `json:"script"`
ScriptId *int64 `json:"script_id"`
Payload Attributes `json:"payload"`
AreaId *int64 `json:"area_id"`
Area *Area `json:"area"`
Enabled bool `json:"enabled"`
IsLoaded bool `json:"is_loaded"`
}
Trigger ...
type TriggerParams ¶
type TriggerParams struct {
Entities bool `json:"entities"`
Script bool `json:"script"`
Attributes Attributes `json:"attributes"`
Required []string `json:"required"`
}
type UpdateTask ¶
type UpdateTask struct {
TriggerIds []int64 `json:"triggers" validate:"dive"`
ConditionIds []int64 `json:"conditions" validate:"dive"`
ActionIds []int64 `json:"actions" validate:"dive"`
CreatedAt time.Time
UpdatedAt time.Time
Name string `json:"name" validate:"required,lte=255"`
Description string `json:"description" validate:"lte=255"`
Condition common.ConditionType `json:"condition" validate:"required,oneof=or and"`
Id int64 `json:"id"`
Area *Area `json:"area"`
AreaId *int64 `json:"area_id"`
Enabled bool `json:"enabled"`
IsLoaded bool `json:"is_loaded"`
}
UpdateTask ...
type UpdateTrigger ¶
type UpdateTrigger struct {
Name string `json:"name" validate:"required,lte=255"`
PluginName string `json:"plugin_name" validate:"required,lte=255"`
Description string `json:"description"`
Id int64 `json:"id"`
EntityIds []string `json:"entity_ids" validate:"dive"`
ScriptId *int64 `json:"script_id"`
Payload Attributes `json:"payload"`
AreaId *int64 `json:"area_id"`
Enabled bool `json:"enabled"`
}
UpdateTrigger ...
type User ¶
type User struct {
Id int64 `json:"id"`
Nickname string `json:"nickname" validate:"required,min=3,max=255"`
FirstName string `json:"first_name" validate:"max=255"`
LastName string `json:"last_name" validate:"max=255"`
EncryptedPassword string `json:"encrypted_password,omitempty"`
Email string `json:"email" validate:"required,email"`
Status string `json:"status" validate:"max=255"`
ResetPasswordToken string `json:"-,omitempty"`
AuthenticationToken *string `json:"authentication_token,omitempty"`
Image *Image `json:"image,omitempty"`
ImageId sql.NullInt64 `json:"image_id"`
SignInCount int64 `json:"sign_in_count,omitempty"`
CurrentSignInIp string `json:"current_sign_in_ip,omitempty"`
LastSignInIp string `json:"last_sign_in_ip,omitempty"`
Lang string `json:"lang"`
User *User `json:"user,omitempty"`
UserId sql.NullInt64 `json:"user_id"`
Role *Role `json:"role"`
RoleName string `json:"role_name,omitempty"`
Meta []*UserMeta `json:"meta,omitempty"`
ResetPasswordSentAt *time.Time `json:"reset_password_sent_at,omitempty"`
CurrentSignInAt *time.Time `json:"current_sign_in_at,omitempty"`
LastSignInAt *time.Time `json:"last_sign_in_at,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
DeletedAt *time.Time `json:"deleted_at"`
History []*UserHistory `json:"history,omitempty"`
Devices []*UserDevice `json:"devices"`
}
User ...
type UserDevice ¶
type UserDevice struct {
Id int64
UserId int64
Subscription *Subscription
CreatedAt time.Time
}
UserDevice ...
type UserHistory ¶
UserHistory ...
type UserMeta ¶
type UserMeta struct {
Id int64 `json:"id"`
User *User `json:"user"`
UserId int64 `json:"user_id"`
Key string `json:"key"`
Value string `json:"value"`
}
UserMeta ...
type Variable ¶
type Variable struct {
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name" validate:"required"`
Value string `json:"value"`
EntityId *common.EntityId `json:"entity_id"`
System bool `json:"system"`
Tags []*Tag `json:"tags"`
Changed bool
}
Variable ...
type Version ¶
type Version struct {
Version string `json:"version"`
Revision string `json:"revision"`
RevisionURL string `json:"revision_url"`
Generated string `json:"generated"`
Developers string `json:"developers"`
BuildNum string `json:"build_num"`
DockerImage string `json:"docker_image"`
}
Version ...
type Zigbee2mqtt ¶
type Zigbee2mqtt struct {
Devices []*Zigbee2mqttDevice `json:"devices"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name" validate:"required,max=254"`
Login string `json:"login"`
EncryptedPassword string `json:"encrypted_password"`
BaseTopic string `json:"base_topic"`
Id int64 `json:"id"`
Password *string `json:"password"`
Info *Zigbee2mqttInfo `json:"info"`
PermitJoin bool `json:"permit_join"`
}
Zigbee2mqtt ...
type Zigbee2mqttDevice ¶
type Zigbee2mqttDevice struct {
Id string `json:"id"`
Zigbee2mqttId int64 `json:"zigbee2mqtt_id" validate:"required"`
Name string `json:"name" validate:"required,max=254"`
Type string `json:"type"`
Model string `json:"model"`
Description string `json:"description"`
Manufacturer string `json:"manufacturer"`
Functions []string `json:"functions"`
ImageUrl string `json:"image_url"`
Status string `json:"status"`
Payload []byte `json:"payload"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Zigbee2mqttDevice ...
Source Files
¶
- action.go
- alexa_intent.go
- alexa_skill.go
- app_config.go
- area.go
- attribute.go
- automation.go
- backup.go
- condition.go
- dashboard.go
- dashboard_card.go
- dashboard_card_item.go
- dashboard_tab.go
- entity.go
- entity_action.go
- entity_action_short.go
- entity_short.go
- entity_state.go
- entity_state_short.go
- entity_storage.go
- gate_config.go
- geo_location.go
- image.go
- log.go
- message.go
- message_delivery.go
- metric.go
- metric_data_item.go
- models.go
- permission.go
- plugin.go
- role.go
- run_history.go
- script.go
- statistic.go
- tag.go
- task.go
- telegram_channel.go
- template.go
- template_types.go
- trigger.go
- user.go
- user_device.go
- userhistory.go
- usermeta.go
- variable.go
- version.go
- zigbee2mqtt.go
- zigbee2mqtt_device.go