devicedef

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Required bool      `json:"required"`
	Type     string    `json:"type"`
	Min      *float64  `json:"min"`
	Max      *float64  `json:"max"`
	Options  []*Option `json:"options"`
}

Arg is defined in the .def file

func (*Arg) Validate

func (m *Arg) Validate() error

Validate returns an error if any of the fields have bad values

type Command

type Command struct {
	Args map[string]*Arg `json:"args"`
}

Command is defined in the .def file

func (*Command) Validate

func (m *Command) Validate() error

Validate returns an error if any of the fields have bad values

type Device

type Device struct {
	Id             string                 `json:"id"`
	Name           string                 `json:"name"`
	Type           string                 `json:"type"`
	Kind           string                 `json:"kind"`
	ControllerName string                 `json:"controller_name"`
	Attributes     map[string]interface{} `json:"attributes"`
	StateProviders []string               `json:"state_providers"`
	State          map[string]*Property   `json:"state"`
	Commands       map[string]*Command    `json:"commands"`
}

Device is defined in the .def file

func (*Device) Validate

func (m *Device) Validate() error

Validate returns an error if any of the fields have bad values

type DeviceStateChangedEvent

type DeviceStateChangedEvent struct {
	Device *Device `json:"device"`
}

DeviceStateChangedEvent is defined in the .def file

func (*DeviceStateChangedEvent) Publish

func (m *DeviceStateChangedEvent) Publish() error

Publish publishes the event to the Firehose

func (*DeviceStateChangedEvent) Validate

func (m *DeviceStateChangedEvent) Validate() error

Validate returns an error if any of the fields have bad values

type DeviceStateChangedEventHandler

type DeviceStateChangedEventHandler func(*DeviceStateChangedEvent) firehose.Result

DeviceStateChangedEventHandler implements the necessary functions to be a Firehose handler

func (DeviceStateChangedEventHandler) EventName

func (h DeviceStateChangedEventHandler) EventName() string

EventName returns the Firehose channel name

func (DeviceStateChangedEventHandler) HandleEvent

HandleEvent handles the Firehose event

type Option

type Option struct {
	Value string `json:"value"`
	Name  string `json:"name"`
}

Option is defined in the .def file

func (*Option) Validate

func (m *Option) Validate() error

Validate returns an error if any of the fields have bad values

type Property

type Property struct {
	Value         interface{} `json:"value"`
	Type          string      `json:"type"`
	Min           *float64    `json:"min"`
	Max           *float64    `json:"max"`
	Interpolation string      `json:"interpolation"`
	Options       []*Option   `json:"options"`
}

Property is defined in the .def file

func (*Property) Validate

func (m *Property) Validate() error

Validate returns an error if any of the fields have bad values

Jump to

Keyboard shortcuts

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