View Single Post
Posts: 59 | Thanked: 168 times | Joined on Mar 2010 @ Finland
#616
Originally Posted by coderus View Post
@jpel try
Code:
qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/devices/bme  org.freedesktop.Hal.Device.GetAllProperties
Actually i already tried by modifying your earlier python script for determining remaining active time to following:

Code:
#!/usr/bin/python
import QmSystem
batt = QmSystem.QmBattery()
idle = batt.getAverageIdleCurrent(QmSystem.QmBattery.NormalMode)
active = batt.getAverageActiveCurrent(QmSystem.QmBattery.NormalMode)
print "Active:",active,"mA","  ","Idle:",idle,"mA"
But the problem seems to be that there is no battery usage data collected by the system default as the script returns every single time it is been run the same output: Active: 203 mA Idle: 23 mA

I guess that in order to this work and give reliable results you would have to use:
Code:
startCurrentMeasurement (Period rate)
wait some desired time to gather data and then stop measurement with
Code:
stopCurrentMeasurement ()
before requesting and displaying the desired batteryinformation.

I was thinking if there was an easy way of getting all this information from battery usage app that has already all needed data gathered since the last recharge.