mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-06-16 15:16:30 +00:00
New hardware layer Supervisor (#784)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
This commit is contained in:
parent
6ebc02f268
commit
381dcda224
@ -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: `<path_on_host>:<path_in_container>:<cgroup_permissions>`. 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: `<path_on_host>`. 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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 |
|
||||
|
Loading…
x
Reference in New Issue
Block a user