Skip to content

Commit 23f81f8

Browse files
committed
resouce/suggest: add basic support for USBPowerPorts
We can't really detect if the ports are actually controllable, so we have to show all hubs. This also means that we can't suggest a specific port index, so show a placeholder. Signed-off-by: Jan Luebbe <[email protected]>
1 parent 153362a commit 23f81f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

labgrid/resource/suggest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
LXAUSBMux,
2323
HIDRelay,
2424
USBDebugger,
25+
USBPowerPort,
2526
)
2627
from ..util import dump
2728

@@ -54,6 +55,7 @@ def __init__(self, args):
5455
self.resources.append(LXAUSBMux(**args))
5556
self.resources.append(HIDRelay(**args))
5657
self.resources.append(USBDebugger(**args))
58+
self.resources.append(USBPowerPort(**args, index=0))
5759

5860
def suggest_callback(self, resource, meta, suggestions):
5961
cls = type(resource).__name__
@@ -80,6 +82,8 @@ def suggest_callback(self, resource, meta, suggestions):
8082
dump({cls: {"match": suggestion}}).strip(),
8183
' ',
8284
))
85+
if cls == 'USBPowerPort':
86+
print(' index: ?')
8387
print(" ---")
8488
print()
8589

0 commit comments

Comments
 (0)