enkore / i3pystatus

A complete replacement for i3status
https://i3pystatus.readthedocs.io/
MIT License
445 stars 188 forks source link

Weather.com shows location code and not city #751

Closed CPrompt closed 5 years ago

CPrompt commented 5 years ago

Updated to the latest version and still seems to show location code instead of the actual city. Seems to have just started doing this within the past few days.

Running Fedora 30

Link to config if needed: https://github.com/CPrompt/configs/blob/master/i3/i3pystatus/config_monitor1.py

CPrompt commented 5 years ago

status log entry: 2019-06-08 09:12:48,359 [WARNING ][i3pystatus.weather.weathercom.Weathercom 259] Failed to get city name from API response, falling back to location code 'USNC0314:1:US'

CPrompt commented 5 years ago

If I'm understanding the code correctly, this section: self.city_name = self.city_name['data']['prsntNm']

is looking for the key in the json output and it's not there. Could have been an update on the Weather.com side?

Changing it to something like: self.city_name = self.city_name['data']['location']['displayName']

displays the city correctly, but not sure if that is in line with the module.

terminalmage commented 5 years ago

Yeah, I think you're probably right. I'll be able to look at this later today. Thanks for reporting!

CPrompt commented 5 years ago

No problem. I submitted a pull request if that helps.

Thanks!

terminalmage commented 5 years ago

Awesome, I just merged.