![]() |
|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
WIcons API - display original Weather Icons
For any developers that would like to display the original weather icons using the new Google/NWS API here are the 2 calls available from the WIcons plugin that you are certainly welcome to use.
WIcons_Icons_GetWeatherIconURL(String) String WIcons_Icons_GetWeatherIconURLDay(String) String - this call takes a string but expects a url in the form that the GoogleWeather API returns from either Google or NWS. - it will return a string that is the path to the original weather icon image if a match was found. If no match then the returned string is the original url passed in. - the ...URLDay call will ignore the current time of day and always return the Day Icon which is useful for forecasts. WIcons_Icons_GetWeatherIconNoURL(String) String WIcons_Icons_GetWeatherIconNoURLDay(String) String - these calls are the same as those above however they only return a number (as a string) that represents the Icon Image to use. - if no match is found these calls return "-1" Sample Google call... Code:
sage_google_weather_GoogleWeather_getGWCurrentCondition(GoogleWeatherInstance, "iconURL") Replace with... WIcons_Icons_GetWeatherIconURL(sage_google_weather_GoogleWeather_getGWCurrentCondition(GoogleWeatherInstance, "iconURL")) Code:
sage_google_weather_GoogleWeather_getNWSForecastCondition(GoogleWeatherInstance,ForecastPeriod,"icon_url") Replace with... WIcons_Icons_GetWeatherIconURLDay(sage_google_weather_GoogleWeather_getNWSForecastCondition(GoogleWeatherInstance,ForecastPeriod,"icon_url")) WIcons_Icons_GetWeatherIconURL uses Day Icon images between 7am and 7pm local time by default. You can override these times by adding properties to the sage properties file as follows... WIcons/DayStartHour=7 WIcons/DayEndHour=19 Let me know if there are any questions. k Last edited by jusjoken; 12-04-2011 at 07:29 PM. |
#2
|
|||
|
|||
Cool, this is just what I'm looking for
![]() Questions will follow I'm sure ![]()
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#3
|
||||
|
||||
Thanks much. I hope to make use of the API in the future.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#4
|
|||
|
|||
I'm not sure if we need to report this to google or you.....
The locations I entered was Scotland and Edinburgh... it got the rest of the data ok. WIcons: unhandled url - please report 'http://www.google.com' CurrFolder: \SageTV\SageTV\STVs\Ortus\Themes\Default\Weather/Icons\ww Other than that it works great. Thanks EDIT I think the current weather condition should have been "Chance of Snow"
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders Last edited by jaminben; 12-04-2011 at 01:02 PM. |
#5
|
||||
|
||||
Quote:
![]()
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#6
|
|||
|
|||
Quote:
![]()
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#7
|
|||
|
|||
Another quick question for you
![]() Does it take into account the time of day (day/night) when using: WIcons_Icons_GetWeatherIconURL(String) The reason I ask is because I've got my weather URL: http://www.google.com/ig/images/weat...tly_cloudy.gif And Its currently night time but the image I get back is of a cloudy sun rather than a cloudy moon. I've checked the default Sage icons and its icon 28.png where as I think it should be icon 33.png.... thats if it uses day/night images. Many Thanks Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#8
|
|||
|
|||
Quote:
I also tried SageTV without WIcons and you get a blank image for this location as well. Perhaps you can post something for Opus4 incase his API is catching an error or it could obviously be Google Weather istelf. Glad it's working for you otherwise. k |
#9
|
|||
|
|||
Quote:
You can override these times by adding properties as follows... WIcons/DayStartHour=7 WIcons/DayEndHour=19 I will update the fist post as well with this information. k |
#10
|
|||
|
|||
Quote:
![]() Ok, will do... One other quickie... yes I'm a pain ![]() Could you create a call that just exposes the image number? Although I've stripped away the bits I don't want it would be cleaner to just have the number... just a thought / feature request. Thanks Ben EDIT Quote:
EDIT 2 Scratch that... I was using the wrong call and thats why it was showing the sun (GetWeatherIconURLDay)..... Doh!!! Sorry ![]()
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders Last edited by jaminben; 12-04-2011 at 06:07 PM. |
#11
|
|||
|
|||
Quote:
k |
#12
|
|||
|
|||
Quote:
k |
#13
|
|||
|
|||
I made a mistake with my code from the above post about day/night images.... sorry (I edited it now).
Just 33... I use seperate images to the Provided Sage versions which are stored in their own folders but the folders still use the same numbering system. This way its pretty easy to create animated weather icons + backgrounds if needed. Thanks Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#14
|
|||
|
|||
Quote:
k |
#15
|
|||
|
|||
Quote:
k |
#16
|
|||
|
|||
Cool, those new calls worked a treat
![]() Thankyou ![]()
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plugin: WIcons - enables Day/Night Weather Icons for default SageTV STV | jusjoken | SageTV v7 Customizations | 28 | 10-17-2015 02:37 PM |
Weather Icons | saltlyck2 | SageTV Customizations | 3 | 06-05-2006 11:51 AM |
Weather Icons | DIBU | SageTV Customizations | 0 | 02-27-2005 08:14 AM |
Weather Icons | spike5884 | SageTV Customizations | 7 | 07-31-2004 03:05 AM |