aio.ProxyInterface¶
- class dbus_fast.aio.ProxyInterface(bus_name: str, path: str, introspection: Interface, bus: BaseMessageBus)¶
Bases:
BaseProxyInterface
A class representing a proxy to an interface exported on the bus by another client for the asyncio
MessageBus
implementation.This class is not meant to be constructed directly by the user. Use
ProxyObject.get_interface()
on a asyncio proxy object to get a proxy interface.This class exposes methods to call DBus methods, listen to signals, and get and set properties on the interface that are created dynamically based on the introspection data passed to the proxy object that made this proxy interface.
A method call takes this form:
result = await interface.call_[METHOD](*args)
Where
METHOD
is the name of the method converted to snake case.DBus methods are exposed as coroutines that take arguments that correpond to the in args of the interface method definition and return a
result
that corresponds to the out arg. If the method has more than one out arg, they are returned within alist
.To listen to a signal use this form:
interface.on_[SIGNAL](callback)
To stop listening to a signal use this form:
interface.off_[SIGNAL](callback)
Where
SIGNAL
is the name of the signal converted to snake case.DBus signals are exposed with an event-callback interface. The provided
callback
will be called when the signal is emitted with arguments that correspond to the out args of the interface signal definition.To get or set a property use this form:
value = await interface.get_[PROPERTY]() await interface.set_[PROPERTY](value)
Where
PROPERTY
is the name of the property converted to snake case.DBus property getters and setters are exposed as coroutines. The
value
must correspond to the type of the property in the interface definition.If the service returns an error for a DBus call, a
DBusError
will be raised with information about the error.- bus: AioMessageBus¶