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 provides access to the devices managed by the local home platform. Applications can use this interface to send and receive commands with a locally identified device using the send method.

localHomeApp.getDeviceManager()
  .send(deviceCommand)
  .then((result) => {
    // Handle command success
  })
  .catch((err: IntentFlow.HandlerError) => {
    // Handle command error
  });

Index

Methods

getProxyInfo

  • getProxyInfo ( id string ) : ProxyInfo
  • getProxyInfo is called by app to get information about the hub / bridge controlling this end-device.

    Parameters

    • id: string

      Device ID of end device that is being controlled by the hub.

    Returns ProxyInfo

getRegisteredDevices

markPending

  • markPending ( request IntentRequest ,  response ? :  IntentResponse ) : Promise < void >
  • markPending is called by the app when app is done handling an intent, but the actual operation (usually EXECUTE command) is still not done. This enables Google Home to respond back to the user in a timely fashion. This may be useful for somewhat long running operations. Returns a promise.

    Parameters

    • request: IntentRequest

      Original intent request that should be marked pending.

    • Optional response: IntentResponse

      Pending response to the intent request.

    Returns Promise<void>

reportState

  • reportState ( state Payload ) : undefined
  • reportState is called by app to report the changed state for the device. In the case of BLE Seamless Setup, it should be called whenever the app receives a BLE notification in ParseNotificationHandler.

    Parameters

    • state: Payload

      the latest state of the device

    Returns undefined

send

sendAndWait