Skip to content

Commit

Permalink
Add ability to create controls with lazy initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
wierdbytes committed Dec 23, 2019
1 parent 1420051 commit 4ce4ba9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions control.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type ControlArgs interface {
SetRawValue(string) ControlArgs
SetValue(interface{}) ControlArgs
SetDoLoadPrevious(bool) ControlArgs
SetLazyInit(bool) ControlArgs

GetDevice() Device
GetID() *string
Expand All @@ -33,6 +34,7 @@ type ControlArgs interface {
GetRawValue() *string
GetValue() interface{}
GetDoLoadPrevious() *bool
GetLazyInit() *bool
}

// Control is a user representation of MQTT device control
Expand Down Expand Up @@ -68,6 +70,7 @@ type Control interface {
GetOrder() int // Gets control order (or -1 for auto) (/meta/order)
GetValue() (interface{}, error) // Gets control value (converted according to type)
GetRawValue() string // Gets control value string
GetLazyInit() bool // Gets control lazyInit flag

// generic setters
SetDescription(desc string) FuncError
Expand All @@ -78,6 +81,7 @@ type Control interface {
SetMax(max int) FuncError
SetError(e ControlError) FuncError
SetOrder(ord int) FuncError
SetLazyInit(bool) FuncError

// universal interface for UpdateValue and SetOnValue
SetValue(val interface{}) FuncError
Expand Down

0 comments on commit 4ce4ba9

Please sign in to comment.