mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 02:56:31 +00:00
Fix Hardware list (#1490)
This commit is contained in:
parent
a65d3222b9
commit
fcdd66dc6e
@ -54,11 +54,17 @@ class Hardware:
|
|||||||
|
|
||||||
# Exctract all devices
|
# Exctract all devices
|
||||||
for device in self.context.list_devices():
|
for device in self.context.list_devices():
|
||||||
|
# Skip devices without mapping
|
||||||
|
if not device.device_node:
|
||||||
|
continue
|
||||||
|
|
||||||
dev_list.append(
|
dev_list.append(
|
||||||
Device(device.sys_name),
|
Device(
|
||||||
|
device.sys_name,
|
||||||
Path(device.device_node),
|
Path(device.device_node),
|
||||||
[Path(node) for node in device.device_links],
|
[Path(node) for node in device.device_links],
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return dev_list
|
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