diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-08-25 16:11:37 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-08-25 20:00:20 +0200 |
commit | 6d57122b13698e26434a09697ea7b1b9d5ae7905 (patch) | |
tree | 509fd880e92c6dacb7b26e725dd7a551174098b9 /lib | |
parent | bc0b8791a401c165b860249caf279c8d9bbb3f2a (diff) | |
download | gnome-bluetooth-6d57122b13698e26434a09697ea7b1b9d5ae7905.tar.gz |
lib: Add test application for BluetoothClient properties
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test-client.py | 21 |
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() |