Kodi Community Forum

Full Version: How to load custom icons on my weather addon?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there, I'm revamping my old weather addon that was not working lately. Due to a different weather codes that are used by the source of the weather information I've decided to get their icons and use them. The thing is that I'm not able to get Kodi to load them, it always returns
Code:
ERROR: CImageLoader:Big GrinoWork - Direct texture file loading failed for resource://resource.images.weathericons.default/path_to_icon

Icons are inside ./resources/media folder so I get this path using
python:
__icons__ = xbmc.translatePath(os.path.join(__addonpath__, 'resources', 'media' ))

and then set the corresponding icon by
python:
set_property('Daily.%i.OutlookIcon' %i, os.path.join(__icons__, "%i.png" %code))
weather addons don't have to provide the path to the icons. that's handled by the skin.
see: https://forum.kodi.tv/showthread.php?tid=245717
So the only way to use custom icons is to make an image resource addon? This icon pack won't be useful for other plugins as the forecast coding does not match.
yup, an image resource addon is the way to go.
in addition you need to map the codes your weather provider uses to the standard used by kodi.
https://kodi.wiki/view/Weather_addons#Weather_Codes
(2019-02-12, 23:57)ronie Wrote: [ -> ]yup, an image resource addon is the way to go.
I've been unable to use it. I've created a weather icons resource and Kodi detects it, but there is no way I can set it to be used on my weather addon. Even for Weather Icons HD Animated I can't find a way to set them.
(2019-02-12, 23:57)ronie Wrote: [ -> ]in addition you need to map the codes your weather provider uses to the standard used by kodi.
https://kodi.wiki/view/Weather_addons#Weather_Codes
This is complicated as my weather provider exposes more (or at least different) weather situations, I would prefer to be able to pass its own code and let the icons resource match it.
it's up to the skin you're using to decide which image resource it uses for weather icons.
some skins have it hardcoded, some will offer the user to select one.

..and as said, mapping the weather codes from your provider to the ones used by kodi is the only option.
I'm using the default skin, isn't that supported on it?
nope, it's hardcoded in the estuary skin.
My proposition for solve this question: https://forum.kodi.tv/showthread.php?tid=354499