diff --git a/storage/influxdb-storage.go b/storage/influxdb-storage.go index b61173a..2697441 100644 --- a/storage/influxdb-storage.go +++ b/storage/influxdb-storage.go @@ -32,7 +32,7 @@ func (storage *influxStorage) Save(data WeatherData) error { fields := map[string]interface{}{ "temperature": data.Temperature, "humidity": data.Humidity, - "preasure": data.Preasure} + "pressure": data.Pressure} datapoint := influxdb2.NewPoint("new2", tags, diff --git a/storage/weather-data.go b/storage/weather-data.go index d6e2cf5..b339441 100644 --- a/storage/weather-data.go +++ b/storage/weather-data.go @@ -14,7 +14,7 @@ type WeatherStorage interface { //WeatherData type type WeatherData struct { Humidity float64 `json:"humidity"` - Preasure float64 `json:"airPreasure"` + Pressure float64 `json:"airPressure"` Temperature float64 `json:"temperature"` Location string `json:"location"` TimeStamp time.Time `json:"timestamp"` @@ -25,7 +25,7 @@ func NewRandomWeatherData(location string) WeatherData { rand.Seed(time.Now().UnixNano()) var data WeatherData data.Humidity = rand.Float64() * 100 - data.Preasure = rand.Float64()*80 + 960 + data.Pressure = rand.Float64()*80 + 960 data.Temperature = rand.Float64()*40 - 5 data.Location = location data.TimeStamp = time.Now() diff --git a/weathersource/mqtt-source.go b/weathersource/mqtt-source.go index bc03dfa..1548922 100644 --- a/weathersource/mqtt-source.go +++ b/weathersource/mqtt-source.go @@ -59,7 +59,7 @@ func (source *mqttWeatherSource) mqttMessageHandler() mqtt.MessageHandler { } if strings.HasSuffix(msg.Topic(), "pressure") { - source.lastData.Preasure, _ = strconv.ParseFloat(string(msg.Payload()), 64) + source.lastData.Pressure, _ = strconv.ParseFloat(string(msg.Payload()), 64) source.lastData.TimeStamp = time.Now() } if strings.HasSuffix(msg.Topic(), "temp") {