devices

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MeassuringDevice

func MeassuringDevice(device Device, client MQTT.Client, wg *sync.WaitGroup)

MeassuringDevice is a device which randomly emits a float value

func SwitchDevice

func SwitchDevice(device Device, client MQTT.Client, wg *sync.WaitGroup)

SwitchDevice is a device which randomly emits an `on/off` state

Types

type Device

type Device struct {
	Name     string
	Topic    string `yaml:"topic"`
	Maker    string `yaml:"maker"`
	Type     string `yaml:"type"`
	Interval int    `yaml:"interval"`
}

func ImportDevices

func ImportDevices(content []byte) ([]Device, error)

func (Device) Valid

func (d Device) Valid() bool

type Meassure

type Meassure struct {
	Identifier string
	Maker      string
	Value      float32
}

type Switch

type Switch struct {
	Identifier string
	Maker      string
	State      string // State should be `on` or `off`
}

Jump to

Keyboard shortcuts

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