2019-06-25 20:22:34 +00:00
|
|
|
package types
|
|
|
|
|
2019-07-02 20:33:01 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2020-05-03 12:04:08 +00:00
|
|
|
// MeasuredValue represent a value provided by a measuring instrument. For
|
|
|
|
// example from a sensor. It can contains different types, for example humidity
|
|
|
|
// or temperature.
|
2019-07-02 20:33:01 +00:00
|
|
|
type MeasuredValue struct {
|
2020-09-21 17:36:42 +00:00
|
|
|
ID string `json:"id" xml:"id"`
|
2021-05-16 21:02:46 +00:00
|
|
|
Value float64 `json:"value,string" xml:"value"`
|
2020-09-21 17:36:42 +00:00
|
|
|
ValueType MeasuredValueType `json:"value_type" xml:"value_type"`
|
|
|
|
Date time.Time `json:"date" xml:"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"`
|
2019-07-02 20:33:01 +00:00
|
|
|
}
|
2020-09-21 17:36:42 +00:00
|
|
|
|
|
|
|
type MeasuredValueType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
Humidity MeasuredValueType = "humidity"
|
2021-05-16 21:02:46 +00:00
|
|
|
Pressure MeasuredValueType = "pressure"
|
|
|
|
Temperature MeasuredValueType = "temperature"
|
2020-09-21 17:36:42 +00:00
|
|
|
)
|