From 0bacf652107ac5ce32ddb2d14e7d837b268458aa Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Mon, 5 Jun 2017 21:47:26 +0200 Subject: [PATCH] battery: add battery signal --- src/mconnect/battery.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mconnect/battery.vala b/src/mconnect/battery.vala index 70a9e34..5b4d523 100644 --- a/src/mconnect/battery.vala +++ b/src/mconnect/battery.vala @@ -54,7 +54,10 @@ class BatteryHandler : Object, PacketHandlerInterface { int64 level = pkt.body.get_int_member("currentCharge"); bool charging = pkt.body.get_boolean_member("isCharging"); - GLib.message("battery level: %u %s", (uint) level, - (charging == true) ? "charging" : ""); + debug("battery level: %u %s", (uint) level, + (charging == true) ? "charging" : ""); + battery(dev, (uint)level, charging); } + + public signal void battery(Device dev, uint level, bool charging); } \ No newline at end of file