Methods
(async) close(id, displayIdopt) → {Promise}
Closes and destroys the webview hosting the application with the provided ID.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
number |
The ID of the application to close. |
||
displayId |
string |
<optional> |
Current Display ID |
The ID of the display to preload on, defaults to the ID of the current display |
(async) closeSettings() → {Promise}
Closes the settings page
(async) disableScheduler() → {Promise}
Disable the scheduler, this will prevent your application being overriden by the scheduler
(async) enableScheduler() → {Promise}
Enable the schedule, this will allow the scheduler to display/hide applications as per the schedule
(async) getApplicationIdByName(name) → {Promise.<number>}
Retrieves the ID of the application with the name provided
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
The name of the application (case sensitive) |
(async) hide(id, displayIdopt) → {Promise}
Hides the webview hosting the application with the ID provided
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
number |
The ID of the application to hide |
||
displayId |
string |
<optional> |
Current Display ID |
The ID of the display to preload on, defaults to the ID of the current display |
(async) list() → {Promise.<Array.<module:App~application>>}
Returns a list of available applications
(async) open(id, configopt, displayIdopt) → {Promise}
Open
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
number |
The ID of the application to open |
||
config |
openAppConfig |
<optional> |
{} |
The configuration of the applications webview |
displayId |
string |
<optional> |
Current Display ID |
The ID of the display to preload on, defaults to the ID of the current display |
(async) openSettings(page) → {Promise}
Opens the Settings page which provides access to a Network Configuration screen.
Parameters:
Name | Type | Description |
---|---|---|
page |
string |
The page to skip to i.e wifi, etherent etc. |
Example
import Agent from '@meldcx/agent';
const agent = new Agent();
const init = async() => {
await agent.onReadyAsync();
await agent.App.openSettings();
console.log('The settings page will be open now');
};
(async) preload(id, isPublicopt, displayIdopt) → {Promise}
Preload an application
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
number |
The ID of the application |
||
isPublic |
boolean |
<optional> |
false |
If the hosting webserver should be publicly available |
displayId |
string |
<optional> |
Current Display ID |
The ID of the display to preload on, defaults to the ID of the current display |
(async) ready(id) → {Promise.<boolean>}
Check an application is ready to be loaded
Parameters:
Name | Type | Description |
---|---|---|
id |
number |
The ID of the application |
(async) reset(displayIdopt) → {Promise}
Resets all of the webviews back to default Note: This doesn't re-enable the scheduler
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
displayId |
string |
<optional> |
Current Display ID |
The ID of the display to preload on, defaults to the ID of the current display |