# - [smarthome](https://developers.home.google.com/reference/local-home/modules/smarthome.html).
- App

This class is the main entry point for your app in the local home platform.
Use the [App](https://developers.home.google.com/reference/local-home/classes/smarthome.app) class to register callback handlers for [Intents](https://developers.home.google.com/reference/local-home/enums/smarthome.intents.html) 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](https://developers.home.google.com/reference/local-home/classes/smarthome.app#constructor)

### Methods

- [getDeviceManager](https://developers.home.google.com/reference/local-home/classes/smarthome.app#getdevicemanager)
- [getLogger](https://developers.home.google.com/reference/local-home/classes/smarthome.app#getlogger)
- [listen](https://developers.home.google.com/reference/local-home/classes/smarthome.app#listen)
- [on](https://developers.home.google.com/reference/local-home/classes/smarthome.app#on)
- [onExecute](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onexecute)
- [onIdentify](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onidentify)
- [onIndicate](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onindicate)
- [onParseNotification](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onparsenotification)
- [onProvision](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onprovision)
- [onProxySelected](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onproxyselected)
- [onQuery](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onquery)
- [onReachableDevices](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onreachabledevices)
- [onRegister](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onregister)
- [onUnprovision](https://developers.home.google.com/reference/local-home/classes/smarthome.app#onunprovision)

## Constructors

### constructor

- new App ( version : string ) : [App](https://developers.home.google.com/reference/local-home/classes/smarthome.app)
-

  #### Parameters

  -

    ##### version: string

  #### Returns [App](https://developers.home.google.com/reference/local-home/classes/smarthome.app)

## Methods

### getDeviceManager

- getDeviceManager ( ) : [DeviceManager](https://developers.home.google.com/reference/local-home/interfaces/smarthome.devicemanager.html)
- `getDeviceManager` is called by app to get the reference to the singleton
  DeviceManager object.

  #### Returns [DeviceManager](https://developers.home.google.com/reference/local-home/interfaces/smarthome.devicemanager.html)

  [DeviceManager](https://developers.home.google.com/reference/local-home/interfaces/smarthome.devicemanager.html)

### getLogger

- getLogger ( ) : [CloudLogger](https://developers.home.google.com/reference/local-home/interfaces/smarthome.cloudlogger.html)
- `getLogger` is called by app to get the reference to the singleton
  CloudLogger object.

  #### Returns [CloudLogger](https://developers.home.google.com/reference/local-home/interfaces/smarthome.cloudlogger.html)

  [CloudLogger](https://developers.home.google.com/reference/local-home/interfaces/smarthome.cloudlogger.html)

### listen

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

  #### Returns Promise\<void\>

### on

- on ( eventType : [EventType](https://developers.home.google.com/reference/local-home/enums/smarthome.constants.eventtype.html) , handler : [EventHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#eventhandler) ) : this
- `on` is called by app to attach the handler for generic events specified
  in [Constants.EventType](https://developers.home.google.com/reference/local-home/enums/smarthome.constants.eventtype.html)

  #### Parameters

  -

    ##### eventType: [EventType](https://developers.home.google.com/reference/local-home/enums/smarthome.constants.eventtype.html)

    The generic event type the hanlers
  -

    ##### handler: [EventHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#eventhandler)

    The handler that handles the intent.

  #### Returns this

### onExecute

- onExecute ( handler : [ExecuteHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.executehandler.html) ) : this
- `onExecute` is called by app to attach the handler for EXECUTE intent.

  #### Parameters

  -

    ##### handler: [ExecuteHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.executehandler.html)

    The handler that handles EXECUTE intent.

  #### Returns this

### onIdentify

- onIdentify ( handler : [IdentifyHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.identifyhandler.html) ) : this
- `onIdentify` is called by app to attach the handler for IDENTIFY intent.

  #### Parameters

  -

    ##### handler: [IdentifyHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.identifyhandler.html)

    The handler that handles IDENTIFY intent.

  #### Returns this

### onIndicate

- onIndicate ( handler : [IndicateHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#indicatehandler) ) : this
- `onIndicate` is called by app to attach the handler for INDICATE intent.

  #### Parameters

  -

    ##### handler: [IndicateHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#indicatehandler)

    The handler that handles INDICATE intent.

  #### Returns this

### onParseNotification

- onParseNotification ( handler : [ParseNotificationHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#parsenotificationhandler) ) : this
- `onParseNotification` is called by app to attach the handler for
  PARSE_NOTIFICATION intent.

  #### Parameters

  -

    ##### handler: [ParseNotificationHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#parsenotificationhandler)

    The handler that handles PARSE_NOTIFICATION intent.

  #### Returns this

### onProvision

- onProvision ( handler : [ProvisionHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#provisionhandler) ) : this
- `onProvision` is called by app to attach the handler for PROVISION
  intent.

  #### Parameters

  -

    ##### handler: [ProvisionHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#provisionhandler)

    The handler that handles PROVISION intent.

  #### Returns this

### onProxySelected

- onProxySelected ( handler : [ProxySelectedHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#proxyselectedhandler) ) : this
- `onProxySelected` is called by app to attach the handler for
  PROXY_SELECTED intent.

  #### Parameters

  -

    ##### handler: [ProxySelectedHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#proxyselectedhandler)

    The handler that handles PROXY_SELECTED intent.

  #### Returns this

### onQuery

- onQuery ( handler : [QueryHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.queryhandler.html) ) : this
- `onQuery` is called by app to attach the handler for QUERY intent.

  #### Parameters

  -

    ##### handler: [QueryHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.queryhandler.html)

    The handler that handles QUERY intent.

  #### Returns this

### onReachableDevices

- onReachableDevices ( handler : [ReachableDevicesHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.reachabledeviceshandler.html) ) : this
- `onReachableDevices` is called by app to attach the handler for
  REACHABLE_DEVICES intent.

  #### Parameters

  -

    ##### handler: [ReachableDevicesHandler](https://developers.home.google.com/reference/local-home/interfaces/smarthome.intentflow.reachabledeviceshandler.html)

    The handler that handles REACHABLE_DEVICES intent.

  #### Returns this

### onRegister

- onRegister ( handler : [RegisterHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#registerhandler) ) : this
- `onRegister` is called by app to attach the handler for REGISTER intent.

  #### Parameters

  -

    ##### handler: [RegisterHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#registerhandler)

    The handler that handles REGISTER intent.

  #### Returns this

### onUnprovision

- onUnprovision ( handler : [UnprovisionHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#unprovisionhandler) ) : this
- `onUnprovision` is called by app to attach the handler for UNPROVISION
  intent.

  #### Parameters

  -

    ##### handler: [UnprovisionHandler](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html#unprovisionhandler)

    The handler that handles UNPROVISION intent.

  #### Returns this