File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -169,17 +169,32 @@ def poll_commands(in_ep, out_ep):
169169 else :
170170 Print .error ('failed to read!' )
171171
172+ def getDevice ():
173+ while True :
174+ devs = usb .core .find (idVendor = 0x16C0 , idProduct = 0x27E2 , find_all = True )
175+
176+ if devs is not None :
177+ for dev in devs :
178+ return dev
179+
180+ devs = usb .core .find (idVendor = 0x057E , idProduct = 0x3000 , find_all = True )
181+
182+ if devs is not None :
183+ for dev in devs :
184+ return dev
185+
186+
187+
188+
189+ time .sleep (1 )
190+
172191def daemon ():
173192 global status
174193 while True :
175194 try :
176195 status = 'disconnected'
177- while True :
178- dev = usb .core .find (idVendor = 0x057E , idProduct = 0x3000 )
179-
180- if dev != None :
181- break
182- time .sleep (1 )
196+
197+ dev = getDevice ()
183198
184199 Print .info ('USB Connected' )
185200 status = 'connected'
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def __init__(self):
144144 super ().__init__ ()
145145 self .setWindowIcon (QIcon ('public_html/images/logo.jpg' ))
146146 screen = QDesktopWidget ().screenGeometry ()
147- self .title = 'NUT USB / Web Server v2.5 '
147+ self .title = 'NUT USB / Web Server v2.6 '
148148 self .left = screen .width () / 4
149149 self .top = screen .height () / 4
150150 self .width = screen .width () / 2
You can’t perform that action at this time.
0 commit comments