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.

@jbouwh jbouwh force-pushed the service-action-description-placeholders branch from 98859db to 02e3589 Compare November 6, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants