Commit: bad4f967d3541666e7b2a4c858749aa3597512e2 Parent: 1cf0824faf225a446bdf7447b36d08fabd142c86 Author: Vi Grey Date: 2023-08-16 22:06 UTC Summary: Fix crash from tempC CHANGELOG.md | 12 ++++++++++++ src/weather-nws.go | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ea27a5..31274e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +## [0.0.1] - 2023-08-16 + +### Fixed + +- Colon after Apparent Temperature printout + + +### Changed + +- Use metar weather rather than weather struct for temp C + + ## [0.0.0] - 2023-08-04 ### Added diff --git a/src/weather-nws.go b/src/weather-nws.go index 0b0c636..b6727aa 100644 --- a/src/weather-nws.go +++ b/src/weather-nws.go @@ -107,7 +107,7 @@ func getWeather() (w WeatherResponse) { func getWeatherStr(w Weather, mw MetarWeather) (weatherStr string) { temp := celciusToFahrenheit(mw.temperature) - tempC := *w.Temperature.Value + tempC := mw.temperature dp := celciusToFahrenheit(mw.dewPoint) rh := tempDewPointToRelativeHumidity(mw.temperature, mw.dewPoint) wd := windDirections[int((mw.windDirection*2/45)+0.5)%16] @@ -131,7 +131,7 @@ func getWeatherStr(w Weather, mw MetarWeather) (weatherStr string) { return } weatherStr = fmt.Sprintf("Weather Station: %s\nTime: %s\n\n"+ - "Temperature: %.2fF\nApparent Temperature %.2fF\n", stationID, + "Temperature: %.2fF\nApparent Temperature: %.2fF\n", stationID, w.Timestamp.Format(time.RFC1123), temp, at) if int(hi+0.5) != int(temp+0.5) { weatherStr += fmt.Sprintf("Heat Index: %.2fF\n", hi)