add lightning sensor
This commit is contained in:
		| @@ -59,6 +59,8 @@ func UpdateToPbUpdate(u *weather.WeatherUpdate) *pb.WeatherUpdate { | ||||
| 		WindChillF:          u.WindChillF, | ||||
| 		TempHumiditySensors: thSensorsToPbSensors(u.TempHumiditySensors), | ||||
| 		UpdateTimestamp:     timestamppb.New(*u.DateUTC), | ||||
| 		LightningDay:        util.Int32ptr(u.LightningDay), | ||||
| 		LightningDistance:   util.Int32ptr(u.LightningDistance), | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -52,6 +52,10 @@ 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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user