georg90/pimatic-max-thermostat — pull request #6 by sweetpi (2014-09-14 19:09:42+00:00)
Title: connection to cube clean up

So... Please give it a try.

What we doing is the following: We creating a pending promise which gets fulfilled when the connection is established and gets rejected if the connection times out or throws an error.

We then use this promise in the devices to do the things, so we don't have to wait for the connection event Anymore. We just say: hi just do it if the connection promise was resolved or return the rejected connection promise.