Documentation ¶
Index ¶
- Constants
- type BooleanProperty
- type BrightnessProperty
- type ColorModeProperty
- type ColorProperty
- type ColorTemperatureProperty
- type IntegerProperty
- func (prop *IntegerProperty) GetValue() int
- func (prop *IntegerProperty) OnValueRemoteGet(fn func() int)
- func (prop *IntegerProperty) OnValueRemoteUpdate(fn func(int))
- func (prop *IntegerProperty) SetCachedValueAndNotify(value int)
- func (prop *IntegerProperty) SetMaxValue(v int64)
- func (prop *IntegerProperty) SetMinValue(v int64)
- type NumberProperty
- type OnOffProperty
- type Property
- func (p *Property) GetAtType() string
- func (p *Property) GetDescription() string
- func (p *Property) GetForms() []*rpc.Link
- func (p *Property) GetMaximum() interface{}
- func (p *Property) GetMinimum() interface{}
- func (p *Property) GetMultipleOf() interface{}
- func (p *Property) GetName() string
- func (p *Property) GetTitle() string
- func (p *Property) GetType() string
- func (p *Property) GetUnit() string
- func (p *Property) GetValue() interface{}
- func (p *Property) IsReadOnly() bool
- type StringProperty
Constants ¶
const ( On = "on" Brightness = "brightness" Hue = "hue" ColorTemperature = "ct" ColorModel = "color_mode" TypeString = "string" TypeBoolean = "boolean" TypeInteger = "integer" TypeNumber = "number" UnitHectopascal = "hectopascal" UnitKelvin = "kelvin" UnitPercentage = "percentage" UnitArcDegrees = "arcdegrees" UnitCelsius = "celsius" UnitLux = "lux" UnitSeconds = "seconds" UnitPPM = "ppm" AlarmProperty = "AlarmProperty" BarometricPressureProperty = "BarometricPressureProperty" //ColorProperty = "ColorProperty" //ColorTemperatureProperty = "ColorTemperatureProperty" ConcentrationProperty = "ConcentrationProperty" CurrentProperty = "CurrentProperty" DensityProperty = "DensityProperty" FrequencyProperty = "FrequencyProperty" HeatingCoolingProperty = "HeatingCoolingProperty" HumidityProperty = "HumidityProperty" ImageProperty = "ImageProperty" InstantaneousPowerFactorProperty = "InstantaneousPowerFactorProperty" InstantaneousPowerProperty = "InstantaneousPowerProperty" LeakProperty = "LeakProperty" LevelProperty = "LevelProperty" LockedProperty = "LockedProperty" MotionProperty = "MotionProperty" OpenProperty = "OpenProperty" PushedProperty = "PushedProperty" SmokeProperty = "SmokeProperty" TargetTemperatureProperty = "TargetTemperatureProperty" TemperatureProperty = "TemperatureProperty" ThermostatModeProperty = "ThermostatModeProperty" VideoProperty = "VideoProperty" VoltageProperty = "VoltageProperty" )
const TypeBrightnessProperty = "BrightnessProperty"
const TypeColorModeProperty = "ColorModeProperty"
const TypeColorProperty = "ColorProperty"
const TypeColorTemperatureProperty = "ColorTemperatureProperty"
const TypeOnOffProperty = "OnOffProperty"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BooleanProperty ¶
type BooleanProperty struct {
*Property
}
func NewBooleanProperty ¶
func NewBooleanProperty(typ string) *BooleanProperty
func (*BooleanProperty) GetValue ¶
func (prop *BooleanProperty) GetValue() bool
GetValue returns the value as bool
func (*BooleanProperty) OnValueRemoteGet ¶
func (prop *BooleanProperty) OnValueRemoteGet(fn func() bool)
OnValueRemoteGet calls fn when the value was read by a client.
func (*BooleanProperty) OnValueRemoteUpdate ¶
func (prop *BooleanProperty) OnValueRemoteUpdate(fn func(bool))
OnValueRemoteUpdate calls fn when the value was updated by a client.
func (*BooleanProperty) SetBooleanValue ¶
func (prop *BooleanProperty) SetBooleanValue(value bool)
SetValue sets a value
type BrightnessProperty ¶
type BrightnessProperty struct {
*IntegerProperty
}
func NewBrightnessProperty ¶
func NewBrightnessProperty() *BrightnessProperty
type ColorModeProperty ¶
type ColorModeProperty struct {
*StringProperty
}
func NewColorModeProperty ¶
func NewColorModeProperty() *ColorModeProperty
type ColorProperty ¶
type ColorProperty struct {
*StringProperty
}
func NewColorProperty ¶
func NewColorProperty() *ColorProperty
type ColorTemperatureProperty ¶
type ColorTemperatureProperty struct {
*IntegerProperty
}
func NewColorTemperatureProperty ¶
func NewColorTemperatureProperty() *ColorTemperatureProperty
type IntegerProperty ¶
type IntegerProperty struct {
*Property
}
func NewIntegerProperty ¶
func NewIntegerProperty(typ string) *IntegerProperty
func (*IntegerProperty) GetValue ¶
func (prop *IntegerProperty) GetValue() int
GetValue returns the value as bool
func (*IntegerProperty) OnValueRemoteGet ¶
func (prop *IntegerProperty) OnValueRemoteGet(fn func() int)
OnValueRemoteGet calls fn when the value was read by a client.
func (*IntegerProperty) OnValueRemoteUpdate ¶
func (prop *IntegerProperty) OnValueRemoteUpdate(fn func(int))
OnValueRemoteUpdate calls fn when the value was updated by a client.
func (*IntegerProperty) SetCachedValueAndNotify ¶
func (prop *IntegerProperty) SetCachedValueAndNotify(value int)
SetValue sets a value
func (*IntegerProperty) SetMaxValue ¶
func (prop *IntegerProperty) SetMaxValue(v int64)
func (*IntegerProperty) SetMinValue ¶
func (prop *IntegerProperty) SetMinValue(v int64)
type NumberProperty ¶
type NumberProperty struct {
*Property
}
func NewNumberProperty ¶
func NewNumberProperty(typ string) *NumberProperty
func (*NumberProperty) GetValue ¶
func (prop *NumberProperty) GetValue() float64
GetValue returns the value as bool
func (*NumberProperty) OnValueRemoteGet ¶
func (prop *NumberProperty) OnValueRemoteGet(fn func() float64)
OnValueRemoteGet calls fn when the value was read by a client.
func (*NumberProperty) OnValueRemoteUpdate ¶
func (prop *NumberProperty) OnValueRemoteUpdate(fn func(float64))
OnValueRemoteUpdate calls fn when the value was updated by a client.
func (*NumberProperty) SetValue ¶
func (prop *NumberProperty) SetValue(value float64)
SetValue sets a value
type OnOffProperty ¶
type OnOffProperty struct {
*BooleanProperty
}
func NewOnOffProperty ¶
func NewOnOffProperty() *OnOffProperty
type Property ¶
type Property struct { Name string `json:"name"` Title string `json:"title,omitempty"` Type string `json:"type"` AtType string `json:"@type,omitempty"` Unit string `json:"unit,omitempty"` Description string `json:"description,omitempty"` Minimum interface{} `json:"minimum,omitempty"` Maximum interface{} `json:"maximum,omitempty"` Enum []interface{} `json:"enum,omitempty"` ReadOnly bool `json:"readOnly"` MultipleOf interface{} `json:"multipleOf,omitempty"` Links []*rpc.Link `json:"links"` Value interface{} `json:"value"` }
func NerPropertyFormString ¶
func NewPropertyFormMessage ¶
func (*Property) GetDescription ¶
func (*Property) GetMaximum ¶
func (p *Property) GetMaximum() interface{}
func (*Property) GetMinimum ¶
func (p *Property) GetMinimum() interface{}
func (*Property) GetMultipleOf ¶
func (p *Property) GetMultipleOf() interface{}
func (*Property) IsReadOnly ¶
type StringProperty ¶
type StringProperty struct {
*Property
}
func NewStringProperty ¶
func NewStringProperty(typ string) *StringProperty
func (*StringProperty) GetValue ¶
func (prop *StringProperty) GetValue() string
GetValue returns the value as bool
func (*StringProperty) OnValueRemoteGet ¶
func (prop *StringProperty) OnValueRemoteGet(fn func() string)
OnValueRemoteGet calls fn when the value was read by a client.
func (*StringProperty) OnValueRemoteUpdate ¶
func (prop *StringProperty) OnValueRemoteUpdate(fn func(string))
OnValueRemoteUpdate calls fn when the value was updated by a client.
func (*StringProperty) SetValue ¶
func (prop *StringProperty) SetValue(value string)
SetValue sets a value