mirror of https://github.com/tuhiproject/tuhi.git
do not create more than one DBus object per bluetooth device
When the device is in pairing mode, it will send several properties updates, and tuhi will attempt to create a second DBus object. This is not good.pull/10/head
parent
4ee07a18b6
commit
4f8079acfc
7
tuhi.py
7
tuhi.py
|
@ -236,9 +236,10 @@ class Tuhi(GObject.Object):
|
|||
return
|
||||
|
||||
if Tuhi._is_pairing_device(bluez_device):
|
||||
tuhi_dbus_device = self.server.create_device(bluez_device, paired=False)
|
||||
d = TuhiDevice(bluez_device, tuhi_dbus_device, self.config, paired=False)
|
||||
self.devices[bluez_device.address] = d
|
||||
if bluez_device.address not in self.devices:
|
||||
tuhi_dbus_device = self.server.create_device(bluez_device, paired=False)
|
||||
d = TuhiDevice(bluez_device, tuhi_dbus_device, self.config, paired=False)
|
||||
self.devices[bluez_device.address] = d
|
||||
logger.debug('{}: call Pair() on device'.format(bluez_device.objpath))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue