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

Wrong "remaining time" calculation for expected value larger that 18h #171

Open VincenzoMaletta opened 11 months ago

VincenzoMaletta commented 11 months ago

Hello,

I've just installed winnut version 2.0.7722.3095 on a Windows 10 machine 21H2 OS build 19044.3086 and connected to a nut server release 2.7.4-13. The monitored UPS is a 3000VA/2700W and the connected load for configuration test is 130W.

Running winnut I see that the extimated remaining time fluctuates around 18/20/22 minutes, which is irrealistic, but sometime jumps for a few seconds to more that 18 hours, that is near the expected value.

It seems to me that when the "remaining time" value exceedes 18h17' (the max value I was able to read from the SW main window) there is some variable overflow that causes a reduction of the calculated values, setting the hours to zero and replacing the minutes and seconds with the values ​​that should be attributed to hours and minutes.

Kind regards.

gbakeman commented 11 months ago

Hi @VincenzoMaletta ,

Addressing your issue directly, WinNUT generally does very little more than simply presenting the values that the NUT server gives it. It's possible that something strange is happening when WinNUT tries to parse the value into a time representation.

That being said, this repository is no longer being developed, and newer WinNUT versions have since been released here: https://github.com/nutdotnet/WinNUT-Client. Please try downloading the latest pre-release of WinNUT and see if the problem persists.