mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-21 16:16:31 +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."""
|
"""Return all serial and connected devices."""
|
||||||
dev_list: List[Device] = []
|
dev_list: List[Device] = []
|
||||||
for device in self.devices:
|
for device in self.devices:
|
||||||
if (
|
if device.subsystem != "tty" or (
|
||||||
device.subsystem != "tty"
|
"ID_VENDOR" not in device.attributes
|
||||||
or "ID_VENDOR" not in device.attributes
|
and not RE_TTY.search(str(device.path))
|
||||||
or not RE_TTY.search(str(device.path))
|
|
||||||
):
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ def test_serial_devices():
|
|||||||
assert [(device.name, device.links) for device in system.serial_devices] == [
|
assert [(device.name, device.links) for device in system.serial_devices] == [
|
||||||
("ttyACM0", []),
|
("ttyACM0", []),
|
||||||
("ttyUSB0", [Path("/dev/serial/by-id/xyx")]),
|
("ttyUSB0", [Path("/dev/serial/by-id/xyx")]),
|
||||||
|
("ttyS0", []),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user