From 5418f29bf1c8e3c2ce53add5d0a54b1cd003c13f Mon Sep 17 00:00:00 2001 From: Ojas Kavathe Date: Fri, 24 Jan 2025 09:01:07 +0530 Subject: fix(bluetooth): battery between 0-1 --- lib/bluetooth/device.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/bluetooth/device.vala') diff --git a/lib/bluetooth/device.vala b/lib/bluetooth/device.vala index 74f8d83..b38a5ce 100644 --- a/lib/bluetooth/device.vala +++ b/lib/bluetooth/device.vala @@ -114,12 +114,12 @@ public class AstalBluetooth.Device : Object { } /** - * The percentage of battery left on the device if it has one, else 0. + * The percentage of battery left on the device if it has one, else -1. */ - public uint battery_percentage { + public double battery_percentage { get { - if (battery != null) return battery.percentage; - else return 0; + if (battery != null) return battery.percentage * 0.01; + else return -1; } } -- cgit v1.2.3