mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 15:16:33 +00:00
Fix hardware serial list check (#1943)
This commit is contained in:
parent
d315e81ab2
commit
016fd24859
@ -89,10 +89,9 @@ class Hardware:
|
||||
"""Return all serial and connected devices."""
|
||||
dev_list: List[Device] = []
|
||||
for device in self.devices:
|
||||
if (
|
||||
device.subsystem != "tty"
|
||||
or "ID_VENDOR" not in device.attributes
|
||||
or not RE_TTY.search(str(device.path))
|
||||
if device.subsystem != "tty" or (
|
||||
"ID_VENDOR" not in device.attributes
|
||||
and not RE_TTY.search(str(device.path))
|
||||
):
|
||||
continue
|
||||
|
||||
|
@ -58,6 +58,7 @@ def test_serial_devices():
|
||||
assert [(device.name, device.links) for device in system.serial_devices] == [
|
||||
("ttyACM0", []),
|
||||
("ttyUSB0", [Path("/dev/serial/by-id/xyx")]),
|
||||
("ttyS0", []),
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user