Improve documentation of collapsible sections in service actions (#2294)

* Improve documentation of collapsible sections in service actions

* Improve grammar

* Address review comments
This commit is contained in:
Erik Montnemery 2024-08-29 08:12:29 +02:00 committed by GitHub
parent 120a8cc5c1
commit a5662c1608
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,6 +68,8 @@ Adding actions is only useful if users know about them. In Home Assistant we use
Actions are published under the domain name of your integration, so in `services.yaml` we only use the service action name as the base key.
### Service action description example
```yaml
# Example services.yaml entry
@ -138,6 +140,16 @@ set_speed:
The name and description of the service actions are set in our [translations](/docs/internationalization/core#services) and not in the service action description. Each service action and service action field must have a matching translation defined.
:::
### Grouping of service action fields
Input fields can be visually grouped in sections. Grouping input fields by sections influences
only how the inputs are displayed to the user, and not how service action data is structured.
In the [service action description example](#service-action-description-example), the `speed_pct`
input field is inside an initially collapsed section `advanced_fields`.
The service action data for the service in the example is `{"speed_pct": 50}`, not
`{"advanced_fields": {"speed_pct": 50}}`.
### Filtering service action fields
In some cases, entities from a action's domain may not support all service action fields.