g-p-m UPS power status does not show up in Unity

Bug #1007095 reported by Phillip Susi
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
indicator-power
Fix Committed
Low
Unassigned
indicator-power (Ubuntu)
Fix Released
Low
Phillip Susi

Bug Description

I connected a usbhid compliant UPS and its status does not show up in Unity, either on 11.10 or 12.04. After switching to gnome-shell, it shows up, so I think the problem is on the Unity end rather than gnome-power-manager.

Tags: patch

Related branches

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, is that using a notification area icon? does it work under GNOME classic session?

Changed in unity (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Phillip Susi (psusi) wrote :

Yes, and yes.

I suspect that g-p-m uses the notification area that is disabled under unity, and some other means besides g-p-m was developed to mimic the g-p-m battery icon under unity, but for some reason that doesn't work with a UPS.

Revision history for this message
Omer Akram (om26er) wrote :

this page https://wiki.ubuntu.com/Power#Battery_menu says that indicator-power is also meant to show the UPS battery status but I guess that's not the case right now so it need to be implemented in indicator-power?

affects: unity (Ubuntu) → unity
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

Can you confirm if the same issue happens under a generic g-p-m session too (like gnome-shell) so that we know which component is at fault? Thanks!

Changed in indicator-power:
status: New → Incomplete
Revision history for this message
Phillip Susi (psusi) wrote :

I already said that it does work under gnome classic and gnome-shell.

Omer Akram (om26er)
Changed in indicator-power:
status: Incomplete → Confirmed
Changed in unity:
status: Incomplete → Confirmed
Changed in indicator-power:
importance: Undecided → Low
Revision history for this message
Charles Kerr (charlesk) wrote :

Phillip, if this is still happening for you in Q, could you please attach the output of "upower --dump" and a screenshot of the power indicator with the menu expanded?

Changed in indicator-power:
status: Confirmed → Incomplete
Revision history for this message
Phillip Susi (psusi) wrote :

It is not possible to provide a screen shot of something that does not show up. Yes, it still happens on quantal, and upower --dump shows:

Device: /org/freedesktop/UPower/devices/ups_hiddev0
  native-path: /sys/devices/pci0000:00/0000:00:1d.2/usb8/8-1/8-1:1.0/usb/hiddev0
  power supply: yes
  updated: Thu Nov 1 13:09:40 2012 (25 seconds ago)
  has history: yes
  has statistics: yes
  ups
    present: yes
    state: fully-charged
    time to empty: 1.4 hours
    percentage: 100%

Daemon:
  daemon-version: 0.9.17
  can-suspend: yes
  can-hibernate no
  on-battery: no
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: no
  is-docked: no

Changed in indicator-power:
status: Incomplete → Confirmed
Revision history for this message
Peter Hurley (phurley) wrote :

Phillip, thanks for cross-referencing this bug with my bug #1093942. (Although; 1) it's not just broken in Unity and 2) I hope that indicator-power maintainers note that my "duplicate" bug report actually has a patch.)

PS - You're about to discover that UPower is broken on new-ish kernels and that you need the patch in this bug #1091702.

Peter Hurley (phurley)
tags: added: patch
Revision history for this message
Phillip Susi (psusi) wrote :

I applied and tested the patch in quantal and it does indeed fix it. Would you care to apply it to the upstream bzr branch and propose a merge, or would you like me to do that?

affects: unity → indicator-power (Ubuntu)
Revision history for this message
Peter Hurley (phurley) wrote :

Doesn't apply to upstream.

Revision history for this message
Phillip Susi (psusi) wrote :

What do you mean?

Revision history for this message
Peter Hurley (phurley) wrote :

peter@thor:~/src/repos$ bzr branch lp:indicator-power
Branched 159 revisions.
peter@thor:~/src/repos$ cd indicator-power/
peter@thor:~/src/repos/indicator-power$ patch -p1 < ~/src/packages/indicator-power/indicator-power-12.10.2/0001-Show-UPS-state.patch
patching file src/indicator-power.c
Hunk #1 FAILED at 354.
Hunk #2 FAILED at 375.
Hunk #3 FAILED at 385.
Hunk #4 succeeded at 607 (offset 64 lines).
Hunk #5 succeeded at 625 (offset 64 lines).
Hunk #6 succeeded at 651 (offset 64 lines).
3 out of 6 hunks FAILED -- saving rejects to file src/indicator-power.c.rej

Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Phillip Susi (psusi) wrote :

It looks like upstream has reworked the code a bit and made fixing this much easier. Now all that is required is this:

--- src/indicator-power.c 2012-11-14 11:09:59 +0000
+++ src/indicator-power.c 2013-01-11 19:01:41 +0000
@@ -615,7 +615,8 @@
     {
       const IndicatorPowerDevice * device = INDICATOR_POWER_DEVICE(l->data);

- if (indicator_power_device_get_kind(device) == UP_DEVICE_KIND_BATTERY)
+ if (indicator_power_device_get_kind(device) == UP_DEVICE_KIND_BATTERY ||
+ indicator_power_device_get_kind(device) == UP_DEVICE_KIND_UPS)
         {
           ++*total;

Changed in indicator-power (Ubuntu):
assignee: nobody → Phillip Susi (psusi)
status: Confirmed → In Progress
Changed in indicator-power:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-power - 12.10.6daily13.01.17-0ubuntu1

---------------
indicator-power (12.10.6daily13.01.17-0ubuntu1) raring; urgency=low

  [ Charles Kerr ]
  * g-p-m UPS power status does not show up in Unity (LP: #1007095)

  [ Automatic PS uploader ]
  * Automatic snapshot from revision 160
 -- Automatic PS uploader <email address hidden> Thu, 17 Jan 2013 02:01:38 +0000

Changed in indicator-power (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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