Skip to content

Conversation

@jbouwh
Copy link
Contributor

@jbouwh jbouwh commented Oct 25, 2025

Proposed change

Add support for service action description placeholders

An example is added via the Core PR using the Kitchen Sink integration.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Setup Kitchen sink to validate the PR with action kitchen_sink.test_service_1

...  
  "services": {
    "test_service_1": {
      "name": "Test action {meep_1}",
      "description": "Fake action for testing {meep_2}",
      "fields": {
        "field_1": {
          "name": "Field 1 {meep_3}",
          "description": "Number of seconds {meep_4}",
          "example": "Example: {meep_5}"
        },
        "field_2": {
          "name": "Field 2",
          "description": "Mode",
          "example": "Field 2 example"
        },
        "field_3": {
          "name": "Field 3",
          "description": "Number of hours"
        },
        "field_4": {
          "name": "Field 4",
          "description": "Direction"
        }
      },
      "sections": {
        "advanced_fields": {
          "name": "Advanced options",
          "description": "Some very advanced things"
        }
      }
    }
  }
...

Service definition:

    hass.services.async_register(
        DOMAIN,
        "test_service_1",
        service_handler,
        SCHEMA_SERVICE_TEST_SERVICE_1,
        description_placeholders={
            "meep_1": "foo",
            "meep_2": "bar",
            "meep_3": "beer",
            "meep_4": "milk",
            "meep_5": "https://example.com",
        },
    )

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@karwosts
Copy link
Member

Examples are not show (Img1). Might be a bug.

Examples are only shown in yaml mode, in the little table under the editor. Also used when clicking Fill example data.

@karwosts
Copy link
Member

karwosts commented Oct 25, 2025

I believe #27640 will fix what you describe as pre-existing bug #​1/#​2

@jbouwh jbouwh force-pushed the service-action-description-placeholders branch from 292fce5 to fb817ff Compare October 27, 2025 13:35
@jbouwh
Copy link
Contributor Author

jbouwh commented Oct 27, 2025

Core PR and JS-API PR were approved

@jbouwh
Copy link
Contributor Author

jbouwh commented Oct 27, 2025

I believe #27640 will fix what you describe as pre-existing bug #​1/#​2

Rebased. Issues are resolved. This PR needs a review.

@jbouwh jbouwh marked this pull request as ready for review October 27, 2025 17:43
@jbouwh jbouwh requested a review from karwosts October 30, 2025 16:22
@jbouwh
Copy link
Contributor Author

jbouwh commented Nov 4, 2025

@karwosts what is the next step here? As the Core and JS-API changes are approved, should we finish the review here first? The linter errors will remain till the JS-API PR as been merged. Let me know what I can do.

@karwosts
Copy link
Member

karwosts commented Nov 4, 2025

Sorry I'd say that's above my pay grade 😅 . I will let the main maintainers decide how and when to merge this.

@bramkragten bramkragten self-assigned this Nov 4, 2025
@jbouwh jbouwh force-pushed the service-action-description-placeholders branch from 98859db to 02e3589 Compare November 6, 2025 16:38
@silamon
Copy link
Contributor

silamon commented Nov 23, 2025

To make it more easy to verify and test: Set up the package.json to use a git:
"home-assistant-js-websocket": "git+https://github.com/home-assistant/home-assistant-js-websocket#master"

Also consider to resolve the merge conflicts.

@frenck
Copy link
Member

frenck commented Nov 23, 2025

I've removed the wait for backend label, this feature is awaiting the frontend work. Backend has been approved.

@jbouwh jbouwh force-pushed the service-action-description-placeholders branch from 02e3589 to 84cf4ea Compare November 23, 2025 15:04
@jbouwh
Copy link
Contributor Author

jbouwh commented Nov 23, 2025

To make it more easy to verify and test: Set up the package.json to use a git: "home-assistant-js-websocket": "git+https://github.com/home-assistant/home-assistant-js-websocket#master"

Also consider to resolve the merge conflicts.

Merge conflicts were resolved. The js-websockey API needs a release so that it can be be bumped here.

@bramkragten
Copy link
Member

Released 9.6.0

@jbouwh
Copy link
Contributor Author

jbouwh commented Nov 24, 2025

Released 9.6.0

#28091

@silamon silamon removed the help-wanted In need of Additional Help label Nov 24, 2025
@silamon
Copy link
Contributor

silamon commented Nov 24, 2025

Based on your example: There's still an issue around https://github.com/jbouwh/frontend/blob/21b9e4f96b354db18288734b00f782b4be30372d/src/panels/config/automation/sidebar/ha-automation-sidebar-action.ts#L96-L100
where the title doesn't have description placeholders.

I'm a bit under the impression that we do show and need to handle the description placeholders on so many places.

@jbouwh
Copy link
Contributor Author

jbouwh commented Nov 24, 2025

Based on your example: There's still an issue around https://github.com/jbouwh/frontend/blob/21b9e4f96b354db18288734b00f782b4be30372d/src/panels/config/automation/sidebar/ha-automation-sidebar-action.ts#L96-L100 where the title doesn't have description placeholders.

I'm a bit under the impression that we do show and need to handle the description placeholders on so many places.

It seems this was added recently. I've added description placeholders.

@bramkragten bramkragten merged commit ae3a405 into home-assistant:dev Nov 26, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants