| The Following 2 Users Say Thank You to slarti For This Useful Post: | ||
|
|
2013-02-13
, 17:22
|
|
Posts: 9 |
Thanked: 0 times |
Joined on Mar 2012
@ Hungary
|
#602
|
|
|
2013-02-13
, 18:20
|
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#604
|
#!/usr/bin/python
import QmSystem
batt = QmSystem.QmBattery()
#time = batt.getRemainingIdleTime(QmSystem.QmBattery.NormalMode)
time = batt.getRemainingTalkTime(QmSystem.QmBattery.NormalMode)
hours,mod = divmod(time,3600)
mins,secs = divmod(mod,60)
result = ''
if hours>0:
result+=str(hours)+' hour(s) '
if mins>0:
result+=str(mins)+' minute(s) '
result+=str(secs)+' second(s)'
print result
{script:/path/to/script.py 2>/dev/null}
|
|
2013-02-13
, 18:48
|
|
Posts: 87 |
Thanked: 14 times |
Joined on Jan 2012
|
#605
|
|
|
2013-02-13
, 18:58
|
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#606
|
|
|
2013-02-13
, 19:00
|
|
Posts: 9 |
Thanked: 0 times |
Joined on Mar 2012
@ Hungary
|
#607
|
|
|
2013-02-13
, 19:03
|
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#608
|
| The Following User Says Thank You to coderus For This Useful Post: | ||
|
|
2013-02-13
, 20:06
|
|
Posts: 9 |
Thanked: 0 times |
Joined on Mar 2012
@ Hungary
|
#609
|
|
|
2013-02-14
, 10:37
|
|
Posts: 59 |
Thanked: 168 times |
Joined on Mar 2010
@ Finland
|
#610
|
EDIT:
Spoke too soon. I thought it worked because I got something other than 0 after setting that key to 'true'. Turns out I just plugged it in and that changed the remaining time value, not the change to the battery.remaining_time.calculate_per_time key. Sorry...
Last edited by slarti; 2013-02-13 at 16:46.