UPowerClient constructor

UPowerClient({
  1. DBusClient? bus,
})

Creates a new UPower client connected to the system D-Bus.

Implementation

UPowerClient({DBusClient? bus})
    : _bus = bus ?? DBusClient.system(),
      _closeBus = bus == null {
  _root = DBusRemoteObject(_bus,
      name: 'org.freedesktop.UPower',
      path: DBusObjectPath('/org/freedesktop/UPower'));
  _displayDevice = UPowerDevice(
      _bus, DBusObjectPath('/org/freedesktop/UPower/devices/DisplayDevice'));
  kbdBacklight = UPowerKbdBacklight(_bus);
}