ESP Home Documentation
LOGIN

Interaction with Pages

ESP.openPage

Opens another page and push it to navigation controller.

Syntax:
ESP.openPage(page_id, options)

  • page_id is the id of the page that you defined in esphome.app website. First page ID is always “default”.
  • options is an object with the following definition:
Option Description
title Title of the page, default is the one that you specified in page definition.
open A function that will be called once the page is opened. Syntax of the function is function(){}
close A function that will be called when user closed the page. Syntax of the function is function(){}

ESP.showWait

Shows a “Please Wait” on the app.

Syntax:
ESP.showWait(title)

  • title is the label of the wait box.

ESP.hideWait

Hides a previously shown wait message.

Syntax:
ESP.hideWait()

ESP.showMessage

Shows a message box on the app.

Syntax:
ESP.showMessage(title, message, callback)

  • title is the title of message box.
  • message is the message body.
  • callback is the function that will be called when user dismissed the message box. General form of the callback function is function(){}.

ESP.showConfirm

Shows a message box on the app with “Cancel” and “OK” buttons.

Syntax:
ESP.showConfirm(title, message, callback)

  • title is the title of message box.
  • message is the message body.
  • callback is the function that will be called when user dismissed the message box. General form of the callback function is function(result){} where result is "y" if user clicked “OK” and "n" if used clicked “Cancel”.