summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bluetooth/battery.vala2
-rw-r--r--lib/bluetooth/device.vala8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/bluetooth/battery.vala b/lib/bluetooth/battery.vala
index a828994..9fdd70d 100644
--- a/lib/bluetooth/battery.vala
+++ b/lib/bluetooth/battery.vala
@@ -1,7 +1,7 @@
/**
* Object representing a [[https://github.com/bluez/bluez/blob/master/doc/org.bluez.Battery.rst|battery]].
*/
-public class AstalBluetooth.Battery : Object {
+internal class AstalBluetooth.Battery : Object {
private IBattery proxy;
internal ObjectPath object_path { owned get; private set; }
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;
}
}