mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-23 09:06:29 +00:00
Update hardware.py (#275)
This commit is contained in:
parent
26d8dc0ec6
commit
110cd32dc3
@ -20,6 +20,7 @@ PROC_STAT = Path("/proc/stat")
|
|||||||
RE_BOOT_TIME = re.compile(r"btime (\d+)")
|
RE_BOOT_TIME = re.compile(r"btime (\d+)")
|
||||||
|
|
||||||
GPIO_DEVICES = Path("/sys/class/gpio")
|
GPIO_DEVICES = Path("/sys/class/gpio")
|
||||||
|
RE_TTY = re.compile(r"tty[A-Z]+")
|
||||||
|
|
||||||
|
|
||||||
class Hardware(object):
|
class Hardware(object):
|
||||||
@ -34,7 +35,7 @@ class Hardware(object):
|
|||||||
"""Return all serial and connected devices."""
|
"""Return all serial and connected devices."""
|
||||||
dev_list = set()
|
dev_list = set()
|
||||||
for device in self.context.list_devices(subsystem='tty'):
|
for device in self.context.list_devices(subsystem='tty'):
|
||||||
if 'ID_VENDOR' in device:
|
if 'ID_VENDOR' in device or RE_TTY.match(device.device_node):
|
||||||
dev_list.add(device.device_node)
|
dev_list.add(device.device_node)
|
||||||
|
|
||||||
return dev_list
|
return dev_list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user