sensor

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSensorModelNotMatched = errors.New("Sensor model not matched")
)

Functions

This section is empty.

Types

type BME280

type BME280 struct {
	*types.Sensor
	// contains filtered or unexported fields
}

BME280 is a sensor to measure humidity and temperature.

func (*BME280) Read

func (bme280 *BME280) Read() ([]*types.MeasuredValue, error)

Read measured values

type DHT11

type DHT11 struct {
	*types.Sensor
	// contains filtered or unexported fields
}

DHT11 is a sensor to measure humidity and temperature.

func (*DHT11) Read

func (dht11 *DHT11) Read() ([]*types.MeasuredValue, error)

Read measured values

type DHT22

type DHT22 struct {
	*types.Sensor
	// contains filtered or unexported fields
}

DHT22 is a sensor to measure humidity and temperature.

func (*DHT22) Read

func (dht22 *DHT22) Read() ([]*types.MeasuredValue, error)

Read measured values

type DS18B20

type DS18B20 struct {
	*types.Sensor
	// contains filtered or unexported fields
}

DS18B20 is a sensor to measure humidity and temperature.

func (*DS18B20) Read

func (ds18b20 *DS18B20) Read() ([]*types.MeasuredValue, error)

Read measured values

type Sensor

type Sensor interface {
	GetID() string
	GetTicker() *time.Ticker
	Read() ([]*types.MeasuredValue, error)
}

func New

func New(sensor *types.Sensor) (Sensor, error)

New returns a new sensor

Jump to

Keyboard shortcuts

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