Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Faking the battery info in my laptop

How one can fake the battery info in the laptop?

I am working on a tool that must fake the power of the battery in my laptop.

This means that the tool must force the battery or laptop to report low power while its charged well.

Is there any framework or driver that can help me to do this?

Do we have the firmware of the battery to support this functionality?

I really can't find a solution for this problem, any help is so appreciated.

Thanks in advance.

Note: the programming language does not matter.

like image 414
Rida Avatar asked Sep 11 '25 02:09

Rida


2 Answers

Build an application that shows a low battery icon in the System Tray.

like image 157
glowworms Avatar answered Sep 13 '25 16:09

glowworms


You are asking about how to mock/stub something. I would use a mock or stub.

so

  • new MyFirstPowerMonitor(new AcpiBatteryLevelReader()) - main program

  • new MyFirstPowerMonitor(new ProgrammableBatteryLevelReader()) - to use something you can control.

thats it really.

like image 30
time4tea Avatar answered Sep 13 '25 17:09

time4tea