aboutsummaryrefslogtreecommitdiff
path: root/addons/weather.wunderground/default.py
diff options
context:
space:
mode:
authortheuni <theuni-nospam-@xbmc.org>2012-02-07 01:20:19 -0500
committertheuni <theuni-nospam-@xbmc.org>2012-02-07 01:20:19 -0500
commit72529146da82905c4a36e86ed65ac1a47e6deb1b (patch)
treefc1f145edf67c4e5ec550a6120239813cb84dc23 /addons/weather.wunderground/default.py
parent1101614b45f4676a21334d0876c287f8fba12eb5 (diff)
sync: wunderground with addons repo
Diffstat (limited to 'addons/weather.wunderground/default.py')
-rw-r--r--addons/weather.wunderground/default.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/addons/weather.wunderground/default.py b/addons/weather.wunderground/default.py
index 632224ae85..c00e6d3ac6 100644
--- a/addons/weather.wunderground/default.py
+++ b/addons/weather.wunderground/default.py
@@ -129,7 +129,29 @@ if sys.argv[1].startswith('Location'):
else:
location = __addon__.getSetting('Location%sid' % sys.argv[1])
aik = base64.b64decode(A_I_K)
- forecast(location)
+ if not location == '':
+ forecast(location)
+ refresh_locations()
+ else:
+ # workaround to fix incrementing values on each weather refresh when no locations are set up:
+ set_property('Current.Condition' , 'N/A')
+ set_property('Current.Temperature' , '0')
+ set_property('Current.Wind' , '0')
+ set_property('Current.WindDirection' , 'N/A')
+ set_property('Current.Humidity' , '0')
+ set_property('Current.FeelsLike' , '0')
+ set_property('Current.UVIndex' , '0')
+ set_property('Current.DewPoint' , '0')
+ set_property('Current.OutlookIcon' , 'na.png')
+ set_property('Current.FanartCode' , 'na')
+ for count in range (0, 3):
+ set_property('Day%i.Title' % count, 'N/A')
+ set_property('Day%i.HighTemp' % count, '0')
+ set_property('Day%i.LowTemp' % count, '0')
+ set_property('Day%i.Outlook' % count, 'N/A')
+ set_property('Day%i.OutlookIcon' % count, 'na.png')
+ set_property('Day%i.FanartCode' % count, 'na')
+ # workaround to stop xbmc from running the script in a loop when no locations are set up:
+ set_property('Locations', '1')
-refresh_locations()
set_property('WeatherProvider', 'Weather Underground')