I am looking to figure out both the current Battery Capacity and the Design Capacity.
So far what I could get to work is using the Win32_Battery() class which doesn't give all the information I need (at least not on my system). I used the pure-python wmi library for that.
On the other hand I found this which works In Python, how can I detect whether the computer is on battery power?, but unfortunately it doesn't provide any information on Capacity neither.
The Battery Information structure and the Battery Status structure seem perfect for this. Now I know that I have to use the DeviceIoControl function to do so and I found this C++ code that explains it a little.
I would prefer something that simply uses ctypes and not the python win32api provided by pywin32. If you have an idea how to do this in python please let me know!
Thanks in advance.
win32api
because you want to use the code across other platforms, so I'm not sure about alternative ways to do this because all systems have different APIs. If u don't need other platforms i may be able to help u – Hake