Permalink
Browse files

Set "Current.Location" property for weather addon so that skins like …

…transparency can show the location name on the home screen.
  • Loading branch information...
mikrohard committed Jun 15, 2012
1 parent e82e22a commit c889acc63a4a0e3d4cb8c7b1e66399ed9b0f6873
Showing with 4 additions and 0 deletions.
  1. +4 −0 addons/weather.wunderground/default.py
@@ -103,6 +103,10 @@ def forecast(city):
def properties(query):
weathercode = WEATHER_CODES[query['current_observation']['icon_url'][31:-4]]
+ location = __addon__.getSetting('Location%s' % sys.argv[1])
+ if (location == '') and (sys.argv[1] != '1'):
+ location = __addon__.getSetting('Location1')
+ set_property('Current.Location' , location)
set_property('Current.Condition' , query['current_observation']['weather'])
set_property('Current.Temperature' , str(query['current_observation']['temp_c']))
set_property('Current.Wind' , str(query['current_observation']['wind_kph']))

0 comments on commit c889acc

Please sign in to comment.