gharris999;429256 Wrote:
> OK, I've had second thoughts. Forgetting the "not idle" signal, if the
> shutdown/restart/suspend/hibernate commands point to an executable or
> script that signals the "is idle" state in the registry and tells
> LightsOut what the appropriate next action should be, then really no
> changes to SrvrPowerCtrl are required at all. The user would just set
> SrvrPowerCtrl's on-idle time-out to a very short value and LightsOut's
> longer idle countdown will take up the slack. The only case where this
> wouldn't work is if the on-idle action is shutdown. In that case,
> SrvrPowerCtrl actually kills SqueezeCenter in order to help ensure a
> clean db close. I imagine that most folks don't force a complete
> hardware shutdown on idle, though.
>
> If you can get me the full documentation on what LightsOut wants to see
> in the registry, I'll write the executable and we can begin testing.
>
> What about scheduled server wake-ups for alarms and such? Does
> LightsOut handle this too? Or should SCPowerTool continue performing
> this chore?
Ok i've playing with this last night and wanted to code the following
into your plugin:
Let's start with the following:
Lights_Out checks the registry value "HKLM\SOFTWARE\AxoNet Software
GmbH\LightsOut" for the Value "Action"
possible value are:
0=do nothing (in this case do not shutdown if no clients (computers)
are active)
1=Standby,
2=Hibernate
3=Shutdown
I am now trying to execute
reg ADD "HKLM\SOFTWARE\AxoNet Software GmbH\LightsOut" /v Action /t
REG_DWORD /d 0 /f..
This should be done inside your Watchdog
#$g{log}->debug("Checking to see if scanner is running & if players
are idle..");
if ( Plugins::SrvrPowerCtrl::Block::IsBlocked() ||
Plugins::SrvrPowerCtrl::Util::AnyPlayersPlaying() ||
Plugins::SrvrPowerCtrl::Util::AnyPlayersUpdating() ||
Slim::Music::Import->stillScanning() ) {
$g{log}->debug("Not idle condition..");
#Not idle...reset the timer to check again..
$nIdlePlayersTimeCount = 0;
---->Reg ADD HERE<----
return 0;
}
By doing this everytime a player is running LightsOut doesnt do
anything.
and further down i would add reg ADD "HKLM\SOFTWARE\AxoNet Software
GmbH\LightsOut" /v Action /t REG_DWORD /d 2 /f
right here:
#restart the countdown for our eventual return from
suspend/hibernate/SN..
$nIdlePlayersTimeCount = 0;
---->HERE<-----
#cue up the requested action..
This returns LightsOut to its normal operation (in my case 2=hibernate)
when players are idle.
Thoughts on handling of alarms, Shutdown buttons etc.:
Since LightsOut is the main handler for all shutdown and wakeup action
on my Home Server i do not need the other options. I would never
shutdown the server using my squeezeboxen, i just shutdown my pcs and
stop playback -> server goes to sleep. A simple checkbutton in the
config "Use Lightsout Integration" does it for me. All other options are
neither needed nor desired since they would interfere with normal
HomeServer operations. This includes the force to SN options since in
this environment there is always an active server if a client comes up.
The one exception is the Alarm function which i would leave the way it
works now.
Hope this made a little bit of sense, now i'll try to check if i can
add this to your code. It's been a while since i last programmed and
that was Java but well let's see.
Alex
--
psixilambda
------------------------------------------------------------------------
psixilambda's Profile: http://forums.slimdevices.com/member.php?userid=30773
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins