diff --git a/docs/add-ons/configuration.md b/docs/add-ons/configuration.md index 7b707571..1d7919d7 100644 --- a/docs/add-ons/configuration.md +++ b/docs/add-ons/configuration.md @@ -125,9 +125,7 @@ The configuration for an add-on is stored in `config.json`. | host_ipc | bool | no | Default `false`. Allow to share the IPC namespace with others. | host_dbus | bool | no | Default `false`. Map the host D-Bus service into the add-on. | host_pid | bool | no | Default `false`. Allow to run container on host PID namespace. Works only for not protected add-ons. -| devices | list | no | Device list to map into the add-on. Format is: `::`. E.g., `/dev/ttyAMA0:/dev/ttyAMA0:rwm` -| udev | bool | no | Default `false`. Set this `true`, if your container runs an udev process of its own. -| auto_uart | bool | no | Default `false`. Auto mapping all UART/serial device from host into add-on. +| devices | list | no | Device list to map into the add-on. Format is: ``. E.g., `/dev/ttyAMA0` | homeassistant | string | no | Pin a minimum required Home Assistant Core version for the add-on. Value is a version string like `0.91.2`. | hassio_role | str | no | Default `default`. Role-based access to Supervisor API. Available: `default`, `homeassistant`, `backup`, `manager` or `admin` | hassio_api | bool | no | This add-on can access the Supervisor's REST API. Use `http://supervisor`. @@ -142,6 +140,8 @@ The configuration for an add-on is stored in `config.json`. | video | bool | no | Mark this add-on to use the internal video system. All available devices will be mapped into the add-on. | gpio | bool | no | If this is set to `true`, `/sys/class/gpio` will map into add-on for access to GPIO interface from kernel. Some libraries also need `/dev/mem` and `SYS_RAWIO` for read/write access to this device. On systems with AppArmor enabled, you need to disable AppArmor or provide you own profile for the add-on, which is better for security. | usb | bool | no | If this is set to `true`, it would map the raw USB access `/dev/bus/usb` into add-on with plug&play support. +| uart | bool | no | Default `false`. Auto mapping all UART/serial devices from the host into the add-on. +| udev | bool | no | Default `false`. Set this `true`, gets the host udev database read-only mounted into the add-on. | devicetree | bool | no | Boolean. If this is set to True, `/device-tree` will map into add-on. | kernel_modules | bool | no | Map host kernel modules and config into add-on (readonly). | stdin | bool | no | Boolean. If enabled, you can use the STDIN with Home Assistant API. @@ -212,6 +212,7 @@ We support: - `port` - `match(REGEX)` - `list(val1|val2|...)` +- `device` / `device(filter)`: Device filter can be following format: `subsystem=TYPE` i.e. `subsystem=tty` for serial devices. ## Add-on extended build diff --git a/docs/api/supervisor/endpoints.md b/docs/api/supervisor/endpoints.md index cbf2b45e..2a622227 100644 --- a/docs/api/supervisor/endpoints.md +++ b/docs/api/supervisor/endpoints.md @@ -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) | + @@ -1132,9 +1136,6 @@ Get audio devices - -Trigger UDEV reload. - ### Host diff --git a/docs/api/supervisor/models.md b/docs/api/supervisor/models.md index 41952855..928759c6 100644 --- a/docs/api/supervisor/models.md +++ b/docs/api/supervisor/models.md @@ -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 |