dbus: drop the "paired" flag from create_device

We can get this from the device now
pull/14/head
Peter Hutterer 2018-01-22 15:45:40 +10:00
parent ec87503209
commit daac6e6d96
2 changed files with 6 additions and 6 deletions

View File

@ -253,7 +253,7 @@ class Tuhi(GObject.Object):
# create the device if unknown from us
if bluez_device.address not in self.devices:
d = TuhiDevice(bluez_device, self.config, uuid=uuid, paired=not pairing_device)
d.dbus_device = self.server.create_device(d, paired=not pairing_device)
d.dbus_device = self.server.create_device(d)
self.devices[bluez_device.address] = d
if Tuhi._is_pairing_device(bluez_device):

View File

@ -86,14 +86,14 @@ class TuhiDBusDevice(GObject.Object):
(GObject.SIGNAL_RUN_FIRST, None, ()),
}
def __init__(self, device, connection, paired=True):
def __init__(self, device, connection):
GObject.Object.__init__(self)
self.name = device.name
self.btaddr = device.address
self.width, self.height = 0, 0
self.drawings = []
self.paired = paired
self.paired = device.paired
objpath = device.address.replace(':', '_')
self.objpath = "{}/{}".format(BASE_PATH, objpath)
@ -285,10 +285,10 @@ class TuhiDBusServer(GObject.Object):
def cleanup(self):
Gio.bus_unown_name(self._dbus)
def create_device(self, device, paired=True):
dev = TuhiDBusDevice(device, self._connection, paired)
def create_device(self, device):
dev = TuhiDBusDevice(device, self._connection)
self._devices.append(dev)
if not paired:
if not device.paired:
self._emit_pairable_signal(dev)
return dev