cli: terminate iteration over receiver devices when all have been found
This commit is contained in:
parent
7ab7bf6c1a
commit
0b7b037e11
|
@ -161,9 +161,11 @@ def _find_device(receivers, name):
|
|||
dev = r[number]
|
||||
if dev:
|
||||
yield dev
|
||||
count = r.count()
|
||||
else: # wired device, make a device list from it
|
||||
r.ping()
|
||||
r = [r]
|
||||
count = 1
|
||||
|
||||
for dev in r:
|
||||
if (
|
||||
|
@ -171,6 +173,9 @@ def _find_device(receivers, name):
|
|||
or name in dev.name.lower()
|
||||
):
|
||||
yield dev
|
||||
count -= 1
|
||||
if not count:
|
||||
break
|
||||
|
||||
|
||||
# raise Exception("no device found matching '%s'" % name)
|
||||
|
|
Loading…
Reference in New Issue