devices

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Air8884 = sdk.DeviceHandler{
	Name: "airflow",

	Read: func(device *sdk.Device) ([]*output.Reading, error) {
		reading, err := outputs.AirflowOutput.MakeReading(100)
		if err != nil {
			return nil, err
		}
		return []*output.Reading{reading}, nil
	},
	Write: func(device *sdk.Device, data *sdk.WriteData) error {

		return nil
	},
}

Air8884 is the handler for the example airflow device with model "air8884".

View Source
var Temp2010 = sdk.DeviceHandler{
	Name: "temperature",

	Read: func(device *sdk.Device) ([]*output.Reading, error) {
		reading, err := output.Temperature.MakeReading(10)
		if err != nil {
			return nil, err
		}
		return []*output.Reading{reading}, nil
	},
}

Temp2010 is the handler for the example temperature device with model "temp2010".

View Source
var Volt1103 = sdk.DeviceHandler{
	Name: "voltage",

	Read: func(device *sdk.Device) ([]*output.Reading, error) {
		reading, err := output.Voltage.MakeReading(1)
		if err != nil {
			return nil, err
		}
		return []*output.Reading{reading}, nil
	},
}

Volt1103 is the handler for the example voltage device with model "volt1103".

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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