Skip to content

Conversation

@mishmanners
Copy link
Contributor

Proposed change

Move URL out of strings.json to avoid making it translatable.

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 link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Updated the description for the push_weather_data service to include a placeholder for the API URL.
Add description placeholders for API URL in user form.
Removed unnecessary description placeholders from the form display.
Updated the description for the 'push_weather_data' service to include a link to the RainMachine API documentation.
Copilot AI review requested due to automatic review settings October 28, 2025 03:17
@mishmanners mishmanners requested a review from a team as a code owner October 28, 2025 03:17
@home-assistant
Copy link

Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zwave_js can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign zwave_js Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR moves Z-Wave API documentation URLs out of translatable strings in strings.json and into description placeholders in the config flow. This prevents the URLs from being unnecessarily translated while maintaining the same user-facing functionality.

Key changes:

  • Replaced hardcoded URLs in strings.json with placeholder variables {api_method} and {api_paramaters}
  • Added URL values to description placeholders in the config flow's async_step_manual method

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
homeassistant/components/zwave_js/strings.json Replaced hardcoded documentation URLs with placeholder variables in method and parameter descriptions
homeassistant/components/zwave_js/config_flow.py Added URL values for api_method and api_paramaters placeholders in description_placeholders dictionary

Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

Not quite, you're updating the config flow placeholders, but the strings are from the services, this integration requires #154984

@home-assistant
Copy link

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 home-assistant bot marked this pull request as draft October 28, 2025 06:31
Add API documentation links as description placeholders.
@mishmanners
Copy link
Contributor Author

I think I added in the correct services... please let me know.

@mishmanners mishmanners marked this pull request as ready for review October 28, 2025 07:19
@home-assistant home-assistant bot requested a review from joostlek October 28, 2025 07:19
Copy link
Member

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

Just to clarify: These are URLs used in Home Assistant action services. At the moment, there's no way to use description placeholders in them.

Other integrations mostly used URLs in config flows where it is already possible to use description placeholders to fix the issue with the URLs being in the tranlsations.

Like Joost mentioned, we'll need to wait for #154984 to be merged. Then, we can use a similar implementation to the kitchen_sink integration example used in that PR for Z-Wave.

@home-assistant home-assistant bot marked this pull request as draft October 28, 2025 12:32
@mishmanners mishmanners marked this pull request as ready for review October 29, 2025 03:07
@home-assistant home-assistant bot requested a review from TheJulianJES October 29, 2025 03:07
@epenet epenet marked this pull request as draft October 29, 2025 10:13
Added a list of ignored USB devices to prevent them from appearing in serial port selection.
Added API placeholders for documentation links.
Added description placeholders for API method and parameters in the configuration forms.
@mishmanners
Copy link
Contributor Author

@zweckj any chance I can get some eyes on this. Looks like it failed when I merged the dev branch in...

@zweckj
Copy link
Member

zweckj commented Oct 31, 2025

Please don't ping people, it's considered impolite. You'll need to set up a proper dev environment (e.g. devcontainer) and make sure the pre-commit hooks are passing. It's currently incorrectly formatted (it always was but nobody ran the pipeline I assume)

Comment on lines +60 to +63
API_PLACEHOLDERS = {
"api_method": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
"api_parameters": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
API_PLACEHOLDERS = {
"api_method": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
"api_parameters": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
}

Remove this lines, and only add one placeholder for api_url (URLs are the same), here:

self._hass.services.async_register(
const.DOMAIN,
const.SERVICE_INVOKE_CC_API,
self.async_invoke_cc_api,
schema=vol.Schema(
vol.All(
{
**TARGET_VALIDATORS,
vol.Required(const.ATTR_COMMAND_CLASS): vol.All(
vol.Coerce(int), vol.Coerce(CommandClass)
),
vol.Optional(const.ATTR_ENDPOINT): vol.Coerce(int),
vol.Required(const.ATTR_METHOD_NAME): cv.string,
vol.Required(const.ATTR_PARAMETERS): list,
},
cv.has_at_least_one_key(
ATTR_DEVICE_ID, ATTR_ENTITY_ID, ATTR_AREA_ID
),
get_nodes_from_service_data,
has_at_least_one_node,
),
),
)

Comment on lines +136 to +138
API_PLACEHOLDERS = {
"api_parameters": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
API_PLACEHOLDERS = {
"api_parameters": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
}

Not needed as this is not used in the config flow, only for a service action.

return self.async_show_form(
step_id="rf_region",
data_schema=schema,
description_placeholders=API_PLACEHOLDERS,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description_placeholders=API_PLACEHOLDERS,

Comment on lines +933 to +937
step_id="configure_security_keys",
data_schema=data_schema,
description_placeholders={
"api_method": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
step_id="configure_security_keys",
data_schema=data_schema,
description_placeholders={
"api_method": "https://zwave-js.github.io/node-zwave-js/#/api/CCs/index",
},
step_id="configure_security_keys", data_schema=data_schema

},
"method_name": {
"description": "The name of the API method to call. Refer to the Z-Wave Command Class API documentation (https://zwave-js.github.io/node-zwave-js/#/api/CCs/index) for available methods.",
"description": "The name of the API method to call. Refer to the Z-Wave Command Class API documentation {api_method} for available methods.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description": "The name of the API method to call. Refer to the Z-Wave Command Class API documentation {api_method} for available methods.",
"description": "The name of the API method to call. Refer to the Z-Wave Command Class API documentation {api_url} for available methods.",

},
"parameters": {
"description": "A list of parameters to pass to the API method. Refer to the Z-Wave Command Class API documentation (https://zwave-js.github.io/node-zwave-js/#/api/CCs/index) for parameters.",
"description": "A list of parameters to pass to the API method. Refer to the Z-Wave Command Class API documentation {api_parameters} for parameters.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description": "A list of parameters to pass to the API method. Refer to the Z-Wave Command Class API documentation {api_parameters} for parameters.",
"description": "A list of parameters to pass to the API method. Refer to the Z-Wave Command Class API documentation {api_url} for parameters.",

@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants