Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blueman/gui/manager/ManagerDeviceList.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def _update_power_levels(self, tree_iter: Gtk.TreeIter, device: Device, cinfo: c

obj_path = device.get_object_path()
if obj_path in self._batteries:
bars["battery"] = self._batteries[obj_path]["Percentage"]
bars["battery"] = max(10, self._batteries[obj_path]["Percentage"])

# cinfo init may fail for bluetooth devices version 4 and up
# FIXME Workaround is horrible and we should show something better
Expand Down
3 changes: 3 additions & 0 deletions blueman/services/Functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

def get_service(device: Device, uuid: str) -> Service | None:
for name, cls in inspect.getmembers(blueman.services, inspect.isclass):
if not issubclass(cls, Service):
continue

if ServiceUUID(uuid).short_uuid == cls.__svclass_id__:
svc: Service = cls(device, uuid)
return svc
Expand Down