aio.ProxyInterface¶
- class dbus_fast.aio.ProxyInterface(bus_name: str, path: str, introspection: Interface, bus: BaseMessageBus)¶
Bases:
BaseProxyInterfaceA class representing a proxy to an interface exported on the bus by another client for the asyncio
MessageBusimplementation.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
METHODis 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
resultthat corresponds to the out arg. If the method has more than one out arg, they are returned within atuple.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
SIGNALis the name of the signal converted to snake case.DBus signals are exposed with an event-callback interface. The provided
callbackwill 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
PROPERTYis the name of the property converted to snake case.DBus property getters and setters are exposed as coroutines. The
valuemust correspond to the type of the property in the interface definition.If the service returns an error for a DBus call, a
DBusErrorwill be raised with information about the error.- bus: AioMessageBus¶