Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParserIdentity ¶ added in v1.9.1
ParserIdentity 解析设备的identity 把identity用-切成切片,且判断第一个元素是否childDevice (例子:childDevice-abc-4) 如果是childDevice,则是子设备,第二个元素为父设备的identity,第三个元素为在父子设备中的instanceId
func ToSnakeCase ¶
Types ¶
type Attribute ¶
type Attribute struct { ID int Model interface{} TypeModel interface{} Name string Type string Tag string Require bool Active bool Aid uint64 // homekit aid Iid uint64 // homekit iid Permission uint // 控制状态: 0可控制可读(灯光控制属性),1不可控制但是可读(传感器状态),2不可控制不可读(其他属性) }
Attribute represents a column of database
type Device ¶
type Device struct { Model interface{} Instances []*Instance InstanceNames []string InstanceMap map[int]*Instance }
Device represents a table of database
type DeviceName ¶
type DeviceName interface {
DeviceName() string
}
type Instance ¶
type Instance struct { ID int Model interface{} Name string Type string Tag string Attributes []*Attribute AttributeNames []string AttributeMap map[string]*Attribute }
func ParseInstance ¶
func ParseInstance(dest interface{}) *Instance
ParseInstance a instance to a Instance instance
func (*Instance) GetAttribute ¶
GetAttribute return instance by name
type InstanceName ¶
type InstanceName interface {
InstanceName() string
}
Click to show internal directories.
Click to hide internal directories.