attribute

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrPermissionALLControl = iota // 0:可控制可读(例如灯光控制属性)
	AttrPermissionOnlyRead          // 1:不可控制但是可读(例如:传感器状态属性)
	AttrPermissionNone              // 2:不可控制不可读(其他属性)
)

Variables

This section is empty.

Functions

func TypeOf

func TypeOf(iface interface{}) string

func ValueOf

func ValueOf(iface interface{}) interface{}

Types

type AttrPermission added in v1.9.1

type AttrPermission interface {
	SetPermission(permission uint)
	GetPermission() uint
}

AttrPermission 属性状态接口

type Base

type Base struct {
	Permission uint // 属性状态: 0可控制可读(灯光控制属性),1不可控制但是可读(传感器状态),2不可控制不可读(其他属性)
	// contains filtered or unexported fields
}

func (*Base) GetAid added in v1.9.1

func (b *Base) GetAid() uint64

func (*Base) GetIid added in v1.9.1

func (b *Base) GetIid() uint64

func (*Base) GetPermission added in v1.9.1

func (b *Base) GetPermission() uint

func (*Base) Notify

func (b *Base) Notify(val interface{}) error

Notify 触发Base.notifyFn,通过channel通知SA

func (*Base) Set

func (b *Base) Set(val interface{}) error

Set 触发Base.updateFn,更新设备属性

func (*Base) SetAid added in v1.9.1

func (b *Base) SetAid(aid uint64)

func (*Base) SetIid added in v1.9.1

func (b *Base) SetIid(iid uint64)

func (*Base) SetNotifyFunc

func (b *Base) SetNotifyFunc(fn NotifyFunc)

SetNotifyFunc 设置通知函数

func (*Base) SetPermission added in v1.9.1

func (b *Base) SetPermission(permission uint)

func (*Base) SetUpdateFunc

func (b *Base) SetUpdateFunc(fn UpdateFunc)

SetUpdateFunc 设置属性更新函数

type Bool

type Bool struct {
	Base
	// contains filtered or unexported fields
}

func (*Bool) GetBool

func (b *Bool) GetBool() bool

func (*Bool) SetBool

func (b *Bool) SetBool(v bool)

type BoolType

type BoolType interface {
	GetBool() bool
	SetBool(bool)
}

type Enum

type Enum struct {
	Base
	// contains filtered or unexported fields
}

func (*Enum) GetEnum

func (e *Enum) GetEnum() int

func (*Enum) SetEnum

func (e *Enum) SetEnum(enum int)

func (*Enum) SetEnums

func (e *Enum) SetEnums(enums ...int)

type EnumType added in v1.9.1

type EnumType interface {
	SetEnums(enums ...int)
	GetEnum() int
	SetEnum(enum int)
}

type Float added in v1.9.1

type Float struct {
	Base
	// contains filtered or unexported fields
}

func (*Float) GetFloat added in v1.9.1

func (f *Float) GetFloat() float64

func (*Float) GetRange added in v1.9.1

func (f *Float) GetRange() (min, max *float64)

func (*Float) SetFloat added in v1.9.1

func (f *Float) SetFloat(v float64)

func (*Float) SetRange added in v1.9.1

func (f *Float) SetRange(min, max float64)

type FloatType added in v1.9.1

type FloatType interface {
	GetRange() (*float64, *float64)
	SetRange(float64, float64)
	GetFloat() float64
	SetFloat(float64)
}

type HomekitCharacteristic added in v1.9.1

type HomekitCharacteristic interface {
	SetAid(aid uint64)
	GetAid() uint64
	SetIid(iid uint64)
	GetIid() uint64
}

HomekitCharacteristic homekit的特征属性

type Identity

type Identity struct {
	String
}

func NewIdentity

func NewIdentity() *Identity

type Int

type Int struct {
	Base
	// contains filtered or unexported fields
}

func (*Int) GetInt

func (i *Int) GetInt() int

func (*Int) GetRange

func (i *Int) GetRange() (min, max *int)

func (*Int) SetInt

func (i *Int) SetInt(v int)

func (*Int) SetRange

func (i *Int) SetRange(min, max int)

type IntType

type IntType interface {
	GetRange() (*int, *int)
	SetRange(int, int)
	GetInt() int
	SetInt(int)
}

type Manufacturer

type Manufacturer struct {
	String
}

func NewManufacturer

func NewManufacturer() *Manufacturer

type Model

type Model struct {
	String
}

func NewModel

func NewModel() *Model

type Name

type Name struct {
	String
}

func NewName

func NewName() *Name

type Notifier

type Notifier interface {
	Notify(val interface{}) error
	SetNotifyFunc(NotifyFunc)
}

type NotifyFunc

type NotifyFunc func(val interface{}) error

type Power

type Power struct {
	String
}

func NewPower

func NewPower() *Power

type Setter

type Setter interface {
	Set(val interface{}) error
}

type String

type String struct {
	Base
	// contains filtered or unexported fields
}

func StringWithValidValues

func StringWithValidValues(values ...string) String

func (String) GetString

func (s String) GetString() string

func (*String) SetString

func (s *String) SetString(v string)

type StringType

type StringType interface {
	GetString() string
	SetString(string)
}

type UpdateFunc

type UpdateFunc func(val interface{}) error

type Version

type Version struct {
	String
}

func NewVersion

func NewVersion() *Version

Jump to

Keyboard shortcuts

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