Skip to content

Bug/Enhancement: Visibility, Sunrise, Sunset data returned by OpenWeatherMap is not captured in by json frontend #150

@poetaman

Description

@poetaman

As I dig more into data returned by OpenWeatherMap, it looks like multiple fields (visibility,sunset,sunrise) are not output correctly by json frontend of wego.

Here's an example of data returned by OpenWeatherMap:

{
  2   "cod": "200",
  3   "message": 0,
  4   "cnt": 40,
  5   "list": [
  6     {
  7       "dt": 1611468000,
  8       "main": {
  9         "temp": 9.02,
 10         "feels_like": 6.94,
 11         "temp_min": 9.02,
 12         "temp_max": 9.74,                                                                                                                
 13         "pressure": 1014,
 14         "sea_level": 1014,
 15         "grnd_level": 1012,
 16         "humidity": 80,
 17         "temp_kf": -0.72
 18       },
 19       "weather": [
 20         {
 21           "id": 800,
 22           "main": "Clear",
 23           "description": "clear sky",
 24           "icon": "01n"
 25         }
 26       ],
 27       "clouds": {
 28         "all": 1
 29       },
 30       "wind": {
 31         "speed": 1.59,
 32         "deg": 290
 33       },
 34       "visibility": 10000,  // <-- Visibility  Visibility  Visibility  Visibility  Visibility  Visibility 
 35       "pop": 0,
 36       "sys": {
 37         "pod": "n"
 38       },
 39       "dt_txt": "2021-01-24 06:00:00"
 40     },
 41     {
 42       ...
 43     },
 44     .
 45     .
 46     .
 47   ]
 48   "city": {
 49     "id": 5391959,
 50     "name": "San Francisco",
 51     "coord": {
 52       "lat": <hidden>,
 53       "lon": <hidden>
 54     },
 55     "country": "US",
 56     "population": 805235,
 57     "timezone": -28800,
 58     "sunrise": 1611415194, // <-- Sunrise  Sunrise  Sunrise  Sunrise  Sunrise  Sunrise 
 59     "sunset": 1611451383 // <-- Sunset  Sunset  Sunset  Sunset  Sunset  Sunset
 60   }
 61 }

And here is json returned by >> wego -f json

{
	"Current": {
		"Time": "2021-01-24T01:00:00-08:00",
		"Code": 14,
		"Desc": "clear sky",
		"TempC": 8.63,
		"FeelsLikeC": 9.33,
		"ChanceOfRainPercent": null,
		"PrecipM": 0,
		"VisibleDistM": null,
		"WindspeedKmph": 1.7279999,
		"WindGustKmph": null,
		"WinddirDegree": 171,
		"Humidity": 80
	},
	"Forecast": [
		{
			"Date": "2021-01-24T01:00:00-08:00",
			"Slots": [
				{
					"Time": "2021-01-24T01:00:00-08:00",
					"Code": 14,
					"Desc": "clear sky",
					"TempC": 8.63,
					"FeelsLikeC": 9.33,
					"ChanceOfRainPercent": null,
					"PrecipM": 0,
					"VisibleDistM": null, <-- Visibility  Visibility  Visibility  Visibility  Visibility  Visibility 
					"WindspeedKmph": 1.7279999,
					"WindGustKmph": null,
					"WinddirDegree": 171,
					"Humidity": 80
				},
				{
					...
				}
				.
				.
				.
			],
			"Astronomy": {
				"Moonrise": "0001-01-01T00:00:00Z",
				"Moonset": "0001-01-01T00:00:00Z",
				"Sunrise": "0001-01-01T00:00:00Z",  <-- Sunrise  Sunrise  Sunrise  Sunrise  Sunrise  Sunrise 
				"Sunset": "0001-01-01T00:00:00Z" <-- Sunset  Sunset  Sunset  Sunset  Sunset  Sunset 
			}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions