
Re: Plugin: Waiting for Device Status update
The best solution is to have an asynchronous (ajaxy) interface where you can push device status updates down to the browser at any time - like how Indigo control pages work. Without this, you're not going to see updated device states that result from triggers, scheduled actions, or UI input by other means.
But to answer your question - yes, you could suspend delivery of the web response until you receive the expected status update. This should have a fairly short (eg 5 sec) timeout so the browser isn't hanging around forever in case of an error.
How to implement such a thing depends on how you are designing your client. To do it right you will need a proper event loop, with an async Indigo client and an async http server. I have a general solution for this sort of Indigo client in perl (
http://www.seanadams.com/ha/automogator/ ). Although I haven't tried to collect responses within the handling of an HTTP request as you're describing, it would be feasible.