New hardware layer Supervisor (#784)

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
This commit is contained in:
Pascal Vizeli
2021-01-28 15:36:44 +01:00
committed by GitHub
parent 6ebc02f268
commit 381dcda224
3 changed files with 32 additions and 19 deletions

View File

@@ -1092,23 +1092,27 @@ Get hardware information.
```json
{
"serial": ["/dev/xy"],
"input": ["Input device name"],
"disk": ["/dev/sdax"],
"gpio": ["gpiochip0", "gpiochip100"],
"audio": {
"CARD_ID": {
"name": "xy",
"type": "microphone",
"devices": [
"chan_id": "channel ID",
"chan_type": "type of device"
]
"devices": [
{
"name": "ttyACM0",
"sysfs": "/sys/devices/usb/00:01",
"dev_path": "/dev/ttyACM0",
"by_id": "/dev/serial/by-id/usb-Silicon_Labs-RFUSB_9017F723B061A7C01410CFCF-if00-port1",
"subsystem": "tty",
"attributes": {
"MINOR": "5"
}
}
}
]
}
```
**Returned data:**
| key | description |
| -------- | ------------------------------------------------------------ |
| devices | A list of [Device models](api/supervisor/models.md#device) |
</ApiEndpoint>
<ApiEndpoint path="/hardware/audio" method="get">
@@ -1132,9 +1136,6 @@ Get audio devices
</ApiEndpoint>
<ApiEndpoint path="/hardware/trigger" method="post">
Trigger UDEV reload.
</ApiEndpoint>
### Host

View File

@@ -221,3 +221,14 @@ These models are describing objects that are getting returned from the superviso
| type | str | Type of the suggestion |
| context | str | In which context the suggestion occorse |
| reference | str or null | Depend on the Context, a reference to a other Model |
## Device
| key | type | description |
| ---------- | -------------- | --------------------------------------------------------------------- |
| name | string | Name of the device object |
| sysfs | string | Path to sysfs device object |
| dev_path | string | Path to devfs |
| subsystem | string or null | Subsystem type of the device (tty, input, sound, block, misc) |
| by_id | string or null | Udev by ID link |
| attributes | dict | A dict with pure udev device attributes for debug and understanding |