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 ¶
View Source
var DefaultActionMapping = map[LEDAction]LEDColor{ LEDActionError: LEDColorRed, LEDActionWarn: LEDColorYellow, LEDActionRun: LEDColorGreen, LEDActionSync: LEDColorTurquoise, LEDActionLogfile: LEDColorBlue, }
View Source
var MeasuredValueTypes = []MeasuredValueType{ MeasuredValueTypeHumidity, MeasuredValueTypePressure, MeasuredValueTypeTemperature, }
Functions ¶
func GPIOToString ¶
Types ¶
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 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 ¶
JSONDecoder decodes a json into a sensor
type SensorModel ¶
type SensorModel string
func SelectSensorModel ¶
func SelectSensorModel(model string) (SensorModel, error)
SelectSensorModel converts a string into a constant
Click to show internal directories.
Click to hide internal directories.