aboutsummaryrefslogtreecommitdiff
path: root/addons/weather.wunderground
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
parent1101614b45f4676a21334d0876c287f8fba12eb5 (diff)
sync: wunderground with addons repo
Diffstat (limited to 'addons/weather.wunderground')
-rw-r--r--addons/weather.wunderground/addon.xml7
-rw-r--r--addons/weather.wunderground/changelog.txt8
-rw-r--r--addons/weather.wunderground/default.py26
-rw-r--r--addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml7
4 files changed, 44 insertions, 4 deletions
diff --git a/addons/weather.wunderground/addon.xml b/addons/weather.wunderground/addon.xml
index d52f581866..ee79a9f304 100644
--- a/addons/weather.wunderground/addon.xml
+++ b/addons/weather.wunderground/addon.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="weather.wunderground" name="Weather Underground" version="0.0.2" provider-name="Team XBMC">
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="weather.wunderground" name="Weather Underground" version="0.0.4" provider-name="Team XBMC">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
@@ -9,11 +9,14 @@
<summary lang="bg">Синоптична прогноза от wunderground.com</summary>
<summary lang="en">Weather forecast from wunderground.com</summary>
<summary lang="se">Väderprognos från wunderground.com</summary>
+ <summary lang="zh">来自wunderground.com的天气预报</summary>
<description lang="bg">Прогноза за времето осигурена от Weather Underground (http://www.wunderground.com/)</description>
<description lang="en">Weather forecast provided by Weather Underground (http://www.wunderground.com/)</description>
<description lang="se">Väderprognos tillhandahållen av Weather Underground (http://www.wunderground.com/)</description>
+ <description lang="zh">由Weather Underground(http://www.wunderground.com/)提供的天气预报</description>
<disclaimer lang="en">Use of this add-on implies that you have agreed to the Terms of Service located at http://www.wunderground.com/weather/api/d/terms.html</disclaimer>
<disclaimer lang="se">Användning av detta tillägg innebär att du har godkänt Terms of Service från http://www.wunderground.com/weather/api/d/terms.html</disclaimer>
+ <disclaimer lang="zh">使用此扩展功能意味着你同意此连接下的服务条款:http://www.wunderground.com/weather/api/d/terms.html</disclaimer>
<platform>all</platform>
</extension>
</addon>
diff --git a/addons/weather.wunderground/changelog.txt b/addons/weather.wunderground/changelog.txt
index 3d8d737eca..d4ce40b10f 100644
--- a/addons/weather.wunderground/changelog.txt
+++ b/addons/weather.wunderground/changelog.txt
@@ -1,3 +1,11 @@
+v0.0.4
+- don't fetch weather when no locations are set up
+- fix incrementing values on each weather refresh when no locations are set up
+- workaround: stop xbmc from running the script in a loop when no locations are set up
+
+v0.0.3
+- added Simplified Chinese translation
+
v0.0.2
- show dialog instead of empty list when no locations are found
- added german translation
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')
diff --git a/addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml b/addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml
new file mode 100644
index 0000000000..ab8b025eb2
--- /dev/null
+++ b/addons/weather.wunderground/resources/language/Chinese (Simple)/strings.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<strings>
+ <string id="30101">所在地设置</string>
+ <string id="30111">更改地点1</string>
+ <string id="30112">更改地点2</string>
+ <string id="30113">更改地点3</string>
+</strings>