Fix embedded lightning data
This commit is contained in:
parent
3279c6fd38
commit
1ee231fe30
@ -52,10 +52,8 @@ var mockUpdate = &weather.WeatherUpdate{
|
||||
TempHumiditySensors: []*weather.TempHumiditySensor{
|
||||
{Name: "sensor1", TempF: ptr.To(99.999), Humidity: nil},
|
||||
},
|
||||
LightningData: &weather.LightningData{
|
||||
LightningDay: ptr.To(1),
|
||||
LightningDistance: ptr.To(20),
|
||||
},
|
||||
}
|
||||
|
||||
func TestUpdateToPbUpdate(t *testing.T) {
|
||||
|
@ -143,11 +143,9 @@ func MapAwnUpdate(awnUpdate *AmbientWeatherUpdate) *weather.WeatherUpdate {
|
||||
{Name: THSensor + "7", TempF: awnUpdate.Temp7F, Humidity: awnUpdate.Humidity7},
|
||||
{Name: THSensor + "8", TempF: awnUpdate.Temp8F, Humidity: awnUpdate.Humidity8},
|
||||
},
|
||||
LightningData: &weather.LightningData{
|
||||
LightningDay: awnUpdate.LightningDay,
|
||||
LightningDistance: awnUpdate.LightningDistance,
|
||||
LightningTime: awnUpdate.LightningTime,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,10 +41,6 @@ type WeatherUpdate struct {
|
||||
// Extra Temp+Humidity Sensors
|
||||
TempHumiditySensors []*TempHumiditySensor `json:"tempHumiditySensors,omitempty"`
|
||||
// Lightning Data
|
||||
*LightningData
|
||||
}
|
||||
|
||||
type LightningData struct {
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user