We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ebf3fc9 commit 92d1d45Copy full SHA for 92d1d45
board_serial
@@ -1,5 +1,6 @@
1
#!/bin/python3
2
import os
3
+import random
4
import sys
5
6
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
@@ -16,11 +17,14 @@ if __name__ == "__main__":
16
17
18
devices = list(filter(lambda x: x["dev_type"] == sys.argv[1], chips))
19
20
+ sys.stderr.write(f"Have {len(chips)} chips, {len(devices)} match of type {sys.argv[1]}")
21
+
22
if len(devices) == 0:
- print("Device not found")
23
+ sys.stderr.write(f"No devices of type {sys.argv[1]} found")
24
sys.exit(1)
25
- device = devices[0]
26
+ device = random.choice(devices)
27
+ sys.stderr.write(f"Selected {device['serial']}")
28
29
print(device['serial'])
30
0 commit comments