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