App

The App class is your start point for any app. This class should be extended and exported from app.js. Methods prefixed with on are meant to be overriden. It is not allowed to overwrite the constructor.

Table of Contents

Example

/app.js

const Homey = require('homey');

class MyApp extends Homey.App {

  onInit() {
    this.log('My App is running!');
  }

}

module.exports = MyApp;

Extends

Methods

error(…message)

Log a message to the console (stderr)

Inherited From:
Parameters:
Name Type Attributes Description
message * <repeatable>

log(…message)

Log a message to the console (stdout)

Inherited From:
Parameters:
Name Type Attributes Description
message * <repeatable>

onInit()

This method is called upon initialization of your app