Documentation ¶
Index ¶
- type Control
- type ControlInfo
- type ControlWatcherPayload
- type Meta
- type MultilingualEnum
- type MultilingualText
- type PushbuttonControl
- type RangeControl
- type RangeControlWatcherPayload
- type RgbControl
- type RgbControlWatcherPayload
- type RgbValue
- type SwitchControl
- func (c *SwitchControl) AddWatcher(f func(payload SwitchControlWatcherPayload))
- func (c *SwitchControl) GetInfo() ControlInfo
- func (c *SwitchControl) GetValue() bool
- func (c *SwitchControl) SetValue(value bool)
- func (c *SwitchControl) Toggle()
- func (c *SwitchControl) TurnOff()
- func (c *SwitchControl) TurnOn()
- type SwitchControlWatcherPayload
- type TextControl
- type ValueControl
- type ValueControlWatcherPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
func (*Control) AddWatcher ¶
func (c *Control) AddWatcher(f func(payload ControlWatcherPayload))
func (*Control) GetInfo ¶
func (c *Control) GetInfo() ControlInfo
type ControlInfo ¶
type ControlWatcherPayload ¶
type Meta ¶
type Meta struct { Type string `json:"type"` // Тип контроля Units string `json:"units"` // Единицы измерения (только для type="value") Max float64 `json:"max"` // Максимальное значение Min float64 `json:"min"` // Минимальное значение Precision float64 `json:"precision"` // Точность Order int `json:"order"` // Порядок отображения ReadOnly bool `json:"readonly"` // Только для чтения Title MultilingualText `json:"title"` // Название (разные языки) Enum map[string]MultilingualEnum `json:"enum"` // Заголовки для enum }
type MultilingualEnum ¶
type MultilingualEnum struct {
Title MultilingualText `json:"title"` // Название enum на разных языках
}
type MultilingualText ¶
MultilingualText хранит текстовые значения на разных языках
type PushbuttonControl ¶
type PushbuttonControl struct {
// contains filtered or unexported fields
}
func NewPushbuttonControl ¶
func NewPushbuttonControl(client *wb.Client, device, control string, meta Meta) *PushbuttonControl
func (*PushbuttonControl) GetInfo ¶
func (c *PushbuttonControl) GetInfo() ControlInfo
func (*PushbuttonControl) Push ¶
func (c *PushbuttonControl) Push()
type RangeControl ¶
type RangeControl struct {
// contains filtered or unexported fields
}
func NewRangeControl ¶
func NewRangeControl(client *wb.Client, device, control string, meta Meta) *RangeControl
func (*RangeControl) AddWatcher ¶
func (c *RangeControl) AddWatcher(f func(payload RangeControlWatcherPayload))
func (*RangeControl) GetInfo ¶
func (c *RangeControl) GetInfo() ControlInfo
func (*RangeControl) GetValue ¶
func (c *RangeControl) GetValue() int
func (*RangeControl) SetValue ¶
func (c *RangeControl) SetValue(value int)
type RgbControl ¶
type RgbControl struct {
// contains filtered or unexported fields
}
func NewRgbControl ¶
func NewRgbControl(client *wb.Client, device, control string, meta Meta) *RgbControl
func (*RgbControl) AddWatcher ¶
func (c *RgbControl) AddWatcher(f func(payload RgbControlWatcherPayload))
func (*RgbControl) GetInfo ¶
func (c *RgbControl) GetInfo() ControlInfo
func (*RgbControl) GetValue ¶
func (c *RgbControl) GetValue() RgbValue
func (*RgbControl) SetValue ¶
func (c *RgbControl) SetValue(value RgbValue)
type SwitchControl ¶
type SwitchControl struct {
// contains filtered or unexported fields
}
func NewSwitchControl ¶
func NewSwitchControl(client *wb.Client, device, control string, meta Meta) *SwitchControl
func (*SwitchControl) AddWatcher ¶
func (c *SwitchControl) AddWatcher(f func(payload SwitchControlWatcherPayload))
func (*SwitchControl) GetInfo ¶
func (c *SwitchControl) GetInfo() ControlInfo
func (*SwitchControl) GetValue ¶
func (c *SwitchControl) GetValue() bool
func (*SwitchControl) SetValue ¶
func (c *SwitchControl) SetValue(value bool)
func (*SwitchControl) Toggle ¶
func (c *SwitchControl) Toggle()
func (*SwitchControl) TurnOff ¶
func (c *SwitchControl) TurnOff()
func (*SwitchControl) TurnOn ¶
func (c *SwitchControl) TurnOn()
type TextControl ¶
type TextControl struct {
// contains filtered or unexported fields
}
func NewTextControl ¶
func NewTextControl(client *wb.Client, device, control string, meta Meta) *TextControl
func (*TextControl) AddWatcher ¶
func (c *TextControl) AddWatcher(f func(payload ControlWatcherPayload))
func (*TextControl) GetInfo ¶
func (c *TextControl) GetInfo() ControlInfo
func (*TextControl) GetValue ¶
func (c *TextControl) GetValue() string
func (*TextControl) SetValue ¶
func (c *TextControl) SetValue(value string)
type ValueControl ¶
type ValueControl struct {
// contains filtered or unexported fields
}
func NewValueControl ¶
func NewValueControl(client *wb.Client, device, control string, meta Meta) *ValueControl
func (*ValueControl) AddWatcher ¶
func (c *ValueControl) AddWatcher(f func(payload ValueControlWatcherPayload))
func (*ValueControl) GetInfo ¶
func (c *ValueControl) GetInfo() ControlInfo
func (*ValueControl) GetValue ¶
func (c *ValueControl) GetValue() float64
Click to show internal directories.
Click to hide internal directories.