tuhi: when a device toggles 'registered', send out the required signal

Related to #80
This commit is contained in:
Peter Hutterer 2018-02-12 12:23:24 +10:00 committed by Benjamin Tissoires
parent 58220efe31
commit 30620dfbf0
1 changed files with 3 additions and 0 deletions

View File

@ -523,6 +523,9 @@ class TuhiDBusServer(_TuhiDBus):
for d in self._devices if d.registered]) for d in self._devices if d.registered])
self.properties_changed({'Devices': objpaths}) self.properties_changed({'Devices': objpaths})
if not device.registered and self._is_searching:
self._emit_unregistered_signal(device)
def _emit_unregistered_signal(self, device): def _emit_unregistered_signal(self, device):
arg = GLib.Variant.new_object_path(device.objpath) arg = GLib.Variant.new_object_path(device.objpath)
self.signal('UnregisteredDevice', arg, dest=self._searching_client[0]) self.signal('UnregisteredDevice', arg, dest=self._searching_client[0])