mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
Fix Hardware list (#1490)
This commit is contained in:
parent
a65d3222b9
commit
fcdd66dc6e
@ -54,10 +54,16 @@ class Hardware:
|
||||
|
||||
# Exctract all devices
|
||||
for device in self.context.list_devices():
|
||||
# Skip devices without mapping
|
||||
if not device.device_node:
|
||||
continue
|
||||
|
||||
dev_list.append(
|
||||
Device(device.sys_name),
|
||||
Path(device.device_node),
|
||||
[Path(node) for node in device.device_links],
|
||||
Device(
|
||||
device.sys_name,
|
||||
Path(device.device_node),
|
||||
[Path(node) for node in device.device_links],
|
||||
)
|
||||
)
|
||||
|
||||
return dev_list
|
||||
|
10
tests/misc/test_hardware.py
Normal file
10
tests/misc/test_hardware.py
Normal file
@ -0,0 +1,10 @@
|
||||
"""Test hardware utils."""
|
||||
|
||||
from hassio.misc.hardware import Hardware
|
||||
|
||||
|
||||
def test_read_all_devices():
|
||||
"""Test to read all devices."""
|
||||
system = Hardware()
|
||||
|
||||
assert system.devices
|
Loading…
x
Reference in New Issue
Block a user