Skip to content

Update creating_component_index.md#3055

Draft
PaulDGAL wants to merge 2 commits intohome-assistant:masterfrom
PaulDGAL:patch-3
Draft

Update creating_component_index.md#3055
PaulDGAL wants to merge 2 commits intohome-assistant:masterfrom
PaulDGAL:patch-3

Conversation

@PaulDGAL
Copy link
Copy Markdown

@PaulDGAL PaulDGAL commented Apr 16, 2026

Using the hyphen causes issues that are not obvious with most sensors, etc., but will prevent services operating.

Proposed change

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

Summary by CodeRabbit

Release Notes

  • Documentation
    • Updated Home Assistant integration documentation to clarify the DOMAIN constant requirements, specifying that only alphabetic characters and underscores are permitted, with hyphens explicitly not allowed.

Including the hyphen is an easy error that may not show up in testing but prevents any services in the integration operating.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

Documentation clarification for Home Assistant integration scaffolding requirements. The DOMAIN constant description now explicitly specifies that only alphabetic characters and underscores are allowed, with hyphens explicitly disallowed.

Changes

Cohort / File(s) Summary
Documentation Update
docs/creating_component_index.md
Clarified DOMAIN constant constraints to explicitly prohibit hyphens and restrict to alphabetic characters and underscores.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using 'Update' without specifying what aspect of the file was changed or why it matters. Revise the title to be more specific, such as 'Document that hyphens are not allowed in component DOMAIN names' to clearly convey the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description includes context about why the change matters and follows the template structure with appropriate checkboxes selected, but lacks a clear 'Proposed change' section explaining the specific documentation update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/creating_component_index.md (1)

19-19: Excellent clarification on the hyphen restriction.

The addition explicitly warns developers about hyphen usage, which aligns with preventing service operation issues. The technical content is accurate and addresses an important constraint.

Optional: Consider refining the grammar for improved readability.

The phrase "alphabetic and the underscore characters" is slightly awkward. Consider rephrasing for clarity:

📝 Optional grammar refinement
-The scaffold integration contains a bit more than just the bare minimum. The minimum is that you define a `DOMAIN` constant (which can consist of alphabetic and the underscore characters, the hyphen is not allowed) that contains the domain of the integration. The second part is that it needs to define a setup method that returns a boolean if the set-up was successful.
+The scaffold integration contains a bit more than just the bare minimum. The minimum is that you define a `DOMAIN` constant (which can consist of alphabetic characters and underscores; hyphens are not allowed) that contains the domain of the integration. The second part is that it needs to define a setup method that returns a boolean if the set-up was successful.

As per coding guidelines, the DOMAIN should be constrained to alphabetic characters and underscores only, with hyphens explicitly disallowed to prevent breaking integration/service operation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/creating_component_index.md` at line 19, Rephrase the awkward sentence
describing allowed characters for the DOMAIN constant to improve clarity: update
the sentence that currently reads "alphabetic and the underscore characters" to
something like "alphabetic characters and underscores only" and ensure the
paragraph still states that hyphens are disallowed; reference the DOMAIN
constant and the setup method so it's clear this applies to the DOMAIN
definition and the required setup() return boolean behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/creating_component_index.md`:
- Line 19: Rephrase the awkward sentence describing allowed characters for the
DOMAIN constant to improve clarity: update the sentence that currently reads
"alphabetic and the underscore characters" to something like "alphabetic
characters and underscores only" and ensure the paragraph still states that
hyphens are disallowed; reference the DOMAIN constant and the setup method so
it's clear this applies to the DOMAIN definition and the required setup() return
boolean behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c9dd877-3b4f-4c55-a65a-84831b92abd2

📥 Commits

Reviewing files that changed from the base of the PR and between f636d59 and b24c9ad.

📒 Files selected for processing (1)
  • docs/creating_component_index.md

## The minimum

The scaffold integration contains a bit more than just the bare minimum. The minimum is that you define a `DOMAIN` constant that contains the domain of the integration. The second part is that it needs to define a setup method that returns a boolean if the set-up was successful.
The scaffold integration contains a bit more than just the bare minimum. The minimum is that you define a `DOMAIN` constant (which can consist of alphabetic and the underscore characters, the hyphen is not allowed) that contains the domain of the integration. The second part is that it needs to define a setup method that returns a boolean if the set-up was successful.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This text is outdated as we no longer require a DOMAIN constant at all.

Side note: Details like what characters are allowed in the domain name do not belong in this introductory text. It should be part of the page where we talk about the file structure of an integration.

@home-assistant home-assistant bot marked this pull request as draft April 16, 2026 08:47
@home-assistant
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants