Skip to content

Added documentation for smarla integration #38551

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

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

rlint-explicatis
Copy link

@rlint-explicatis rlint-explicatis commented Apr 15, 2025

Proposed change

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

  • Documentation
    • Added new documentation for the Swing2Sleep Smarla integration, detailing setup instructions, requirements, and available controls within Home Assistant.

@home-assistant home-assistant bot added in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch labels Apr 15, 2025
@home-assistant
Copy link

It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the current branch. Please change the target branch of this PR to current and rebase if needed. If this is documentation for a new feature, please add a link to that PR in your description.

@home-assistant home-assistant bot added the has-parent This PR has a parent PR in a other repo label Apr 15, 2025
Copy link

netlify bot commented Apr 15, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 81f1522
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/680a2b275b0c2a000809d4d2
😎 Deploy Preview https://deploy-preview-38551--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@home-assistant home-assistant bot removed the needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch label Apr 16, 2025
@rlint-explicatis rlint-explicatis marked this pull request as ready for review April 16, 2025 12:14
Copy link
Contributor

coderabbitai bot commented Apr 16, 2025

📝 Walkthrough

Walkthrough

A new documentation file has been introduced for the "smarla" integration, which enables Home Assistant to control Swing2Sleep Smarla motorized cradles. The document details integration metadata, requirements, registration steps, and descriptions of supported entity platforms such as switch entities. It also provides step-by-step instructions for connecting the device, generating an access token, and configuring the integration within Home Assistant.

Changes

File(s) Change Summary
source/_integrations/smarla.markdown Added new documentation for the "smarla" integration, including metadata, requirements, setup instructions, and entity platform descriptions (switch).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SmarlaDevice
    participant Swing2SleepApp
    participant HomeAssistant

    User->>SmarlaDevice: Connect to Wi-Fi
    User->>Swing2SleepApp: Open app and generate access token
    Swing2SleepApp-->>User: Display access token
    User->>HomeAssistant: Add Smarla integration and enter token
    HomeAssistant->>SmarlaDevice: Establish connection via cloud
    HomeAssistant->>User: Setup switch entities (oscillation, smartmode)
Loading

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e52d65 and 81f1522.

📒 Files selected for processing (1)
  • source/_integrations/smarla.markdown (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • source/_integrations/smarla.markdown
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@c0ffeeca7 c0ffeeca7 added the new-integration This PR adds documentation for a new Home Assistant integration label Apr 17, 2025
Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (3)
source/_integrations/smarla.markdown (3)

18-19: Refine introduction phrasing.
Consider rewording to avoid repeating “integration”:
“The smarla integration enables Home Assistant to control Swing2Sleep motorized cradles.”


20-25: Unify bullet punctuation in Requirements.
Some list items end with a period, others don’t. For consistency, either add a period to “- Internet connectivity” or remove periods from all bullets.


26-33: Polish Registration steps formatting.

  • Ensure each numbered step ends with a period.
  • Change “Connect the device with your Wi‑Fi” to “Connect the device to your Wi‑Fi network.”
  • Add a trailing period to step 3 (“…until the access token field appears.”).
    These edits will improve consistency and clarity.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~31-~31: Possible missing preposition found.
Context: ...until the access token field appears 4. Generate an access token in the Swing2Sleep App ...

(AI_HYDRA_LEO_MISSING_TO)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b478fa1 and 3576987.

📒 Files selected for processing (1)
  • source/_integrations/smarla.markdown (1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/smarla.markdown

[uncategorized] ~31-~31: Possible missing preposition found.
Context: ...until the access token field appears 4. Generate an access token in the Swing2Sleep App ...

(AI_HYDRA_LEO_MISSING_TO)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (4)
source/_integrations/smarla.markdown (4)

1-16: Verify front matter metadata and featured flag.
The integration’s YAML header is well‑structured, but please confirm whether featured: true is appropriate for a new integration (this flag highlights the integration on the docs homepage). If the integration shouldn’t be featured immediately, consider removing or toggling this field. Also verify that ha_domain: smarla and ha_integration_type: device match the corresponding settings in the core PR (home-assistant/core#143081).


34-34: Include configuration flow snippet.
The {% include integrations/config_flow.md %} directive correctly pulls in the standard setup instructions.


36-39: Entities section header is accurate.
The heading and introductory sentence clearly describe the entities created by this integration.


40-43: Table formatting looks good.
The table for cradle and smartmode switch entities is properly aligned and descriptive.

Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (3)
source/_integrations/smarla.markdown (3)

18-18: Avoid repetition in intro sentence.
The phrase “integration to integrate” is redundant. Consider rephrasing to:

The smarla {% term integration %} allows you to control your Swing2Sleep device.


30-30: Add missing punctuation for consistency.
Step 3 is missing a period at the end. For consistency with other steps, please add a trailing period:

-3. Follow the steps for **Configuration** until the access token field appears
+3. Follow the steps for **Configuration** until the access token field appears.

31-31: Clarify “under settings” phrasing.
The wording “in the Swing2Sleep App under settings” may be unclear. Consider:

-4. Generate an access token in the Swing2Sleep App under settings.
+4. Generate an access token in the Swing2Sleep App’s Settings menu.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~31-~31: Possible missing preposition found.
Context: ...until the access token field appears 4. Generate an access token in the Swing2Sleep App ...

(AI_HYDRA_LEO_MISSING_TO)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3576987 and 91e826b.

📒 Files selected for processing (1)
  • source/_integrations/smarla.markdown (1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/smarla.markdown

[uncategorized] ~31-~31: Possible missing preposition found.
Context: ...until the access token field appears 4. Generate an access token in the Swing2Sleep App ...

(AI_HYDRA_LEO_MISSING_TO)

🔇 Additional comments (1)
source/_integrations/smarla.markdown (1)

8-8: Verify release version aligns with core PR.
The ha_release value '2025.5.0' should match the version introduced by the corresponding core integration PR (143081). Please confirm this version is correct for the next release.

Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (4)
source/_integrations/smarla.markdown (4)

18-19: Refine the integration description for clarity

The phrase “is the main integration to integrate” is redundant. Consider a concise rewrite:

-The `smarla` {% term integration %} is the main integration to integrate [Swing2Sleep](https://swing2sleep.de) (Smarla) motorized cradles.
+The `smarla` {% term integration %} enables Home Assistant to control [Swing2Sleep Smarla](https://swing2sleep.de) motorized cradles.

22-25: Standardize requirement versions and phrasing

Unify version formatting and simplify wording:

- Swing2Sleep Smarla device with Version 1.6.X or greater.
+ Swing2Sleep Smarla device with version 1.6.x or later.
- Internet connectivity.
+ Internet access.

28-33: Improve step descriptions in Registration

Clarify network actions and UI labels for consistency:

- 2. Connect the device with your Wi-Fi.
+ 2. Connect the device to your Wi-Fi network.
- 4. Generate an access token in the Swing2Sleep app under settings.
+ 4. In the Swing2Sleep app, generate an access token under **Settings**.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~31-~31: Possible missing preposition found.
Context: ...until the access token field appears 4. Generate an access token in the Swing2Sleep app ...

(AI_HYDRA_LEO_MISSING_TO)


40-43: Style: use sentence case in entity descriptions

For consistency with other integration docs, apply sentence casing:

-| `cradle`       | `switch` | Turn `On` or `Off` the oscillation of the cradle. |
+| `cradle`       | `switch` | Turn on or off the cradle’s oscillation. |
-| `smartmode`    | `switch` | Turn `On` or `Off` automatic control of the intensity. |
+| `smartmode`    | `switch` | Enable or disable automatic intensity control. |
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91e826b and 3e52d65.

📒 Files selected for processing (1)
  • source/_integrations/smarla.markdown (1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/smarla.markdown

[uncategorized] ~31-~31: Possible missing preposition found.
Context: ...until the access token field appears 4. Generate an access token in the Swing2Sleep app ...

(AI_HYDRA_LEO_MISSING_TO)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (2)
source/_integrations/smarla.markdown (2)

34-34: Validate include path for configuration flow

Ensure the include directive matches the actual file path in the docs:

  • Verify that integrations/config_flow.md exists at source/_integrations/ or adjust the path accordingly.

1-16:

❓ Verification inconclusive

Verify frontmatter metadata for compliance with HA schema

The frontmatter keys and values should align with Home Assistant’s documentation standards:

  • Confirm ha_category uses the exact identifier expected (e.g., switch vs Switch).
  • Validate ha_iot_class – official docs use snake_case (cloud_push) rather than title case.
  • Double‑check that ha_integration_type: device is a supported type.

Run this snippet to inspect the official schema in the docs repo:


🏁 Script executed:

#!/bin/bash
# Locate frontmatter definitions
rg -R "ha_category:" -A 3 source/

Length of output: 438


To get a broader view of how these keys are used across all integrations, let’s pull the actual values from other frontmatter files:


🏁 Script executed:

#!/bin/bash
# List ha_category values in all integration docs
rg 'ha_category:' -n source/_integrations

# List ha_iot_class values in all integration docs
rg 'ha_iot_class:' -n source/_integrations

# List ha_integration_type values in all integration docs
rg 'ha_integration_type:' -n source/_integrations

Length of output: 68503


Verify frontmatter metadata for compliance with HA schema

I wasn’t able to find examples of ha_iot_class or ha_integration_type in other integration docs—please confirm these fields match the official frontmatter spec:

  • ha_category
    – Should use the exact identifier (e.g. - switch rather than - Switch).
  • ha_iot_class
    – Must be snake_case (cloud_push), not title case.
  • ha_integration_type
    – This key is uncommon in existing docs—double‑check that device is a supported type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-parent This PR has a parent PR in a other repo in-progress This PR/Issue is currently being worked on new-integration This PR adds documentation for a new Home Assistant integration next This PR goes into the next branch
Projects
No open projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants