Join us online for the Google Smart Home Developer Summit on October 21st! Register here to learn what's new, and what's coming up for Google Smart Home.

This class is the main entry point for your app in the local home platform. Use the App class to register callback handlers for Intents and to listen for new events.

import App = smarthome.App;

const localHomeApp: App = new App("1.0.0");
localHomeApp
  .onIdentify(identifyHandler)
  .onExecute(executeHandler)
  .listen()
  .then(() => console.log("Ready"));

Index

Constructors

constructor

  • new App ( version string ) : App
  • Parameters

    • version: string

    Returns App

Methods

getDeviceManager

listen

  • listen ( ) : Promise < void >
  • listen is called by app when the app is ready to handle the intents.

    Returns Promise<void>

on

onExecute

  • onExecute ( handler ExecuteHandler ) : this
  • onExecute is called by app to attach the handler for EXECUTE intent.

    Parameters

    Returns this

onIdentify

  • onIdentify ( handler IdentifyHandler ) : this
  • onIdentify is called by app to attach the handler for IDENTIFY intent.

    Parameters

    Returns this

onIndicate

  • onIndicate ( handler IndicateHandler ) : this
  • onIndicate is called by app to attach the handler for INDICATE intent.

    Parameters

    Returns this

onParseNotification

  • onParseNotification ( handler ParseNotificationHandler ) : this
  • onParseNotification is called by app to attach the handler for PARSE_NOTIFICATION intent.

    Parameters

    Returns this

onProvision

  • onProvision ( handler ProvisionHandler ) : this
  • onProvision is called by app to attach the handler for PROVISION intent.

    Parameters

    Returns this

onProxySelected

  • onProxySelected ( handler ProxySelectedHandler ) : this
  • onProxySelected is called by app to attach the handler for PROXY_SELECTED intent.

    Parameters

    Returns this

onQuery

  • onQuery ( handler QueryHandler ) : this
  • onQuery is called by app to attach the handler for QUERY intent.

    Parameters

    • handler: QueryHandler

      The handler that handles QUERY intent.

    Returns this

onReachableDevices

  • onReachableDevices ( handler ReachableDevicesHandler ) : this
  • onReachableDevices is called by app to attach the handler for REACHABLE_DEVICES intent.

    Parameters

    Returns this

onRegister

  • onRegister ( handler RegisterHandler ) : this
  • onRegister is called by app to attach the handler for REGISTER intent.

    Parameters

    Returns this

onUnprovision

  • onUnprovision ( handler UnprovisionHandler ) : this
  • onUnprovision is called by app to attach the handler for UNPROVISION intent.

    Parameters

    Returns this