Browse Source

battery: add battery signal

bboozzoo/pairing-fixes
Maciek Borzecki 8 years ago
parent
commit
0bacf65210
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/mconnect/battery.vala

+ 5
- 2
src/mconnect/battery.vala View File

@ -54,7 +54,10 @@ class BatteryHandler : Object, PacketHandlerInterface {
int64 level = pkt.body.get_int_member("currentCharge"); int64 level = pkt.body.get_int_member("currentCharge");
bool charging = pkt.body.get_boolean_member("isCharging"); 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);
} }

Loading…
Cancel
Save