Is HubAction exposed to Device Handlers like Smart Apps?

I know I can ask the Hub to invoke a HTTP request using the following code in a SmartApp:

sendHubCommand(new physicalgraph.device.HubAction("""GET ${path} HTTP/1.1\r\nHOST: $host\r\n\r\n""", physicalgraph.device.Protocol.LAN, host, [callback: myHandler]))

This will invoke the myHandler method on the SmartApp.

I wanted to do the same thing in a Device Handler, for instance I make a GET request to an endpoint, after maybe 3 seconds the request is complete, so I want to remove the Opening state and set the Open state.

I know I can get the response to HubActions through the parse handler, but this is called for every event. If the user mashes the Open/Close button I do not know in which order the responses are for, and I have to save state about what was happening for this particular request.

I really would like access to the closure as exposed to SmartApps through the httpGet method, which as far as I am aware is not supported in Device Handlers.

I would appreciate any help.

Just call a SmartApp parent.devicehandler method (if your device is a childdevice of the SmartApp)?

Thanks @dudz40, I will try to call parent to invoke the operation and see if I can call back to a specific method on the child.

If it is about getting your state from opening to open, you can create a generateEvent routine in your device handler that in turn does a sendEvent updating your state and call the child.generateEvent with a param from your App,

Thanks I will look to move my API logic into the SmartApp and callback into the Device Handler using that method.