kete: allow pairing on existing devices
This commit is contained in:
parent
d9459ef3f9
commit
790f2337dc
|
@ -223,9 +223,14 @@ class TuhiKeteManager(_DBusObject):
|
||||||
if 'Devices' in changed_props:
|
if 'Devices' in changed_props:
|
||||||
objpaths = changed_props['Devices']
|
objpaths = changed_props['Devices']
|
||||||
for objpath in objpaths:
|
for objpath in objpaths:
|
||||||
|
try:
|
||||||
d = self._pairable_devices[objpath]
|
d = self._pairable_devices[objpath]
|
||||||
self._devices[d.address] = d
|
self._devices[d.address] = d
|
||||||
del self._pairable_devices[objpath]
|
del self._pairable_devices[objpath]
|
||||||
|
except KeyError:
|
||||||
|
# if we called Pair() on an existing device it's not in
|
||||||
|
# pairable devices
|
||||||
|
pass
|
||||||
self.notify('devices')
|
self.notify('devices')
|
||||||
|
|
||||||
def _on_signal_received(self, proxy, sender, signal, parameters):
|
def _on_signal_received(self, proxy, sender, signal, parameters):
|
||||||
|
@ -265,6 +270,10 @@ class Searcher(GObject.Object):
|
||||||
self.manager.connect('pairable-device', self._on_pairable_device)
|
self.manager.connect('pairable-device', self._on_pairable_device)
|
||||||
self.manager.start_search()
|
self.manager.start_search()
|
||||||
logger.debug('Started searching')
|
logger.debug('Started searching')
|
||||||
|
|
||||||
|
for d in self.manager.devices:
|
||||||
|
self._on_pairable_device(self.manager, d)
|
||||||
|
|
||||||
self.manager.run()
|
self.manager.run()
|
||||||
|
|
||||||
if self.manager.searching:
|
if self.manager.searching:
|
||||||
|
|
Loading…
Reference in New Issue