maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Pybattery - battery statusbar applet with candies (https://talk.maemo.org/showthread.php?t=24905)

DaSilva 2010-08-19 23:17

Re: Pybattery - battery statusbar applet with candies
 
New version after a reboot still disconnected:

Code:

Nokia-N900:~# cat /home/user/apmonitord.log
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy

After a click on "Start APMD" in the status bar it displays "Starting APMD" as with previous builds and nothing else happens.
After "start apmonitord" the text changes back to "APMD disconnected" even if it seemed to work in the console:

Code:

Nokia-N900:~# start apmonitord
apmonitord (start) waiting
apmonitord (start) starting
apmonitord (start) pre-start
apmonitord (start) spawned, process 2185
apmonitord (start) post-start, (main) process 2185
apmonitord (start) running, process 2185

Your latest debug command shows this:

Code:

Nokia-N900:~# python /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy
Traceback (most recent call last):
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 21, in <module>
    daemon.run()
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 16, in run
    self.apm = AdvancedPowerMonitor.apm()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 89, in __init__
    self.__init_wrappers()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 159, in __init_wrappers
    self.change_wrapper(key, self.get_available_wrappers(key)[0])
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 199, in change_wrapper
    self.__wrappers[key]['object'] = self.__wrappers[key]['list'][self.__wrappers[key]['available'][new_wrapper]](self.__bus)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/AbstractBattery.py", line 16, in __init__
    AbstractWrapper.__init__(self, bus, check)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 25, in __init__
    self.__end_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 33, in __end_init
    self.post_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 27, in post_init
    self.update_percent()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 40, in update_percent
    self.battery_percent = get_formatted_percentage(self.interfaces['BME'].GetPropertyInteger(u'battery.reporting.current'), self.battery_design)
NameError: global name 'get_formatted_percentage' is not defined


412b 2010-08-19 23:55

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792493)
Your latest debug command shows this:

Code:

Nokia-N900:~# python /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy
Traceback (most recent call last):
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 21, in <module>
    daemon.run()
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 16, in run
    self.apm = AdvancedPowerMonitor.apm()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 89, in __init__
    self.__init_wrappers()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 159, in __init_wrappers
    self.change_wrapper(key, self.get_available_wrappers(key)[0])
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 199, in change_wrapper
    self.__wrappers[key]['object'] = self.__wrappers[key]['list'][self.__wrappers[key]['available'][new_wrapper]](self.__bus)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/AbstractBattery.py", line 16, in __init__
    AbstractWrapper.__init__(self, bus, check)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 25, in __init__
    self.__end_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 33, in __end_init
    self.post_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 27, in post_init
    self.update_percent()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 40, in update_percent
    self.battery_percent = get_formatted_percentage(self.interfaces['BME'].GetPropertyInteger(u'battery.reporting.current'), self.battery_design)
NameError: global name 'get_formatted_percentage' is not defined


That's the point :)
What version of Advanced Power Common is installed? 0.4.1-5?

IceJunior 2010-08-20 05:04

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792493)

Code:

Nokia-N900:~# python /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy
Traceback (most recent call last):
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 21, in <module>
    daemon.run()
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 16, in run
    self.apm = AdvancedPowerMonitor.apm()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 89, in __init__
    self.__init_wrappers()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 159, in __init_wrappers
    self.change_wrapper(key, self.get_available_wrappers(key)[0])
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 199, in change_wrapper
    self.__wrappers[key]['object'] = self.__wrappers[key]['list'][self.__wrappers[key]['available'][new_wrapper]](self.__bus)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/AbstractBattery.py", line 16, in __init__
    AbstractWrapper.__init__(self, bus, check)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 25, in __init__
    self.__end_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 33, in __end_init
    self.post_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 27, in post_init
    self.update_percent()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 40, in update_percent
    self.battery_percent = get_formatted_percentage(self.interfaces['BME'].GetPropertyInteger(u'battery.reporting.current'), self.battery_design)
NameError: global name 'get_formatted_percentage' is not defined


Oh, btw, I got the same output, I noticed that yesterday but I forgot to attach :-D

DaSilva 2010-08-20 08:19

Re: Pybattery - battery statusbar applet with candies
 
Thanks, now with the latest version it is working (finally)! :)
Great work!
Just one question: Is it possible to show "Charging (∞)" while charging instead of "0:00 / 23:00" (the ∞ should be the unlimited ASCII character)?

btw: is APM "learning" to do a better estimation after a while?

fw190 2010-08-20 11:47

Re: Pybattery - battery statusbar applet with candies
 
I can report that it also works for me on Titans kernel 40!

412b 2010-08-20 12:01

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792765)
Just one question: Is it possible to show "Charging (∞)" while charging instead of "0:00 / 23:00" (the ∞ should be the unlimited ASCII character)?

I'm thinking of just removing that text while charging.

Quote:

Originally Posted by DaSilva (Post 792765)
btw: is APM "learning" to do a better estimation after a while?

It's left for Nokia's BME. APM just gets battery capacity and current charge.
I have some patches for correcting estimation in unstable branch, but it's not good enough from my point of view.

CasTTeLLo 2010-08-20 14:59

Re: Pybattery - battery statusbar applet with candies
 
have u done with batt remaining status applet? just for sure..
http://talk.maemo.org/attachment.php...1&d=1281971319

DaSilva 2010-08-20 21:39

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 792938)
I'm thinking of just removing that text while charging.


It's left for Nokia's BME. APM just gets battery capacity and current charge.
I have some patches for correcting estimation in unstable branch, but it's not good enough from my point of view.

I think a text information like "Charging" would be better than nothing.

It would be nice to see a better estimation because currently it is extremely pessimistic.

snookh 2010-08-21 01:26

Re: Pybattery - battery statusbar applet with candies
 
very nice applet, this is how it should have been made by nokia really.
Anyway, would it be possible to add localization in perhaps a ini file or something? Many of us doesn't use english language on our devices, it just would look better if the applet was the same language as the rest of the OS.

412b 2010-08-21 14:54

Re: Pybattery - battery statusbar applet with candies
 
There is a small bug in second number for timeleft. Fixed in upcoming release.

Quote:

Originally Posted by snookh (Post 793617)
very nice applet, this is how it should have been made by nokia really.
Anyway, would it be possible to add localization in perhaps a ini file or something? Many of us doesn't use english language on our devices, it just would look better if the applet was the same language as the rest of the OS.

Next release is a bugfix and after it I'll add Russian locale and looking for translators for other locales.


All times are GMT. The time now is 20:48.

vBulletin® Version 3.8.8