Skip to content

Commit ac08f47

Browse files
committed
added support for 8.00
1 parent 339319a commit ac08f47

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

nut/Usb.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff 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+
172191
def 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'

server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)