summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/test-client.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/test-client.py b/lib/test-client.py
new file mode 100644
index 00000000..ab3866b8
--- /dev/null
+++ b/lib/test-client.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python3
+#
+# Copyright (C) 2022 Bastien Nocera <hadess@hadess.net>
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+import gi
+from gi.repository import GLib
+from gi.repository import Gio
+gi.require_version('GnomeBluetooth', '3.0')
+from gi.repository import GnomeBluetooth
+
+def notify_cb(client, pspec):
+ value = client.get_property(pspec.name)
+ print(f'{pspec.name} changed to {value}')
+
+client = GnomeBluetooth.Client.new()
+client.connect('notify', notify_cb)
+
+ml = GLib.MainLoop()
+ml.run()