Index
Methods
getProxyInfo
-
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
-
Returns the list of registered devices.
Returns RegisteredDevice[]
markPending
-
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>
-
send
-
send
is called by app when it needs to communicate with a device. Depending upon the protocol used by the device, the app constructs a DataFlow.CommandRequest object and passes it as an argument. Returns a promise that resolves to DataFlow.CommandSuccess. Response may return data, if it was a read request.See also HttpRequestData, TcpRequestData, UdpRequestData
Parameters
-
command: CommandRequest
Command to communicate with the device.
-
Optional sendOptions: SendOptions
Options for
send
API. See SendOptions.
Returns Promise<CommandSuccess>
Promise that resolves to DataFlow.CommandSuccess
-
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 });