Example
const Homey = require('homey');
class MyApp extends Homey.App {
async onInit() {
this.log('MyApp has been initialized');
}
}
module.exports = MyApp;
Extends
Properties
homey
homey: Homeyid
id: stringThe app id
Type
- string
manifest
manifest: anyThe app.json manifest
Type
- any
sdk
sdk: numberThe app sdk version
Type
- number
Methods
error
error(…args)Emits the __error
event with args
as parameters.
Parameters
Name | Type | Description |
---|---|---|
args
|
*
<repeatable> |
log
log(…args)Emits the __log
event with args
as parameters.
Parameters
Name | Type | Description |
---|---|---|
args
|
*
<repeatable> |
onInit
(async) onInit()This method is called upon initialization of your app.
onUninit
(async) onUninit()This method is called when your app is destroyed.