diff options
Diffstat (limited to 'python/examples/futureHouse')
| -rw-r--r-- | python/examples/futureHouse/futureHouse.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/examples/futureHouse/futureHouse.py b/python/examples/futureHouse/futureHouse.py index 10ad3b8..318d759 100644 --- a/python/examples/futureHouse/futureHouse.py +++ b/python/examples/futureHouse/futureHouse.py @@ -92,10 +92,16 @@ def callback(message, channel): pubnub.publish(channel, enviro, callback=pubMessage, error=pubMessage) if 'openDoor' in message: - moveDoor("open") - elif 'closeDoor' in message: - moveDoor("close") + try: + thread.start_new_thread( moveDoor, ("open",) ) + except: + print "Error: unable to open door thread" + elif 'closeDoor' in message: + try: + thread.start_new_thread( moveDoor, ("close",) ) + except: + print "Error: unable to close door thread" def error(message): print("ERROR : " + (message)) |
