Skip to content

Conversation

@wlcrs
Copy link
Contributor

@wlcrs wlcrs commented Oct 23, 2025

Proposed change

The indentation of the hass.services.async_register call was wrong in this example.

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

  • Documentation
    • Updated service registration documentation to reflect changes in setup scope organization.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2025

📝 Walkthrough

Walkthrough

Documentation file updated to relocate the search_items service registration call from a nested inner scope to the outer async_setup_entry scope within the code example, while preserving parameters and behavior.

Changes

Cohort / File(s) Summary
Documentation Example Restructuring
docs/dev_101_services.md
Repositioned service registration call from inner nested block to outer async_setup_entry scope in the code example; no functional logic changes

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Fix indentation of async_register call for search_items service" directly and accurately describes the main change in the changeset. According to the raw summary, the change involves correcting the indentation of the registration call for the search_items service from an inner scope to the outer async_setup_entry scope. The title is concise, specific, and free of vague terminology or noise, making it clear to reviewers what the change addresses.
Description Check ✅ Passed The pull request description contains all required sections from the template: the Proposed change section explains that indentation was incorrect in the example, the Type of change section has been completed with "Spelling or grammatical corrections, or rewording for improved clarity" selected, and the Checklist and Additional information sections are present. However, the checklist verification items are not marked as completed, suggesting the author did not verify they followed the documentation guidelines or tested their changes, and the Additional information section lacks specific issue references and links to related code.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 39bb544 and 1a3cc4d.

📒 Files selected for processing (1)
  • docs/dev_101_services.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
*/**(html|markdown|md)

⚙️ CodeRabbit configuration file

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

  • Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

  • Use sentence-style capitalization also in headings.

do not comment on HTML used for icons

Avoid flagging inline HTML for embedding videos in future reviews for this repository.

Files:

  • docs/dev_101_services.md
🔇 Additional comments (1)
docs/dev_101_services.md (1)

312-334: The indentation fix correctly relocates service registration to the setup scope.

This change properly moves the async_register call from inside the search_items handler function to the outer async_setup_entry scope. Service registration must occur during setup, not within the handler itself, and the handler is passed as a callback parameter—not executed during registration. The corrected indentation now aligns with the documented best practice stated earlier: "Register services in the integration's async_setup or setup function, not in the integration's async_setup_entry" (with entity services being an exception). The example code is now internally consistent and demonstrates the correct pattern.


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
Member

@abmantis abmantis left a comment

Choose a reason for hiding this comment

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

Thanks!

@abmantis abmantis merged commit 1d8938e into home-assistant:master Oct 23, 2025
5 checks passed
@wlcrs wlcrs deleted the patch-1 branch October 23, 2025 19:29
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.

2 participants