2013-12-20, 22:29
Hi Community
So this is my first script i ever did in python, my first addon, and my first contribution to open source software, so please be gentle
The code from this addon is mainly based on yahoo weather and wunderground, additionally it supports (more or less) openweathermap maps api.
Weather descripions are translated by the OWM API. See here http://openweathermap.org/API#weather for a list of currently supported languages.
I'm not sure which versions of XBMC are working with it, i only tested with a recent nightly build. So please give feedback including a full debug log if something isn't working.
There are still some ToDo's:
- current versions shows no own window to see the weathermaps. I would leave this point to experienced skinners.
- use more than one map tile because its only 256x256px, a bit small maybe
- addon setting translations
- map explanations: for maps, there should be explanation pictures, showing the relationship between color and value. For now i couldn't find a documentation on openweathermap. A gimp file to start with is included in the ressource folder.
- i wanted to show the 'working...' notification during loading, but i couldn't find how to do it. Sometimes the data download does not work at once so the user has a feedback to be patient while the addon is trying to recieve the data.
- mapping weathercode to xbmc conditions icons. A list of weathercodes can be found here http://openweathermap.org/wiki/API/Weath...tion_Codes. I tried my best to match it to the default icons, but maybe a bit improvement is required.
Unfixable 'issues'
- Location search api does not provide a state information, only city and country are given. Thus it may be a bit difficult finding the right location.
- I'm not able to support Frodo. Its working by default but if you refresh the informations Frodo crashes (on XP). It seems related to line 18 "from PIL import Image" and i couldn't find a workaround.
Feature Requests
- None so far
Things you may notice
- Location Map is only downloaded once for each location and zoom level and background provider. The reason is simple: I don't think cities start moving around
- weather maps will only allow updating each six hours. This is done to prevent too much server load on their side
Changelog:
v1.0.0
- added polish translation (thx to sebf)
- added 3-hourly data, up to 12 entries
- log level set to debug
- skin fixes for gotham Beta 2
v0.0.6
- added french translation (thx to allophos)
see included file for full change log.
For Skinners
The following properties are set by the addon, in bold those which are currently not used by Confluence ( i didn't check other skins)
Current.Condition
Current.Temperature
Current.Wind
Current.WindDirection
Current.WindGust -> maximum wind speed in kmh
Current.Humidity
Current.FeelsLike
Current.DewPoint
Current.OutlookIcon
Current.FanartCode
Current.CloudCover -> CloudCover in %
Current.PrecipitationSnow -> Snow precipitation in mm (millimeter) / x hour where x can be 1 or 3
Current.PrecipitationRain -> Rain precipitation in mm (millimeter) / x hour where x can be 1 or 3
Today.Sunrise (in confluence only displayed if wunderground is used)
Today.Sunset (in confluence only displayed if wunderground is used)
Today.AvgHighTemperature -> Todays maximum temperature in C
Today.AvgLowTemperature -> Todays minimum temperature in C
Map.Location -> Full path to an image, showing a map tile from selected location
Map.Rain -> Full path to an image, showing a RAIN map tile from selected location
Map.Temperature -> Full path to an image, showing a TEMPERATURE map tile from selected location
Map.Clouds -> Full path to an image, showing a CLOUD map tile from selected location
Map.Wind -> Full path to an image, showing a WIND map tile from selected location
Map.Snow -> Full path to an image, showing a SNOW map tile from selected location
Map.Pressure -> Full path to an image, showing a PRESSURE map tile from selected location
Map.Precipitation -> Full path to an image, showing a PRECIPITATION map tile from selected location
Map.ColorDiffuse -> value in 0x$$FFFFFF, setting the transparency from the weathermap so you can see the underlying location map too
Day%i.Title
Day%i.HighTemp
Day%i.LowTemp
Day%i.Outlook
Day%i.OutlookIcon
Day%i.FanartCode
Day%i.CloudCover -> CloudCover in %
Day%i.Wind -> wind speed in kmh
Day%i.Winddirection -> as string
Finally, the addon can be found here:weather.openweathermap-1.0.0.zip
Older Versions:
http://www.file-upload.net/download-8429...4.zip.html
Any comments, improvements, feature requests, bugreports and fixes are welcome.
So this is my first script i ever did in python, my first addon, and my first contribution to open source software, so please be gentle
The code from this addon is mainly based on yahoo weather and wunderground, additionally it supports (more or less) openweathermap maps api.
Weather descripions are translated by the OWM API. See here http://openweathermap.org/API#weather for a list of currently supported languages.
I'm not sure which versions of XBMC are working with it, i only tested with a recent nightly build. So please give feedback including a full debug log if something isn't working.
There are still some ToDo's:
- current versions shows no own window to see the weathermaps. I would leave this point to experienced skinners.
- use more than one map tile because its only 256x256px, a bit small maybe
- addon setting translations
- map explanations: for maps, there should be explanation pictures, showing the relationship between color and value. For now i couldn't find a documentation on openweathermap. A gimp file to start with is included in the ressource folder.
- i wanted to show the 'working...' notification during loading, but i couldn't find how to do it. Sometimes the data download does not work at once so the user has a feedback to be patient while the addon is trying to recieve the data.
- mapping weathercode to xbmc conditions icons. A list of weathercodes can be found here http://openweathermap.org/wiki/API/Weath...tion_Codes. I tried my best to match it to the default icons, but maybe a bit improvement is required.
Unfixable 'issues'
- Location search api does not provide a state information, only city and country are given. Thus it may be a bit difficult finding the right location.
- I'm not able to support Frodo. Its working by default but if you refresh the informations Frodo crashes (on XP). It seems related to line 18 "from PIL import Image" and i couldn't find a workaround.
Feature Requests
- None so far
Things you may notice
- Location Map is only downloaded once for each location and zoom level and background provider. The reason is simple: I don't think cities start moving around
- weather maps will only allow updating each six hours. This is done to prevent too much server load on their side
Changelog:
v1.0.0
- added polish translation (thx to sebf)
- added 3-hourly data, up to 12 entries
- log level set to debug
- skin fixes for gotham Beta 2
v0.0.6
- added french translation (thx to allophos)
see included file for full change log.
For Skinners
The following properties are set by the addon, in bold those which are currently not used by Confluence ( i didn't check other skins)
Current.Condition
Current.Temperature
Current.Wind
Current.WindDirection
Current.WindGust -> maximum wind speed in kmh
Current.Humidity
Current.FeelsLike
Current.DewPoint
Current.OutlookIcon
Current.FanartCode
Current.CloudCover -> CloudCover in %
Current.PrecipitationSnow -> Snow precipitation in mm (millimeter) / x hour where x can be 1 or 3
Current.PrecipitationRain -> Rain precipitation in mm (millimeter) / x hour where x can be 1 or 3
Today.Sunrise (in confluence only displayed if wunderground is used)
Today.Sunset (in confluence only displayed if wunderground is used)
Today.AvgHighTemperature -> Todays maximum temperature in C
Today.AvgLowTemperature -> Todays minimum temperature in C
Map.Location -> Full path to an image, showing a map tile from selected location
Map.Rain -> Full path to an image, showing a RAIN map tile from selected location
Map.Temperature -> Full path to an image, showing a TEMPERATURE map tile from selected location
Map.Clouds -> Full path to an image, showing a CLOUD map tile from selected location
Map.Wind -> Full path to an image, showing a WIND map tile from selected location
Map.Snow -> Full path to an image, showing a SNOW map tile from selected location
Map.Pressure -> Full path to an image, showing a PRESSURE map tile from selected location
Map.Precipitation -> Full path to an image, showing a PRECIPITATION map tile from selected location
Map.ColorDiffuse -> value in 0x$$FFFFFF, setting the transparency from the weathermap so you can see the underlying location map too
Day%i.Title
Day%i.HighTemp
Day%i.LowTemp
Day%i.Outlook
Day%i.OutlookIcon
Day%i.FanartCode
Day%i.CloudCover -> CloudCover in %
Day%i.Wind -> wind speed in kmh
Day%i.Winddirection -> as string
Finally, the addon can be found here:weather.openweathermap-1.0.0.zip
Older Versions:
http://www.file-upload.net/download-8429...4.zip.html
Any comments, improvements, feature requests, bugreports and fixes are welcome.