-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update application_credentials example with redirect_url #2547
Conversation
📝 WalkthroughWalkthroughThe documentation for "Application Credentials" in Home Assistant has been updated to provide more detailed guidance on implementing OAuth2 credentials. The changes focus on improving the description of the credentials setup process, introducing a new method to dynamically retrieve redirect URIs, and ensuring proper formatting of existing documentation. Changes
Sequence DiagramsequenceDiagram
participant Hass as Home Assistant
participant Credentials as Application Credentials
participant OAuth2 as OAuth2 Flow
Credentials->>OAuth2: async_get_redirect_uri(hass)
OAuth2-->>Credentials: Return Redirect URI
Credentials->>Credentials: Generate Description Placeholders
Credentials-->>Hass: Provide Credentials Dialog Information
The sequence diagram illustrates how the new Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/core/platform/application_credentials.md (1)
144-150
: Add docstring parameters and return type documentation.While the example is clear, it would be helpful to document the return value format and any potential exceptions. Consider adding:
async def async_get_description_placeholders(hass: HomeAssistant) -> dict[str, str]: - """Return description placeholders for the credentials dialog.""" + """Return description placeholders for the credentials dialog. + + Args: + hass: The HomeAssistant instance. + + Returns: + A dictionary containing placeholders used in the credentials dialog: + - console_url: The URL to the developer console + - redirect_url: The OAuth redirect URI for the instance + """
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/core/platform/application_credentials.md
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - developers-home-assistant
- GitHub Check: Header rules - developers-home-assistant
- GitHub Check: Pages changed - developers-home-assistant
🔇 Additional comments (3)
docs/core/platform/application_credentials.md (3)
135-135
: LGTM! Clear and helpful addition to the description.The addition of
{redirect_url}
placeholder improves the user experience by explicitly showing where to add the redirect URI in their OAuth setup.
154-154
: LGTM! Improved formatting.The added newline enhances readability of the development note.
144-150
: Verify consistency with core PR #136906.Let's ensure the documented method signature and implementation align with the core changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…)" This reverts commit 36e526f.
Proposed change
Update the docs example with the new function being added in home-assistant/core#136906
Type of change
Additional information
Summary by CodeRabbit
description
field and redirect URI setup