From a5662c16088622e2b0f4995fab0c0eb445d77de9 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 29 Aug 2024 08:12:29 +0200 Subject: [PATCH] Improve documentation of collapsible sections in service actions (#2294) * Improve documentation of collapsible sections in service actions * Improve grammar * Address review comments --- docs/dev_101_services.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/dev_101_services.md b/docs/dev_101_services.md index b49d350c..3e9df2f3 100644 --- a/docs/dev_101_services.md +++ b/docs/dev_101_services.md @@ -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.