How can I programmatically stop a notebook battery from charging

前端 未结 10 1241
深忆病人
深忆病人 2021-02-14 19:34

There is some easily available information on finding the status of a battery, or weather it\'s charging or not. (GetSystemPowerStatus API or System.Windows.Forms.SystemInformat

相关标签:
10条回答
  • 2021-02-14 19:56

    But for example Vista won't charge battery if it is unplugged and then plugged while it's capacity is above 96% so it means that in can be accessed and manipulated somehow.

    0 讨论(0)
  • 2021-02-14 19:57

    Actually I use such a charge limiter. There is the control software - a Python script that monitors the battery level (psutil module) and controls external hardware - i.e. a switch that can be software controlled. I have Energenie and TP-Link homeplugs plus my own hardware contraption.

    As it is for home use the software it's not polished at all, but with minimal effort can be adapted to any OS or hardware.

    Let know if interested. The software lives here: CCC

    0 讨论(0)
  • 2021-02-14 19:58

    I would just get a UPS and programatically tell it to cut all power... most should have an interface for doing this. Otherwise, as someone already said - a computer-controlled power strip would do it ^^

    I've actually played with this idea when I was testing/writing about way too many new laptop models a while ago and the battery testing was annoying to set up, monitor and analyze.

    I wrote an app that would do exactly everything (setup, listening, measuring, reporting) except unplugging the power and then replugging it and starting the computer again...

    0 讨论(0)
  • 2021-02-14 20:05

    I think it's impossible, because you have need some API for battery or battery charger.

    And this API can provide to you manufacturer of notebook and battery or battery charger support this.

    0 讨论(0)
提交回复
热议问题