jay / battstatus

Monitor the Windows battery status for changes in state
Other
8 stars 1 forks source link

Show the estimated time left to charge #3

Open Zero3K opened 2 years ago

Zero3K commented 2 years ago

It would be nice if it showed the estimated time left to charge next to the message it prints when the laptop is charging its battery.

Zero3K commented 2 years ago

Are you working on it?

jay commented 2 years ago

I'm not working on it. The battery charge rate can vary and there's no public API that returns the remaining charge time that I'm aware of. I'm sure it can be inferred based on the trailing charge rate.

Zero3K commented 2 years ago

https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-battery

Its TimeToFullCharge.

Zero3K commented 2 years ago

Does that help any?

Zero3K commented 2 years ago

Hmm?

Zero3K commented 2 years ago

Any news?

jay commented 2 years ago

I have no plans of working on it. It's a good idea though. If there was a C API I'd probably do it.

regdomain commented 2 years ago

https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-battery

Its TimeToFullCharge.

You can use PowerShell or any other scripting tools that can get info from WMI. https://powershell.one/wmi/root/cimv2/win32_battery