community/py3-dbusmock: add patch to fix bluez properties

Submitted upstream:
https://github.com/martinpitt/python-dbusmock/pull/190
This commit is contained in:
Luca Weiss 2023-12-06 17:59:03 +01:00 committed by Bart Ribbers
parent 814a97d334
commit 83c6b8bfe7
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From a7224619eb412498436525f21c8801d7f201e1f6 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Mon, 4 Dec 2023 21:32:09 +0100
Subject: [PATCH] bluez5: Set Modalias, Class & Icon properties
Otherwise we only emit those with PropertiesChanged but GetAll won't
return those properties.
---
dbusmock/templates/bluez5.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dbusmock/templates/bluez5.py b/dbusmock/templates/bluez5.py
index c94946f..dd3bf91 100644
--- a/dbusmock/templates/bluez5.py
+++ b/dbusmock/templates/bluez5.py
@@ -474,6 +474,10 @@ def PairDevice(_self, adapter_device_name, device_address, class_):
'Icon': dbus.String('phone', variant_level=1),
})
+ device.props[DEVICE_IFACE]['Modalias'] = dbus.String("bluetooth:v000Fp1200d1436", variant_level=1)
+ device.props[DEVICE_IFACE]['Class'] = dbus.UInt32(class_, variant_level=1)
+ device.props[DEVICE_IFACE]['Icon'] = dbus.String("phone", variant_level=1)
+
device.EmitSignal(dbus.PROPERTIES_IFACE, 'PropertiesChanged', 'sa{sv}as', [
DEVICE_IFACE,
{
--
2.43.0

View File

@ -12,7 +12,9 @@ makedepends="python3-dev py3-setuptools"
checkdepends="bash py3-nose py3-pytest"
_pypiprefix="${_pyname%${_pyname#?}}"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz
0001-bluez5-Set-Modalias-Class-Icon-properties.patch
"
builddir="$srcdir/$_pyname-$pkgver"
build() {
@ -31,4 +33,5 @@ package() {
sha512sums="
280a8ebfe12a0f5b309d5b807547ed521c80c9899fdc89abaaee238621cf94d05f8413ab2908ca331f9d3ef1c610234dafbd912f8590f18c7d9cafe470beece6 python-dbusmock-0.30.0.tar.gz
9f00629be101a33aea471dfde7d77b4a55dda29631dfaa33486088787afda826341da8cf5655d487964896cadf1759528b42d7e4c74891fb8add1e23b7d3dbe4 0001-bluez5-Set-Modalias-Class-Icon-properties.patch
"