Skip to content

Feature/rest command config entries - #179693

Draft
rioncm wants to merge 2 commits into
home-assistant:devfrom
rioncm:feature/rest-command-config-entries
Draft

Feature/rest command config entries#179693
rioncm wants to merge 2 commits into
home-assistant:devfrom
rioncm:feature/rest-command-config-entries

Conversation

@rioncm

@rioncm rioncm commented Aug 21, 2026

Copy link
Copy Markdown

Breaking change

Proposed change

RESTful Command currently requires YAML configuration, even for static outbound HTTP endpoints. This change adds config-entry support so endpoints can be configured through the Home Assistant UI.

Each config entry represents one endpoint and supports:

  • GET, PATCH, POST, PUT, and DELETE requests
  • Basic, Digest, and Bearer authentication
  • A default payload and content type
  • Per-call payload overrides
  • Timeout, certificate verification, legacy cipher, and URL-encoding settings
  • Optional action responses containing the status, content, and response headers

UI-managed endpoints are called through the rest_command.call_endpoint action. YAML-defined commands and YAML reload behavior remain supported.

For backward compatibility, an existing YAML command named call_endpoint takes precedence. UI-managed endpoints become available through that action after the conflicting YAML command is renamed and RESTful Command is reloaded.

YAML and UI-managed endpoints share the same HTTP execution path. Request logs and translated errors no longer expose rendered URLs, credentials, payloads, or low-level exception details.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • [] Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@rioncm
rioncm requested a review from jpbede as a code owner August 21, 2026 00:47
Copilot AI balanced review requested due to automatic review settings August 21, 2026 00:47
@home-assistant home-assistant Bot added cla-needed config-flow This integration migrates to the UI by adding a config flow has-tests integration: rest_command new-feature Top 100 Integration is ranked within the top 100 by usage labels Aug 21, 2026

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rioncm

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant Bot added the Top 200 Integration is ranked within the top 200 by usage label Aug 21, 2026
@home-assistant
home-assistant Bot marked this pull request as draft August 21, 2026 00:47
@home-assistant

Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant

Copy link
Copy Markdown
Contributor

Hey there @jpbede, mind taking a look at this pull request as it has been labeled with an integration (rest_command) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of rest_command can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign rest_command Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds UI-managed RESTful Command endpoints while preserving YAML-defined commands and sharing HTTP execution logic.

Changes:

  • Adds config flows and authentication options.
  • Introduces rest_command.call_endpoint.
  • Redacts sensitive request details and expands tests.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
homeassistant/components/rest_command/__init__.py Integrates config entries and shared request handling.
homeassistant/components/rest_command/config_flow.py Implements setup and reconfiguration flows.
homeassistant/components/rest_command/const.py Defines shared constants and defaults.
homeassistant/components/rest_command/http.py Centralizes HTTP execution and errors.
homeassistant/components/rest_command/icons.json Adds the endpoint action icon.
homeassistant/components/rest_command/manifest.json Enables config flows and service classification.
homeassistant/components/rest_command/services.yaml Defines the endpoint action fields.
homeassistant/components/rest_command/strings.json Adds UI text, selectors, and revised errors.
homeassistant/generated/config_flows.py Registers the generated config flow.
homeassistant/generated/integrations.json Updates generated integration metadata.
tests/components/rest_command/test_config_flow.py Tests setup, validation, and reconfiguration.
tests/components/rest_command/test_init.py Tests endpoint execution, authentication, reloads, and redaction.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


ENDPOINT_SCHEMA = vol.Schema(
{
vol.Required(CONF_ENDPOINT_NAME): TextSelector(),
Comment on lines +1 to +7
call_endpoint:
fields:
config_entry_id:
required: true
selector:
config_entry:
integration: rest_command
"domain": "rest_command",
"name": "RESTful Command",
"codeowners": ["@jpbede"],
"config_flow": true,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-needed config-flow This integration migrates to the UI by adding a config flow has-tests integration: rest_command new-feature Quality Scale: No score Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants