types

package
v0.0.0-...-baaaa93 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPIO02 GPIO = "GPIO02"
	GPIO03      = "GPIO03"
	GPIO04      = "GPIO04"
	GPIO05      = "GPIO05"
	GPIO06      = "GPIO06"
	GPIO07      = "GPIO07"
	GPIO08      = "GPIO08"
	GPIO10      = "GPIO10"
	GPIO11      = "GPIO11"
	GPIO12      = "GPIO12"
	GPIO13      = "GPIO13"
	GPIO14      = "GPIO14"
	GPIO15      = "GPIO15"
	GPIO16      = "GPIO16"
	GPIO17      = "GPIO17"
	GPIO18      = "GPIO18"
	GPIO19      = "GPIO19"
	GPIO20      = "GPIO20"
	GPIO21      = "GPIO21"
	GPIO22      = "GPIO22"
	GPIO23      = "GPIO23"
	GPIO24      = "GPIO24"
	GPIO25      = "GPIO25"
	GPIO26      = "GPIO26"
	GPIO27      = "GPIO27"
)
View Source
const (
	LEDActionError   LEDAction = "error"
	LEDActionWarn              = "warn"
	LEDActionRun               = "run"
	LEDActionSync              = "sync"
	LEDActionLogfile           = "logfile"
)
View Source
const (
	BME280  SensorModel = "BME280"
	DHT11               = "DHT11"
	DHT22               = "DHT22"
	DS18B20             = "DS18B20"
)

Variables

Functions

func GPIOToInt

func GPIOToInt(gpio GPIO) (int, error)

func GPIOToString

func GPIOToString(gpio GPIO) (string, error)

Types

type BaseColor

type BaseColor string
const (
	BaseColorBlue  BaseColor = "blue"
	BaseColorRed   BaseColor = "red"
	BaseColorGreen BaseColor = "green"
)

type Device

type Device struct {
	DeviceID          string     `json:"device_id" xml:"device_id"`
	DeviceName        string     `json:"device_name" xml:"device_name"`
	DeviceLocation    *string    `json:"device_location" xml:"device_location"`
	DeviceLastContact *time.Time `json:"device_last_contact" xml:"device_last_contact"`
	Logfile           string     `json:"logfile" xml:"logfile"`
	CreationDate      time.Time  `json:"creation_date" xml:"creation_date"`
}

Device ...

type GPIO

type GPIO string

func StringToGPIO

func StringToGPIO(gpio string) (GPIO, error)

type LEDAction

type LEDAction string

type LEDColor

type LEDColor string
const (
	LEDColorBlue      LEDColor = "blue"
	LEDColorGreen     LEDColor = "green"
	LEDColorNone      LEDColor = "none"
	LEDColorPurple    LEDColor = "purple"
	LEDColorRed       LEDColor = "red"
	LEDColorTurquoise LEDColor = "turquoise"
	LEDColorYellow    LEDColor = "yellow"
	LEDColorWhite     LEDColor = "white"
)

func StringToLEDColor

func StringToLEDColor(color string) (LEDColor, error)

type MeasuredValue

type MeasuredValue struct {
	ID           string            `json:"id" xml:"id"`
	Value        float64           `json:"value,string" xml:"value,string"`
	ValueType    MeasuredValueType `json:"value_type" xml:"value_type"`
	FromDate     time.Time         `json:"from_date" xml:"from_date"`
	TillDate     time.Time         `json:"till_date" xml:"till_date"`
	SensorID     string            `json:"sensor_id" xml:"sensor_id"`
	CreationDate time.Time         `json:"creation_date" xml:"creation_date"`
	UpdateDate   *time.Time        `json:"update_date" xml:"update_date"`
}

func SelectMeasuredValues

func SelectMeasuredValues(measuredValueType MeasuredValueType, measuredValues []*MeasuredValue) []*MeasuredValue

type MeasuredValueType

type MeasuredValueType string
const (
	MeasuredValueTypeHumidity    MeasuredValueType = "humidity"
	MeasuredValueTypePressure    MeasuredValueType = "pressure"
	MeasuredValueTypeTemperature MeasuredValueType = "temperature"
)

func SelectMeasuredValueType

func SelectMeasuredValueType(valueType string) (*MeasuredValueType, error)

type RGBLED

type RGBLED struct {
	RGBLEDID         string                 `json:"rgbled_id" xml:"rgbled_id"`
	RGBLEDName       string                 `json:"rgbled_name" xml:"rgbled_name"`
	RGBLEDLocation   string                 `json:"rgbled_location" xml:"rgb_location"`
	BaseColorsToGPIO map[BaseColor]*GPIO    `json:"base_colors_to_gpio" xml:"base_colors_to_gpio"`
	ActionMapping    map[LEDAction]LEDColor `json:"action_mapping" xml:"action_mapping"`
	RGBLEDEnabled    bool                   `json:"rgbled_enabled" xml:"rgb_enabled"`
	DeviceID         string                 `json:"device_id" xml:"device_id"`
	CreationDate     time.Time              `json:"creation_date" xml:"creation_date"`
}

type Sensor

type Sensor struct {
	SensorID          string      `json:"sensor_id" xml:"sensor_id"`
	SensorName        string      `json:"sensor_name" xml:"sensor_name"`
	SensorLocation    string      `json:"sensor_location" xml:"sensor_location"`
	WireID            *string     `json:"wire_id" xml:"wire_id"`
	I2CBus            *int        `json:"i2c_bus" xml:"i2c_bus"`
	I2CAddress        *uint8      `json:"i2c_address" xml:"i2c_address"`
	GPIONumber        *GPIO       `json:"gpio_number" xml:"gpio_number"`
	SensorModel       SensorModel `json:"sensor_model" xml:"sensor_model"`
	SensorEnabled     bool        `json:"sensor_enabled" xml:"sensor_enabled"`
	SensorLastContact *time.Time  `json:"sensor_last_contact" xml:"sensor_last_contact"`
	DeviceID          string      `json:"device_id" xml:"device_id"`
	CreationDate      time.Time   `json:"creation_date" xml:"creation_date"`
}

Sensor ...

func (*Sensor) JSONDecoder

func (s *Sensor) JSONDecoder(r io.Reader) error

JSONDecoder decodes a json into a sensor

func (*Sensor) JSONEncoder

func (s *Sensor) JSONEncoder(w io.Writer) error

func (*Sensor) Name

func (s *Sensor) Name() string

type SensorModel

type SensorModel string

func SelectSensorModel

func SelectSensorModel(model string) (SensorModel, error)

SelectSensorModel converts a string into a constant

Jump to

Keyboard shortcuts

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