Skip to content

Commit

Permalink
added support for 8.00
Browse files Browse the repository at this point in the history
  • Loading branch information
blawar committed Feb 11, 2020
1 parent 339319a commit ac08f47
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
27 changes: 21 additions & 6 deletions nut/Usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,32 @@ def poll_commands(in_ep, out_ep):
else:
Print.error('failed to read!')

def getDevice():
while True:
devs = usb.core.find(idVendor=0x16C0, idProduct=0x27E2, find_all=True)

if devs is not None:
for dev in devs:
return dev

devs = usb.core.find(idVendor=0x057E, idProduct=0x3000, find_all=True)

if devs is not None:
for dev in devs:
return dev




time.sleep(1)

def daemon():
global status
while True:
try:
status = 'disconnected'
while True:
dev = usb.core.find(idVendor=0x057E, idProduct=0x3000)

if dev != None:
break
time.sleep(1)

dev = getDevice()

Print.info('USB Connected')
status = 'connected'
Expand Down
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __init__(self):
super().__init__()
self.setWindowIcon(QIcon('public_html/images/logo.jpg'))
screen = QDesktopWidget().screenGeometry()
self.title = 'NUT USB / Web Server v2.5'
self.title = 'NUT USB / Web Server v2.6'
self.left = screen.width() / 4
self.top = screen.height() / 4
self.width = screen.width() / 2
Expand Down

0 comments on commit ac08f47

Please sign in to comment.