Allow definition of additional glob patterns for serial ports
Configuration happens via config.yaml, just add additional patterns by listing them under serial > additionalPorts, e.g.
serial:
additionalPorts:
- /dev/myCustomPort
- /dev/myOtherCustomPort
This commit is contained in:
parent
accf70ee6c
commit
93db51ecb9
2 changed files with 7 additions and 1 deletions
|
|
@ -32,7 +32,8 @@ default_settings = {
|
|||
"detection": 0.5,
|
||||
"connection": 2,
|
||||
"communication": 5
|
||||
}
|
||||
},
|
||||
"additionalPorts": []
|
||||
},
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ def serialList():
|
|||
+ glob.glob("/dev/tty.usb*") \
|
||||
+ glob.glob("/dev/cu.*") \
|
||||
+ glob.glob("/dev/rfcomm*")
|
||||
|
||||
additionalPorts = settings().get(["serial", "additionalPorts"])
|
||||
for additional in additionalPorts:
|
||||
baselist += glob.glob(additional)
|
||||
|
||||
prev = settings().get(["serial", "port"])
|
||||
if prev in baselist:
|
||||
baselist.remove(prev)
|
||||
|
|
|
|||
Loading…
Reference in a new issue