Sounds good
How are sports handled for Classic/Boom/Transporter players ?
I can see that in the SDT settings page in server settings you can select a team but there doesn't seem to be any sports related settings in the player settings ?
Is sports separate %* keywords in players settings ?
Or does the player switch between showing sports information selected in server settings and the weather information selected in player settings ?
If team is only selected in server settings, the Custom Clock should be able to use that setting to know which sports information it should display.
Results 21 to 30 of 225
-
2010-04-27, 23:18 #21Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.
-
2010-04-28, 05:40 #22
Currently users specify the teams they're interested at the plugin-level. All players show the same teams.
Sports do not have custom %* macros. Basically the plugin shows weather-related for x seconds that include the %* macros and then shows each sports score/etc. for y seconds cycling one after each other.Is sports separate %* keywords in players settings ?
Or does the player switch between showing sports information selected in server settings and the weather information selected in player settings ?
At the player-level the user can specify what they want their weather screens to look like via the %* macros. They can actually specify multiple views that they can cycle between via the up/down remote buttons. They can also immediately cycle the sports/etc info by using the right/left remote buttons.
True! I didn't think of that. Each selected team is stored as an array. In some cases 'All' is also a valid choice.If team is only selected in server settings, the Custom Clock should be able to use that setting to know which sports information it should display.
-
2010-04-28, 08:24 #23Senior Member
- Join Date
- Aug 2007
- Location
- Portland, OR, USA
- Posts
- 218
There's a few things about the code that I think needs some attention to make it more robust. First, for each line of text or image, it makes a separate request, and each of these requests is done in parallel (assync, right?). I think they can step on each other if there's some lag, or an error, and that's probably not good. We could easily send SDT an array/table of request strings and have it process them all at once. [Edit: I saw some weirdness in the logs when it was fetching data every second, but after switching to 10 second polling, I haven't seen that problem generally]
Might be tricky to do in CustomClock, since it's geared towards reading in the config data and getting results right away. But you could have it building up the request array, and then have it go to a function that:
1. Checks to see if the data is updated, if not, use cached information.
2. Sends the appropriate request, gets results, and parses them for all strings.
Also, this block of text doesn't process if the player is in play mode. Is there a reason for that? It looks like the playerStatus.mode isn't necessary, since it will never (?) call this routine unless the ScreenSaver timeout has occurred, right?
-Danfunction _getLocalizedWeatherInfo(self,time,text,no)
local player = appletManager:callService("getCurrentPlayer")
local playerStatus = player:getPlayerStatus()
log:debug("Received text: "..text)
if playerStatus.mode ~= 'play' or self:getSettings()["nowplaying"] == false then
...
endLast edited by plympton; 2010-04-28 at 09:25. Reason: clarification
-
2010-04-28, 10:15 #24
I think it should be doable to handle this in Custom Clock, it's just a matter of collecting all sdttext items before requesting them. If you could implement the JSON command on the plugin side that would be a good start.
We basically just need some code that iterates through all items in self.configItems and finds all items of stdtext and gets their formatting string and create the request to the server. The response would have modify the text in the self.items structure for all corresponding items.
Do you think users will have a lot of sdt items on the same screen ?
Would the different items have to be synchronized so they switch to new values simultaneously ?
If there are just a few items and they doesn't have to be completely synchronized, it might not be worth to combine them into a single request.
I'll have to check your code updates to know for sure, but it sounds like it shouldn't check playserStatus.mode in this case. I've been busy with some comboxbox implementations for color attributes in web ui and the spectrummeter item during the last days, so I haven't had the chance to look into SDT in detail yet. Hopefully I should get some time later in the week.
One more question, how are the sdt weather images handled in your implementation. Does it only get the image for the current day or is it possible to configure if it should get the image for today, tomorrow or the day after that.
What about the sdt weather text items, do they only look at current day or can you show weather for the next days too ?
Regarding sport/game scores I'm starting to think they would be best to handle as a separate item type so I think we can ignore them for now, it's better to get something up and running for the weather info.Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.
-
2010-04-28, 10:26 #25Senior Member
- Join Date
- Aug 2007
- Location
- Portland, OR, USA
- Posts
- 218
I think most people will only have 4-10 (max) items on the screen at once. Who knows, with a slate squeezebox..iSqueezeBox.. whatever. :-)
I changed it, and it's fine. I think it's just an artifact of example code.I'll have to check your code updates to know for sure, but it sounds like it shouldn't check playserStatus.mode in this case.
Right now, it just fetches the current image, but I'm going to make changes and create a new icon request. Let me think on this one - make it fetch all at once (get a table back). I might use the power of automatic parameter loading on the plugin side to make it flexible on the LUA side.One more question, how are the sdt weather images handled in your implementation. Does it only get the image for the current day or is it possible to configure if it should get the image for today, tomorrow or the day after that.
You should be able to look at anything you want - any combo. I can easily see creating a row of 3 icons on the bottom for tonight->tomorrow->next day, or a sidebar of temps for the next few days. Heck, maybe get funky and create a graph out of the text data, but that's a next step. :-)What about the sdt weather text items, do they only look at current day or can you show weather for the next days too ?
agreed.Regarding sport/game scores I'm starting to think they would be best to handle as a separate item type so I think we can ignore them for now, it's better to get something up and running for the weather info.
Thanks!
-Dan
-
2010-04-28, 10:52 #26Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.
-
2010-04-28, 13:22 #27Senior Member
- Join Date
- Aug 2007
- Location
- Portland, OR, USA
- Posts
- 218
Yes, you need to do the all request to get that specific data. Basically, there are 2 types of requests:
1. Send a macroString request with a %* keyword string and get back an answer (though I think I saw a method to create your own %* keyword). This evolved from my SDTstring before.
2. Request a set of data and get back an answer. The requests are:
-Danwassup (a test set) == currentF,current, and currentIcon
weather == wetData, the whole wetData structure
sports == sportsData, the whole sportsData structure (don't have that handy)
misc == miscData, the whole wetData structure (probably should be the whole miscData structure)
display == displayLine1, and displayLine2, what the SB2,3,boom, transporter display
all == wetData, sportsData, miscData structures
-
2010-04-28, 21:49 #28
I took some time and looked into this and have some questions ?
1. Shouldn't the SDTicon take the period parameter into account instead of always getting the data from the -1 period ?
2. Is there a reason why you just want to return the icon id (forecastIcon) and not the complete path (forecastIconURLSmall) ? Are you thinking about custom icon sets or is there some other reason ? Maybe the command should return both to make it more generic ?
Greg:
Is it safe for me to trust that these new commands will be implemented as SDTstring and SDTicon in a future official SDT release ?
I'm asking because in that case I can check for these commands in my code to decide if the SDT support should be enabled or not.Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.
-
2010-04-28, 22:07 #29Senior Member
- Join Date
- Aug 2007
- Location
- Portland, OR, USA
- Posts
- 218
Yes, it should. SDTicon is gone. You should just do a 'weather' request, and parse the 'wetData' return table - you can pretty easily get anything you want out of there.
[quote]2. Is there a reason why you just want to return the icon id (forecastIcon) and not the complete path (forecastIconURLSmall) ? Are you thinking about custom icon sets or is there some other reason ? Maybe the command should return both to make it more generic ?My answer - SDTstring is now 'macroString', SDTicon is gone, use 'weather' instead and parse the 'wetData' return table.
No reason, really. It was just a few keys easier for me, and forecastIcon was implemented in the 'wassup' test method when I started this whole process. :-)
Greg:
Is it safe for me to trust that these new commands will be implemented as SDTstring and SDTicon in a future official SDT release ?
I'm asking because in that case I can check for these commands in my code to decide if the SDT support should be enabled or not.
Thanks!
-Dan
-
2010-04-28, 23:03 #30
Dan, when you handled the answer from SDTstring (macroString) in your version of the applet you had this code:
Is there a reason why you call os.date here ?Code:local text = os.date(chunk.data.SDTstring,time) self.items[no]:setWidgetValue("itemno",text) log:debug("Result from SDTString: "..text)
Won't this collide with the %H (wu_humidity) and %M (wu_dewpointC) replaced by the plugin ?
It feels like we should have a separate syntax if we like to be able to mix os.date keywords with SDT keywords in the same formatting string. Maybe we could use %%M and let the applet replace %% with % before it pass it to os.date ?Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.


Reply With Quote
