guidance-power-manager shows dischanging if battery full

Bug #104794 reported by Robert Gerlach
6
Affects Status Importance Assigned to Milestone
kde-guidance (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: kde-guidance

If battery fully changed, guidance-power-manager switch to dischanging (battery powered) on my Notebook. ACPI state switch to dischanging with rate 0 while ac powered.

--- kde-guidance-0.8.0/powermanager/powermanage.py 2007-04-09 14:57:13.000000000 +0200
+++ kde-guidance-0.8.0/powermanager/powermanage.py 2007-04-09 15:27:21.000000000 +0200
@@ -184,7 +184,10 @@
             if properties["battery.rechargeable.is_charging"]:
                 state = "charging"
             elif properties["battery.rechargeable.is_discharging"]:
- state = "discharging"
+ if rate:
+ state = "discharging"
+ else:
+ state = "charged"
             elif not properties["battery.rechargeable.is_discharging"] \
                  and not properties["battery.rechargeable.is_charging"]:
                 if current == 0:

Revision history for this message
Sebastian Kügler (sebasje) wrote :

Thanks, committed your fix.

Changed in kde-guidance:
status: Unconfirmed → Fix Committed
Revision history for this message
stivani (stivani-deactivatedaccount) wrote :

Is this patch added in kde-guidance-powermanager-0.8.0-0ubuntu4? If so, I think it has introduced a problem for me: When running on batttery, the power manager wrongly indicates it is fully charged and it never changes to discharging. On ac adapter, everything seems fine. I have this behavior since I upgraded to version 0.8.0-0ubuntu4 and I haven't seen this behavior before.

Revision history for this message
Robert Gerlach (khnz) wrote :

Stijn, what notebook type are you using? Can you send a lshal output for your battery in powered and battery mode.
Thanks

Revision history for this message
Robert Gerlach (khnz) wrote :

possible fix:
change "if rate:" to "if self.onBattery():"

Revision history for this message
stivani (stivani-deactivatedaccount) wrote :

I'm using a Dell Latitude D800 notebook. I have made the change you suggested and then, the battery monitor works correctly again. Thanks for your help and your work on guidance-powermananger!

Revision history for this message
stivani (stivani-deactivatedaccount) wrote :
Revision history for this message
Robert Gerlach (khnz) wrote :

My patch is completely wrong, rate is uninitialized there. Instead of rate we can check for ac powered.
Sorry

--- powermanage.py 2007-04-10 19:28:13.000000000 +0200
+++ /usr/share/python-support/kde-guidance/powermanage.py 2007-04-10 19:28:30.000000000 +0200
@@ -184,7 +184,7 @@
             if properties["battery.rechargeable.is_charging"]:
                 state = "charging"
             elif properties["battery.rechargeable.is_discharging"]:
- if rate:
+ if self.onBattery():
                     state = "discharging"
                 else:
                     state = "charged"

Revision history for this message
Nael Masood (neochaos) wrote :

I'm going to confirm the new bug Stijn ran into; the tooltip always shows "Fully charged" even when my laptop is unplugged. Has Robert Gerlach's second patch been applied yet?

Jonathan Riddell (jr)
Changed in kde-guidance:
importance: Undecided → High
Revision history for this message
Sarah Kowalik (hobbsee-deactivatedaccount) wrote :

works fine here, with that second patch.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Since this bug has been sitting "Fix Committed" for some time before Feisty was released, I decided to try and confirm if it made it into Feisty or not. Based on the comments above, the code I expected to find was:

kde-guidance-0.8.0/powermanager/powermanage.py
 @@ -184,7 +184,10 @@
              if properties["battery.rechargeable.is_charging"]:
                  state = "charging"
              elif properties["battery.rechargeable.is_discharging"]:
                  if self.onBattery():
                      state = "discharging"
                  else:
                      state = "charged"
              elif not properties["battery.rechargeable.is_discharging"] \
                   and not properties["battery.rechargeable.is_charging"]:
                  if current == 0:

What I found was:

            if properties["battery.rechargeable.is_charging"]:
                state = "charging"
            elif properties["battery.rechargeable.is_discharging"]:
                state = "discharging"
            elif not properties["battery.rechargeable.is_discharging"] \
                 and not properties["battery.rechargeable.is_charging"]:
                if current == 0:
                    state = "empty"
                else:
                    state = "charged"
            else:
                print "Unknown battery state ..."

So it looks to me like this section of the code was modified in a way not documented by this bug. It appears to my that the modified code would also resolve this issue and I can not reproduce the problem. I believe that this bug should be marked fix released, but would appreciate it if the original reporter would verify that the current Feisty version does not have this problem for them.

Revision history for this message
Zak B. Elep (zakame) wrote :

This bug still seems to affect Feisty, post-release; I am experiencing kde-guidance-powermanager telling me my battery is fully charged (when it is not) and the battery icon in a plugged-in (AC) mode (even when it is not.) Because the icon in the notification area doesn't change as the battery discharge progresses, this may confuse users.

Setting this back to Confirmed; importance to Medium since this won't really break existing Feisty installs, but only confuse the user.

Changed in kde-guidance:
importance: High → Medium
status: Fix Committed → Confirmed
Revision history for this message
Sebastian Kügler (sebasje) wrote : Re: [Bug 104794] Re: guidance-power-manager shows dischanging if battery full

On Monday 23 April 2007 03:35:10 Zak B. Elep wrote:
> This bug still seems to affect Feisty, post-release; I am experiencing
> kde-guidance-powermanager telling me my battery is fully charged (when
> it is not) and the battery icon in a plugged-in (AC) mode (even when it
> is not.) Because the icon in the notification area doesn't change as
> the battery discharge progresses, this may confuse users.
>
> Setting this back to Confirmed; importance to Medium since this won't
> really break existing Feisty installs, but only confuse the user.

Can you check if powermanager reports something else than lshal does?

> ** Changed in: kde-guidance (Ubuntu)
> Importance: High => Medium
> Status: Fix Committed => Confirmed
--
sebas

 http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Software is like sex; it's better when it's free. - Linus Torvalds

Revision history for this message
Luka Renko (lure) wrote :

This bug was fixed just before the release with proper patch:

@@ -184,7 +191,10 @@
             if properties["battery.rechargeable.is_charging"]:
                 state = "charging"
             elif properties["battery.rechargeable.is_discharging"]:
- state = "discharging"
+ if self.onBattery():
+ state = "discharging"
+ else:
+ state = "charged"
             elif not properties["battery.rechargeable.is_discharging"] \
                  and not properties["battery.rechargeable.is_charging"]:

If you still get this bug with up-to-date feisty, feel free to re-open the bug.

Changed in kde-guidance:
status: Confirmed → Fix Released
Revision history for this message
Luka Renko (lure) wrote :

Zak B. Elep: I think your problem is different. If you still can reproduce it, please open new bug and provide output of "lshal" command when power-manager is reporting wrong data.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.