Closed benallard closed 6 years ago
DBus introspection data does not provide information about expected types of values in dictionaries using multiple types inside. So you need to create Variants yourself.
from pydbus import Variant
Variant('as', [service])
Variant('s', 'le')
Here's more info about the type descriptions: https://developer.gnome.org/glib/stable/gvariant-format-strings.html
Theoretically pydbus could infer those types automatically based on Python types, but it might lead to problems when talking with a daemon written in a statically-typed language that expects other types than pydbus has inferred.
On the other hand, people usually guess these things, and do not check them in the docs, so automatic guesser might do a better job than they do.
It's a bit disturbing to have to go back to the raw type for that one call only. All the rest is working fine, except this, giving the feeling that it's broken.
I actually fixed it on my side the way you advised me to use. So it's working fine now, just feeling a bit awkward.
This might be a duplicate of #27, but I didn't understood it good enough to be sure.
This happened while calling org.bluez.Adapter1.SetDiscoveryFilter with a raw dict. The dict got translated correctly, but not its fields.