Skip to content

Commit

Permalink
Only show a singly battery notifcation
Browse files Browse the repository at this point in the history
From feedback in #2317 it became pretty clear that battery data is a mess with devices providing levels like full, medium, low and devices providing fine-grained percent values, flapping values etc. and we do not want to go into power management applet business, so we only show a single battery connection (when the battery interface shows up or - if the interface is already present when the device connects - when the existing interface sends its first property update) and drop the reference to the connection notification to update so that further values do not lead to a notification. (In case people will ask for those notifications we might add them as a separate plugin that's disabled by default.)

Due to the great demand, I plan to backport this for 2.4.2, even though it's technically a regression.

Closes #2317
  • Loading branch information
cschramm committed May 15, 2024
1 parent 83685e9 commit 4602554
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blueman/plugins/applet/ConnectionNotifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def on_device_property_changed(self, path: str, key: str, value: Any) -> None:
Notification(device.display_name, _('Disconnected'), icon_name=device["Icon"]).show()

def _on_battery_update(self, path: str, value: int) -> None:
notification = self._notifications.get(path, None)
notification = self._notifications.pop(path, None)
if notification:
try:
notification.set_message(f"{_('Connected')} {value}%")
Expand Down

0 comments on commit 4602554

Please sign in to comment.