device

package
v0.0.0-...-eb599cc Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InterpolationDiscrete   = "discrete"
	InterpolationContinuous = "continuous"
	TypeBool                = "bool"
	TypeInt                 = "int"
	TypeString              = "string"
	TypeRGB                 = "rgb"
)

Useful constants

Variables

This section is empty.

Functions

func BoolProperty

func BoolProperty(value bool) *devicedef.Property

BoolProperty returns a boolean property

func IntArg

func IntArg(min, max float64, required bool) *devicedef.Arg

IntArg returns an integer argument

func IntProperty

func IntProperty(value int, min, max float64, interpolation string) *devicedef.Property

IntProperty returns an integer property

func LoadProvidedState

func LoadProvidedState(ctx context.Context, deviceID string, providers []string) (map[string]interface{}, error)

LoadProvidedState returns the state from a set of providers

func RGBProperty

func RGBProperty(value color.RGBA) *devicedef.Property

RGBProperty returns an RGB property

func StringArgWithOptions

func StringArgWithOptions(options []*devicedef.Option, required bool) *devicedef.Arg

StringArgWithOptions returns a string argument with a pick list of options

func StringProperty

func StringProperty(value string) *devicedef.Property

StringProperty returns a string property

func Uint8Property

func Uint8Property(value uint8, min, max float64, interpolation string) *devicedef.Property

Uint8Property returns a uint8 property

func ValidateCommand

func ValidateCommand(command string, args map[string]interface{}, spec map[string]*devicedef.Command) error

ValidateCommand returns an error if the command and its arguments do not conform to the specification

func ValidateState

func ValidateState(state map[string]interface{}, device *devicedef.Device) error

ValidateState returns an error if the given state does not conform to the specification

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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