Battery Life Estimation: First try

Martin Dengler martin at martindengler.com
Fri May 2 18:36:16 EDT 2008


On Fri, May 02, 2008 at 04:24:10PM -0400, Richard A. Smith wrote:
> The script is available at:
> 
> http://dev.laptop.org/~rsmith/olpc-bat_ttl

I've hacked[1] my {model,view}/.../battery.py to use your TTL_INST for
showing the user the time remaining.

Thanks for putting this together.

Martin

1. Obviously I wouldn't want to submit my hack as a patch, but what
should be done?  Should we add this logic to the Hal so I can retrieve
it via dbus?

2. when I unplugged the AC and my XO/battery went from charging to
discharging, I got a divide-by-zero error:

...
1209766969,25,6894220,1376692,2888,12588,Charging,Normal,431,743,-33,-34
1209767030,25,6901540,1368880,2886,12644,Charging,Normal,454,766,-34,-33
/home/olpc/bin/olpc-bat_ttl: line 124: ((3600 * 767) / ((0 * 3600) / 61)) / 60 : division by 0 (error token is ") / 60 ")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/devel/attachments/20080502/13bcc496/attachment.sig>


More information about the Devel mailing list