sensors

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AirQuality added in v0.0.25

type AirQuality struct {
	NamedSensor
	Name     string        `json:"name" mapstructure:"name"`
	Analog   bool          `json:"analog" mapstructure:"analog"`
	Pin      uint8         `json:"pin" mapstructure:"pin"`
	Interval time.Duration `json:"interval" mapstructure:"interval"`
	Update   *UpdateRate   `json:"update,omitempty" mapstructure:"update,omitempty"`
}

func (AirQuality) GetName added in v0.0.46

func (s AirQuality) GetName() string

type AirQualitySensorData added in v0.0.24

type AirQualitySensorData struct {
	Sensor     *AirQuality  `json:"sensor,omitempty"`
	AirQuality *SensorValue `json:"airQuality,omitempty"`
}

func (*AirQualitySensorData) String added in v0.0.24

func (s *AirQualitySensorData) String() string

type AirQualitySensorDataResponse added in v0.0.38

type AirQualitySensorDataResponse struct {
	SensorResponse
	Data []*AirQualitySensorData `json:"data"`
}

type BME280 added in v0.0.25

type BME280 struct {
	NamedSensor
	Name   string      `json:"name" mapstructure:"name"`
	Bus    int         `json:"bus" mapstructure:"bus"`
	Update *UpdateRate `json:"update,omitempty" mapstructure:"update,omitempty"`
}

func (*BME280) GetName added in v0.0.46

func (s *BME280) GetName() string

type BMPSensorData

type BMPSensorData struct {
	Sensor     *BME280      `json:"sensor,omitempty"`
	Temprature *SensorValue `json:"temprature,omitempty"`
	Pressure   *SensorValue `json:"pressure,omitempty"`
	Humidity   *SensorValue `json:"humidity,omitempty"`
}

BMPSensorData json converter

func (*BMPSensorData) String

func (s *BMPSensorData) String() string

type BMPSensorDataResponse added in v0.0.38

type BMPSensorDataResponse struct {
	SensorResponse
	Data []*BMPSensorData `json:"data"`
}

type Loudness added in v0.0.35

type Loudness struct {
	NamedSensor
	Name     string        `json:"name" mapstructure:"name"`
	Analog   bool          `json:"analog" mapstructure:"analog"`
	Pin      uint8         `json:"pin" mapstructure:"pin"`
	Interval time.Duration `json:"interval" mapstructure:"interval"`
	Update   *UpdateRate   `json:"update,omitempty" mapstructure:"update,omitempty"`
}

func (*Loudness) GetName added in v0.0.46

func (s *Loudness) GetName() string

type LoudnessSensorData added in v0.0.35

type LoudnessSensorData struct {
	Sensor   *Loudness    `json:"sensor,omitempty"`
	Loudness *SensorValue `json:"loudness,omitempty"`
}

func (*LoudnessSensorData) String added in v0.0.35

func (s *LoudnessSensorData) String() string

type LoudnessSensorDataResponse added in v0.0.38

type LoudnessSensorDataResponse struct {
	SensorResponse
	Data []*LoudnessSensorData `json:"data"`
}

type Meta added in v0.0.39

type Meta struct {
	MeasuredAt time.Time `json:"measuredAt"`
}

type NU40C16 added in v0.0.25

type NU40C16 struct {
	NamedSensor
	Name   string      `json:"name" mapstructure:"name"`
	Pin    uint8       `json:"pin" mapstructure:"pin"`
	Update *UpdateRate `json:"update,omitempty" mapstructure:"update,omitempty"`
}

func (*NU40C16) GetName added in v0.0.46

func (s *NU40C16) GetName() string

type NU40C16SensorData

type NU40C16SensorData struct {
	Sensor   *NU40C16     `json:"sensor,omitempty"`
	Distance *SensorValue `json:"distance,omitempty"`
}

NU40C16SensorData json converter

func (*NU40C16SensorData) String added in v0.0.18

func (s *NU40C16SensorData) String() string

type NU40C16SensorDataResponse added in v0.0.38

type NU40C16SensorDataResponse struct {
	SensorResponse
	Data []*NU40C16SensorData `json:"data"`
}

type NamedSensor added in v0.0.46

type NamedSensor interface {
	GetName() string
}

type SI1145 added in v0.0.25

type SI1145 struct {
	NamedSensor
	Name   string      `json:"name" mapstructure:"name"`
	Bus    int         `json:"bus" mapstructure:"bus"`
	Update *UpdateRate `json:"update,omitempty" mapstructure:"update,omitempty"`
}

func (*SI1145) GetName added in v0.0.46

func (s *SI1145) GetName() string

type SI1145SensorData

type SI1145SensorData struct {
	Sensor       *SI1145      `json:"sensor,omitempty"`
	Visible      *SensorValue `json:"visible,omitempty"`
	InfraRed     *SensorValue `json:"infraRed,omitempty"`
	UltraViolett *SensorValue `json:"ultraViolett,omitempty"`
}

SI1145SensorData json converter

func (*SI1145SensorData) String

func (s *SI1145SensorData) String() string

type SI1145SensorDataResponse added in v0.0.38

type SI1145SensorDataResponse struct {
	SensorResponse
	Data []*SI1145SensorData `json:"data"`
}

type SensorResponse added in v0.0.39

type SensorResponse struct {
	Meta Meta `json:"meta"`
}

type SensorSupport added in v0.0.20

type SensorSupport struct {
	Enabled             bool           `json:"enabled" mapstructure:"enabled"`
	Bme280Support       bool           `json:"bme280Support" mapstructure:"bme280Support"`
	Bme280              []BME280       `json:"bme280" mapstructure:"bme280"`
	Si1145Support       bool           `json:"si1145Support" mapstructure:"si1145Support"`
	Si1145              []SI1145       `json:"si1145" mapstructure:"si1145"`
	Nu40c16Support      bool           `json:"nu40c16Support" mapstructure:"nu40c16Support"`
	Nu40c16             []NU40C16      `json:"nu40c16" mapstructure:"nu40c16"`
	SoilMoistureSupport bool           `json:"soilMoistureSupport" mapstructure:"soilMoistureSupport"`
	SoilMoisture        []SoilMoisture `json:"soilMoisture" mapstructure:"soilMoisture"`
	AirQualitySupport   bool           `json:"airQualitySupport" mapstructure:"airQualitySupport"`
	AirQuality          []AirQuality   `json:"airQuality" mapstructure:"airQuality"`
	LoudnessSupport     bool           `json:"loudnessSupport" mapstructure:"loudnessSupport"`
	Loudness            []Loudness     `json:"loudness" mapstructure:"loudness"`
}

SensorSupport of a service

func (SensorSupport) String added in v0.0.22

func (c SensorSupport) String() string

type SensorType added in v0.0.41

type SensorType int
const (
	SensorType_BMP SensorType = iota
	SensorType_SI1145
	SensorType_NU40C16
	SensorType_SoilMoisture
	SensorType_AirQuality
	SensorType_Loudness
)

type SensorValue

type SensorValue struct {
	Value    float32 `json:"value"`
	Unit     string  `json:"unit"`
	UnitName string  `json:"unitName"`
}

SensorValue is a triple of a float value, unit and a human readable name

func (*SensorValue) String

func (v *SensorValue) String() string

type SoilMoisture added in v0.0.25

type SoilMoisture struct {
	NamedSensor
	Name     string        `json:"name" mapstructure:"name"`
	Analog   bool          `json:"analog" mapstructure:"analog"`
	Pin      uint8         `json:"pin" mapstructure:"pin"`
	Interval time.Duration `json:"interval" mapstructure:"interval"`
	Update   *UpdateRate   `json:"update,omitempty" mapstructure:"update,omitempty"`
}

func (*SoilMoisture) GetName added in v0.0.46

func (s *SoilMoisture) GetName() string

type SoilMoistureSensorData added in v0.0.19

type SoilMoistureSensorData struct {
	Sensor       *SoilMoisture `json:"sensor,omitempty"`
	SoilMoisture *SensorValue  `json:"soilMoisture,omitempty"`
}

SoilMoistureSensorData json converter

func (*SoilMoistureSensorData) String added in v0.0.19

func (s *SoilMoistureSensorData) String() string

type SoilMoistureSensorDataResponse added in v0.0.38

type SoilMoistureSensorDataResponse struct {
	SensorResponse
	Data []*SoilMoistureSensorData `json:"data"`
}

type UpdateRate added in v0.0.29

type UpdateRate struct {
	RateMs int `json:"rateMs,omitempty" mapstructure:"rateMs,omitempty"`
}

Jump to

Keyboard shortcuts

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