battery-level icon indicating copy to clipboard operation
battery-level copied to clipboard

Windows 10 return NaN

Open muten84 opened this issue 8 years ago • 3 comments

I'm trying to use your module as dependencies on an electron app. The code i run is very simple and the promise resolve a NaN value.

The os is Windows 10.

muten84 avatar May 13 '17 22:05 muten84

What does WMIC Path Win32_Battery Get EstimatedChargeRemaining return if you run it manually?

kevva avatar May 18 '17 22:05 kevva

Old issue, but still relevant. Confirmed on Windows 10, on a desktop computer without battery.

Related: On both MacOS and Linux, an error is thrown if no battery was found. It would be great if this was the case on Windows as well, then a try-catch block can be used to detect presence of a battery.

Alternatively, return null or false to indicate the absence of a battery to avoid the overhead of throwing an error.

Do you accept pull requests?

betamos avatar Mar 15 '20 10:03 betamos

Do you accept pull requests?

Yes!

gillstrom avatar Mar 16 '20 06:03 gillstrom