gawindx / WinNUT-Client

This is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
GNU General Public License v3.0
381 stars 70 forks source link

Explanation for "Delay to shutdown" #146

Open myriaxis opened 1 year ago

myriaxis commented 1 year ago

Hi, I'd like to confirm my understanding. Does the option "Delay to shutdown" implies that the shutdown procedure will only be performed if the UPS on battery/runtime condition is still true after the delay? In essence, this option prevents a shutdown when the UPS AC input goes off for a brief moment. Do I understand correctly?

myriaxis commented 1 year ago

Hi, An answer would be much appreciated.

gbakeman commented 1 year ago

Hi @myriaxis ,

I haven't dealt with this part of the system before, so I'm only giving you my best guess after about ~10 minutes browsing over the code:

It appears that, if there's a shutdown condition triggered and unless there's a call for an immediate shutdown, then the shutdown timer begins. At any point during this countdown, if the UPS enters the "OnLine" state then the shutdown is supposed to be cancelled automatically. I say supposed to, because I believe there are several bugs opened currently regarding the auto shutdown systems and will hopefully have those merged in to the new repository soon.