kolding;276447 Wrote: 
> Well, by "hack" I meant that at first I did a quick hack of it, before
> doing some serious porting work.  It should be pretty solid right now.

Ahh.  I thought you were referring to the 6.x version of the plugin.

> 
> As for functions, now() returns, well, now, in seconds since midnight. 
> nextTime() computes when the next change should take place.
> 
> So, now instead of checking every minute, it simply computes when the
> next needed transition will be and only sets the timer for then.  This,
> of course, means that some other things need to get caught, and those
> are power off and recognition of new players.  Also fairly infrequent
> operations. 
> 
> The logic behind this was that transitions between bright and dim occur
> only twice per day per enabled player, so, no need to check every minute
> (1440 times per day) when you really only need to do it twice per day
> per player, plus when you turn things off or add new players.  Also has
> the advantage that the display goes dim at the time specified (ie,
> 11:00:00) instead of sometime in the next minute, and it goes dim when
> the player powers off, rather than going bright for up to a minute, and
> then going dim.
> 
> Also, I hate polling.  Just as a matter of principle.  Maybe I've been
> working in embedded systems too long.... :-)  All in all, this should
> call checkOnOff() a lot less frequently than it was previously.
> 

Well if you are doing that then the whole checkOnOff() is sort of
redundant.  You could probably simplify it. OTOH, as you note, the
polling allows one not to have to check for all sorts of conditions
like transitions in the player state and changes in the on/off times. 
Actually doesn't the setTimer routine cycle every time slice (second?)
anyhow.  Aren't all those extra calculations/functions called (ie.
nextTime) somewhat more of a load?


-- 
Daryle Tilroe
------------------------------------------------------------------------
Daryle Tilroe's Profile: http://forums.slimdevices.com/member.php?userid=434
View this thread: http://forums.slimdevices.com/showthread.php?t=43104

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to