From 6d57122b13698e26434a09697ea7b1b9d5ae7905 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 25 Aug 2022 16:11:37 +0200 Subject: lib: Add test application for BluetoothClient properties --- lib/test-client.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/test-client.py 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 +# +# 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() -- cgit v1.2.1