commit 21abfb33340ba34de9c7266568515fc42608b339
Author: Lukas Rusak <lorusak@gmail.com>
Date:   Fri Jan 13 14:27:18 2017 -0800

    wait for controller

diff --git a/src/__init__.py b/src/__init__.py
index 1bf111e..353f032 100644
--- a/src/__init__.py
+++ b/src/__init__.py
@@ -24,7 +24,7 @@ import struct
 from enum import IntEnum
 
 from threading import Timer
-from time import time
+from time import time, sleep
 
 
 VENDOR_ID = 0x28de
@@ -121,24 +121,28 @@ class SteamController(object):
         self._cmsg = []
         self._ctx = usb1.USBContext()
 
+        _handle = None
         handle = []
         pid = []
         endpoint = []
         ccidx = []
-        for i in range(len(PRODUCT_ID)):
-            _pid = PRODUCT_ID[i]
-            _endpoint = ENDPOINT[i]
-            _ccidx = CONTROLIDX[i]
-
-            _handle = self._ctx.openByVendorIDAndProductID(
-                VENDOR_ID, _pid,
-                skip_on_error=True,
-            )
-            if _handle != None:
-                handle.append(_handle)
-                pid.append(_pid)
-                endpoint.append(_endpoint)
-                ccidx.append(_ccidx)
+
+        while _handle is None:
+            for i in range(len(PRODUCT_ID)):
+                _pid = PRODUCT_ID[i]
+                _endpoint = ENDPOINT[i]
+                _ccidx = CONTROLIDX[i]
+
+                _handle = self._ctx.openByVendorIDAndProductID(
+                    VENDOR_ID, _pid,
+                    skip_on_error=True,
+                )
+                if _handle != None:
+                    handle.append(_handle)
+                    pid.append(_pid)
+                    endpoint.append(_endpoint)
+                    ccidx.append(_ccidx)
+            sleep(2)
 
         if len(handle) == 0:
             raise ValueError('No SteamControler Device found')
