add json tags
This commit is contained in:
parent
268bc7d8a2
commit
3279c6fd38
1
TODO.md
1
TODO.md
@ -2,6 +2,7 @@
|
||||
- [x] Redis recorder panic
|
||||
|
||||
# TODO
|
||||
- [ ] Make lightning distance unit configurable (kph|mph)
|
||||
- [ ] Set TTL on redis key
|
||||
- [ ] Add json schema to CI and README
|
||||
- [ ] Update README
|
||||
|
@ -9,56 +9,56 @@ import (
|
||||
// Stable intermediate struct containing superset of fields
|
||||
// between AWN and Wunderground style updates from Ambient devices
|
||||
type WeatherUpdate struct {
|
||||
DateUTC *time.Time
|
||||
StationConfig *config.WeatherStation
|
||||
StationID *string
|
||||
StationType *string
|
||||
TempOutdoorF *float64
|
||||
TempIndoorF *float64
|
||||
HumidityOudoor *int
|
||||
HumidityIndoor *int
|
||||
WindSpeedMPH *float64
|
||||
WindGustMPH *float64
|
||||
MaxDailyGust *float64
|
||||
WindDir *int
|
||||
WindDirAvg10m *int
|
||||
UV *int
|
||||
SolarRadiation *float64
|
||||
HourlyRainIn *float64
|
||||
EventRainIn *float64
|
||||
DailyRainIn *float64
|
||||
WeeklyRainIn *float64
|
||||
MonthlyRainIn *float64
|
||||
YearlyRainIn *float64
|
||||
TotalRainIn *float64
|
||||
Batteries []BatteryStatus
|
||||
BaromRelativeIn *float64
|
||||
BaromAbsoluteIn *float64
|
||||
DateUTC *time.Time `json:"dateUTC,omitempty"`
|
||||
StationConfig *config.WeatherStation `json:"stationConfig,omitempty"`
|
||||
StationID *string `json:"stationID,omitempty"`
|
||||
StationType *string `json:"stationType,omitempty"`
|
||||
TempOutdoorF *float64 `json:"tempOutdoorF,omitempty"`
|
||||
TempIndoorF *float64 `json:"tempIndoorF,omitempty"`
|
||||
HumidityOudoor *int `json:"humidityOudoor,omitempty"`
|
||||
HumidityIndoor *int `json:"humidityIndoor,omitempty"`
|
||||
WindSpeedMPH *float64 `json:"windSpeedMPH,omitempty"`
|
||||
WindGustMPH *float64 `json:"windGustMPH,omitempty"`
|
||||
MaxDailyGust *float64 `json:"maxDailyGust,omitempty"`
|
||||
WindDir *int `json:"windDir,omitempty"`
|
||||
WindDirAvg10m *int `json:"windDirAvg10M,omitempty"`
|
||||
UV *int `json:"uv,omitempty"`
|
||||
SolarRadiation *float64 `json:"solarRadiation,omitempty"`
|
||||
HourlyRainIn *float64 `json:"hourlyRainIn,omitempty"`
|
||||
EventRainIn *float64 `json:"eventRainIn,omitempty"`
|
||||
DailyRainIn *float64 `json:"dailyRainIn,omitempty"`
|
||||
WeeklyRainIn *float64 `json:"weeklyRainIn,omitempty"`
|
||||
MonthlyRainIn *float64 `json:"monthlyRainIn,omitempty"`
|
||||
YearlyRainIn *float64 `json:"yearlyRainIn,omitempty"`
|
||||
TotalRainIn *float64 `json:"totalRainIn,omitempty"`
|
||||
Batteries []BatteryStatus `json:"batteries,omitempty"`
|
||||
BaromRelativeIn *float64 `json:"baromRelativeIn,omitempty"`
|
||||
BaromAbsoluteIn *float64 `json:"baromAbsoluteIn,omitempty"`
|
||||
// These fields may be calculated
|
||||
// if not otherwise set
|
||||
DewPointF *float64
|
||||
WindChillF *float64
|
||||
DewPointF *float64 `json:"dewPointF,omitempty"`
|
||||
WindChillF *float64 `json:"windChillF,omitempty"`
|
||||
// Extra Temp+Humidity Sensors
|
||||
TempHumiditySensors []*TempHumiditySensor
|
||||
TempHumiditySensors []*TempHumiditySensor `json:"tempHumiditySensors,omitempty"`
|
||||
// Lightning Data
|
||||
*LightningData
|
||||
}
|
||||
|
||||
type LightningData struct {
|
||||
LightningDay *int // Count of detections
|
||||
LightningDistance *int // Last detection distance [kilometers]
|
||||
LightningTime *int // Last detection time
|
||||
LightningDay *int `json:"lightningDay,omitempty"` // Count of detections
|
||||
LightningDistance *int `json:"lightningDistance,omitempty"` // Last detection distance [kilometers]
|
||||
LightningTime *int `json:"lightningTime,omitempty"` // Last detection time
|
||||
}
|
||||
|
||||
type TempHumiditySensor struct {
|
||||
Name string
|
||||
TempF *float64
|
||||
Humidity *int
|
||||
Name string `json:"name,omitempty"`
|
||||
TempF *float64 `json:"tempF,omitempty"`
|
||||
Humidity *int `json:"humidity,omitempty"`
|
||||
}
|
||||
|
||||
type BatteryStatus struct {
|
||||
Component string
|
||||
Status *int
|
||||
Component string `json:"component,omitempty"`
|
||||
Status *int `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// CHORE: Maintain this, used to check against
|
||||
|
Loading…
x
Reference in New Issue
Block a user