Browse Source

battery-proxy: add Level and Charging properties to DBus interface

bboozzoo/dbus-support-wip
Maciek Borzecki 8 years ago
parent
commit
ed2c15210a
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/mconnect/battery-proxy.vala

+ 6
- 0
src/mconnect/battery-proxy.vala View File

@ -25,6 +25,9 @@ class BatteryHandlerProxy : Object, PacketHandlerInterfaceProxy {
private BatteryHandler battery_handler = null;
private uint register_id = 0;
public uint level { get; private set; default = 0; }
public bool charging { get; private set; default = false; }
public BatteryHandlerProxy.for_device_handler(Device dev,
PacketHandlerInterface iface) {
this.device = dev;
@ -38,6 +41,9 @@ class BatteryHandlerProxy : Object, PacketHandlerInterfaceProxy {
if (this.device != dev)
return;
this.level = level;
this.charging = charging;
battery(level, charging);
}


Loading…
Cancel
Save