PairSession
homey.pair_session
A pairing session, prompting users for information to add new devices.
This class must not be initialized by the developer, but is passed to Driver.on_pair().
Methods
done
async def done(self) ‑> NoneClose the pairing session.
emit
async def emit(self, event: str, data: Any | None = None) ‑> AnyEmits an event with the given name, along with any data, to the pairing view.
Returns
Any data returned by the handler in the pairing session.
show_view
async def show_view(self, id: str) ‑> NoneShow the view with the given id in the pairing flow, as defined in app.json.
next_view
async def next_view(self) ‑> NoneGo to the next pairing step.
prev_view
async def prev_view(self) ‑> NoneGo to the previous pairing step.
set_handler
def set_handler(self, event: str, listener: Callable[..., Coroutine[Any, Any, Any]]) ‑> SelfRegister a listener for events of the given name emitted by the pairing view. Any data returned will be sent back to the view.
Args
| Name | Type | Description |
|---|---|---|
listener |
Callable[..., Coroutine[Any, Any, Any]] | An async listener that receives any data that is passed along with the event. |
Returns
This pairing session, for chained calls.