Subject: bug#394 closed by Mark Hindley <[email-masked]> (Re: bug#394: Cinnamon on Beowulf - Power Management fails to update battery status)

From: "Devuan bug Tracking System" <[email-masked]>
Date: Fri, 10 Feb 2023 08:46:05 +0000

This is an automatic notification regarding your bug report
which was filed against the gir1.2-upowerglib-1.0 package:

#394: Cinnamon on Beowulf - Power Management fails to update battery status

It has been closed by Mark Hindley <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mark Hindley <[email-masked]> by
replying to this email.

-- 
394: https://bugs.devuan.org/cgi/bugreport.cgi?bug=394
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#394: Cinnamon on Beowulf - Power Management fails to update battery status
From: Mark Hindley <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 10 Feb 2023 08:44:40 +0000

On Thu, Feb 13, 2020 at 09:01:32PM +0000, Mark Hindley wrote:
> We will need to ensure that this requirement goes in the Release notes for
> ascii->beowulf upgrades.

Closing: fixed and included in Release Notes.

Mark

Subject: Cinnamon on Beowulf - Power Management fails to update battery status
From: [email-masked]
To: "[email-masked]" <[email-masked]>
Date: Thu, 13 Feb 2020 18:28:48 +0000

Package: gir1.2-upowerglib-1.0
Version: 1:0.9.23-2+devuan1.3

On Devuan Beowulf, the Cinnamon Power Management (and therefore also the battery indicator applet) fail to read updated information from the system.

The script that handles this is cs_power.py, which is a module called by cinnamon-settings.py. I have pared it down to the bare minimum lines to return the battery percentage and state:

###################################################################
#!/usr/bin/python3

import gi
gi.require_version('CinnamonDesktop', '3.0')
gi.require_version('UPowerGlib', '1.0')
from gi.repository import CinnamonDesktop, Gdk, UPowerGlib, Gio

(UP_ID, UP_VENDOR, UP_MODEL, UP_TYPE, UP_ICON, UP_PERCENTAGE, UP_STATE, UP_SECONDS) = range(8)

up_client = UPowerGlib.Client.new()

csd_power_proxy = Gio.DBusProxy.new_sync(
    Gio.bus_get_sync(Gio.BusType.SESSION, None),
    Gio.DBusProxyFlags.NONE,
    None,
    "org.cinnamon.SettingsDaemon.Power",
    "/org/cinnamon/SettingsDaemon/Power",
    "org.cinnamon.SettingsDaemon.Power",
    None)

devices = csd_power_proxy.GetDevices()
for device in devices:
    if device[UP_TYPE] == UPowerGlib.DeviceKind.BATTERY:
        batdevice = device
percentage = batdevice[UP_PERCENTAGE]
state = batdevice[UP_STATE]

print(percentage)
print(state)
###############################################

The result, when I ran it, showed 89% and discharging whereas $(upower -i /org/freedesktop/UPower/devices/battery_BAT0) returned 58% and charging. Therefore the issue is with UPowerGlib, which is provided by the package gir1.2-upowerglib-1.0

Current software versions:

Lenovo Thinkpad T480s
Linux Josh-Laptop 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
Devuan Beowulf
gir1.2-upowerglib-1.0/now 1:0.9.23-2+devuan1.3 amd64
cinnamon-settings-daemon/testing,now 3.8.4-2 amd64
upower/now 1:0.9.23-2+devuan1.3 amd64