Custom Pairing Views
Most drivers will suffice using the provided pairing templates. Some advanced drivers however can benefit from creating their own views.
Back-end API
const Homey = require('homey');
class Driver extends Homey.Driver {
async onPair(session) {
// Show a specific view by ID
await session.showView("my_view");
// Show the next view
await session.nextView();
// Show the previous view
await session.prevView();
// Close the pair session
await session.done();
// Received when a view has changed
session.setHandler("showView", async function (viewId) {
console.log("View: " + viewId);
});
}
}
module.exports = Driver;Front-end API
Emit an event
Receive an event
Set a Title
Example
Set a Subtitle
Example
Show a View
Previous View
Next View
Get the current view
Create a device
Example:
Get current zone
Get view options
Set navigation close
Close the pair session
Alert dialog
Confirm dialog
Popup
Internationalisation
Show the loading overlay
Hide the loading overlay
Get a view's store value
Set a view's store value
Example
Last updated
Was this helpful?