Skip to content

Improve docs readability and adjust incorrect information for switchbot integration #39701

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

Merged

Conversation

zerzhang
Copy link
Contributor

@zerzhang zerzhang commented Jun 25, 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

  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue: fixes #

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 details on forcing Nightlatch operation mode for Lock devices via the UI.
    • Clarified differences between Battery Circulator Fan and Circulator Fan, including battery level support.
    • Expanded Vacuum device features and clarified available states and limitations.
    • Added explanation of battery level reporting behavior for early Lock models.
    • Included information on vacuum state limitations for specific robot vacuum models.
    • Improved formatting and wording for better clarity and consistency.

@zerzhang zerzhang requested a review from Danielhiversen as a code owner June 25, 2025 06:22
@home-assistant home-assistant bot added the current This PR goes into the current branch label Jun 25, 2025
Copy link

netlify bot commented Jun 25, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 0a13739
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/685bfc278d82d9000866dc57
😎 Deploy Preview https://deploy-preview-39701--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 project configuration.

Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

📝 Walkthrough

Walkthrough

The documentation for the SwitchBot integration was updated to clarify device features and behaviors. New sections detail options for lock operation modes, distinctions between Circulator Fan models, expanded vacuum device states, and battery level reporting specifics. Minor formatting and wording changes were also made for clarity and consistency.

Changes

File Change Summary
source/_integrations/switchbot.markdown Added options for lock devices, clarified Circulator Fan types, expanded vacuum states, explained battery reporting, and made minor formatting updates.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeAssistantUI
    participant SwitchBotDevice

    User->>HomeAssistantUI: Selects lock operation option (e.g., Nightlatch)
    HomeAssistantUI->>SwitchBotDevice: Sends command with selected option
    SwitchBotDevice-->>HomeAssistantUI: Performs operation and returns status

    User->>HomeAssistantUI: Checks Circulator Fan or Vacuum status
    HomeAssistantUI->>SwitchBotDevice: Requests device state
    SwitchBotDevice-->>HomeAssistantUI: Returns detailed state (e.g., battery, cleaning state)
Loading

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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.

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

♻️ Duplicate comments (1)
source/_integrations/switchbot.markdown (1)

447-450: Apply the same heading & spacing fixes as for previous lock types

Replicate the adjustments suggested for lines 413-416 and 429-433 to keep rendering uniform across Lock / Lock Pro / Lock Ultra sections.

🧹 Nitpick comments (6)
source/_integrations/switchbot.markdown (6)

413-416: Avoid orphan “Options” heading – merge or promote to proper heading level

Options: is currently a naked paragraph label (no hashes).
For consistency with the rest of the document (e.g. #### Options under Common), promote it to a heading or merge it into the preceding paragraph; otherwise screen-reader navigation and anchor linking are impaired.

-Options:
+#### Options

429-433: Collapse multiple blank lines to satisfy MD012

There are two consecutive empty lines after the list, which violates markdown-lint rule MD012 and breaks the template’s vertical rhythm.

- - Force Nightlatch operation mode, navigate to Settings … under Integration entries
-
-
+ - Force Nightlatch operation mode, navigate to Settings … under Integration entries
+

491-501: Insert blank line before subsection and refine final bullet wording

  1. The heading #### Battery Circulator Fan/Circulator Fan must be preceded by a blank line (MD022).
  2. Bullet “get battery” is ambiguous – prefer “get battery level”.
  3. Ensure list is followed by a single blank line.
-Fan entities are added for Battery Circulator Fan/Circulator Fan, Air Purifier, and Air Purifier Table
-#### Battery Circulator Fan/Circulator Fan
+Fan entities are added for Battery Circulator Fan/Circulator Fan, Air Purifier, and Air Purifier Table
+
+#### Battery Circulator Fan/Circulator Fan
@@
-- get battery, only applicable for Battery Circulator Fan
+- get battery level (Battery Circulator Fan only)

527-531: Surround list with blank lines to silence MD032

Add an empty line between Features: and the first list item to avoid markdown-lint warnings and to stay consistent with earlier sections.

-Features:
-- get states, including `cleaning`, `docked`, `idle`, `paused`, `returning`, and `error`; refer to Known limitations for more details
+Features:
+
+- get states, including `cleaning`, `docked`, `idle`, `paused`, `returning`, and `error`; refer to Known limitations for more details

547-552: Tighten grammar & punctuation in battery-level paragraph

Small copy-editing for clarity; also replace the rogue apostrophe after Lite.

-Due to firmware implementation, early models such as Lock and Lock Lite' battery level is divided into ranges instead of accurate value, <10%, shown as 10; 10%~20%, shown as 20; 20%~60%, shown as 60; ≥60%, shown as 100
+Due to firmware limitations, early models such as Lock and Lock Lite report battery level in ranges rather than precise values:  
+<10 % → 10 | 10–20 % → 20 | 20–60 % → 60 | ≥60 % → 100

557-559: Add blank line after heading “### Vacuum state”

Headings must be separated from content by an empty line to conform with MD022.

-### Vacuum state
-For robot vacuum K10+ and K10+ Pro, due to firmware implementation, it only returns these states, `cleaning` and `docked`
+### Vacuum state
+
+For robot vacuum K10+ and K10+ Pro, due to firmware limitations, only the states `cleaning` and `docked` are reported.
📜 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 f65457c and 765c25f.

📒 Files selected for processing (1)
  • source/_integrations/switchbot.markdown (6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`source/_integrations/*`: Integration documentation must use the provided template structure and section order.

source/_integrations/*: Integration documentation must use the provided template structure and section order.

  • source/_integrations/switchbot.markdown
🪛 markdownlint-cli2 (0.17.2)
source/_integrations/switchbot.markdown

433-433: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


434-434: Multiple consecutive blank lines
Expected: 1; Actual: 3

(MD012, no-multiple-blanks)


492-492: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


495-495: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


527-527: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


557-557: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

⏰ 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

@@ -410,6 +410,10 @@ Features:
- calibration state
- get battery level

Options:

- Force Nightlatch operation mode, navigate to Settings > Devices & services > Configured > SwitchBot Bluetooth and tap CONFIGURE under Integration entries
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you mean by "Force nightlatch operation mode"? Does it mean "To enable nightlatch operation mode"?
What is Nightlatch operation mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean by "Force nightlatch operation mode"? Does it mean "To enable nightlatch operation mode"? What is Nightlatch operation mode?

You are right, i have changed the description

@home-assistant home-assistant bot marked this pull request as draft June 25, 2025 08:26
@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.

@zerzhang zerzhang marked this pull request as ready for review June 25, 2025 09:26
@home-assistant home-assistant bot requested a review from c0ffeeca7 June 25, 2025 09:26
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: 2

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

413-416: Consider deduplicating & tightening the repeated “nightlatch operation mode” bullet

The three option blocks are identical, which is fine, but it is easy for them to diverge in future edits and forces readers to scroll.
A single generic paragraph right after the “Locks” heading (or a shared subsection such as ##### Night-latch mode) would make maintenance easier and avoid copy-paste drift.

Also applies to: 429-432, 447-450


433-434: Remove the extra blank lines to satisfy MD012

Two consecutive empty lines are flagged by the linter. One is enough.

-
-

526-528: Add the missing blank line before the list (MD032) and tighten wording

 Features:
+
 - get states, including `cleaning`, `docked`, `idle`, `paused`, `returning`, and `error`; refer to Known limitations for more details

557-559: Heading spacing (MD022) and phrasing

Add a blank line after the heading and adjust the sentence for number agreement.

-### Vacuum state
-For robot vacuum K10+ and K10+ Pro, due to firmware implementation, it only returns these states, `cleaning` and `docked`
+### Vacuum state
+
+Due to firmware limitations, the K10+ and K10+ Pro robots currently expose only two states: `cleaning` and `docked`.
📜 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 765c25f and 5caaede.

📒 Files selected for processing (1)
  • source/_integrations/switchbot.markdown (6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`source/_integrations/*`: Integration documentation must use the provided template structure and section order.

source/_integrations/*: Integration documentation must use the provided template structure and section order.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • source/_integrations/switchbot.markdown
🪛 markdownlint-cli2 (0.17.2)
source/_integrations/switchbot.markdown

433-433: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


434-434: Multiple consecutive blank lines
Expected: 1; Actual: 3

(MD012, no-multiple-blanks)


492-492: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


495-495: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


527-527: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


557-557: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

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/switchbot.markdown (4)

429-434: Remove extra blank line after the bullet

Markdown-lint (MD012) flags two consecutive blank lines here. Keep a single blank line to avoid unnecessary vertical whitespace.

- - To enable nightlatch operation mode, navigate to Settings > Devices & services > Configured > SwitchBot Bluetooth and tap CONFIGURE under Integration entries
-
-
+ - To enable nightlatch operation mode, navigate to Settings > Devices & services > Configured > SwitchBot Bluetooth and tap CONFIGURE under Integration entries
+

491-501: Missing blank line before the list (MD032)

Add a blank line between Features: and the first list item so the list renders correctly.

-Features:
-- turn on
+Features:
+
+ - turn on

527-531: Same list-spacing issue under Vacuums

Insert a blank line after Features: for consistency and to silence MD032.

-Features:
-- get states, including `cleaning`, `docked`, `idle`, `paused`, `returning`, and `error`; refer to Known limitations for more details
+Features:
+
+ - get states, including `cleaning`, `docked`, `idle`, `paused`, `returning`, and `error`; refer to the Known limitations section for more details

563-565: Heading needs a trailing blank line (MD022)

Add one blank line after the ### Vacuum state heading.

-### Vacuum state
-For robot vacuum K10+ and K10+ Pro, due to firmware implementation, it only returns these states, `cleaning` and `docked`
+### Vacuum state
+
+For robot vacuum K10+ and K10+ Pro, due to firmware limitations, only the `cleaning` and `docked` states are reported.
📜 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 5caaede and 529056f.

📒 Files selected for processing (1)
  • source/_integrations/switchbot.markdown (6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`source/_integrations/*`: Integration documentation must use the provided template structure and section order.

source/_integrations/*: Integration documentation must use the provided template structure and section order.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • source/_integrations/switchbot.markdown
🪛 markdownlint-cli2 (0.17.2)
source/_integrations/switchbot.markdown

433-433: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


434-434: Multiple consecutive blank lines
Expected: 1; Actual: 3

(MD012, no-multiple-blanks)


496-496: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


528-528: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


563-563: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

⏰ 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 (3)
source/_integrations/switchbot.markdown (3)

413-416: Lock – Options section looks good

Wording and spacing comply with the template; no issues spotted.


447-450: Lock Ultra – Options section looks good

No lint or clarity issues observed.


548-556: Battery level section ✔️

Formatting, grammar, and the bullet list are clear and follow previous feedback.

Copy link
Contributor

@c0ffeeca7 c0ffeeca7 left a comment

Choose a reason for hiding this comment

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

Thank you, @zerzhang 👍

@c0ffeeca7 c0ffeeca7 enabled auto-merge (squash) June 25, 2025 13:40
@c0ffeeca7 c0ffeeca7 merged commit 26e703a into home-assistant:current Jun 25, 2025
6 of 7 checks passed
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 (6)
source/_integrations/switchbot.markdown (6)

413-418: Drop the colon to keep headings consistent with the rest of the doc

Every other #### Options heading in this document (and in the template) omits the trailing colon.
Removing it avoids visual noise and keeps the markdown style uniform.

-Options:
+Options

431-438: Fix heading + excess blank lines (MD022/MD012)

  1. Same heading-colon issue as above.
  2. Two consecutive blank lines after the ordered list violate MD012.
-Options:
+Options

 …steps…

-
-
+             <!-- keep a single terminating blank line -->

451-456: Consistent heading & spacing for “Lock Ultra” section

Replicate the corrections applied to the previous two blocks:

-Options:
+Options

No extra blank lines are needed after the ordered list.


497-508: Grammar + markdown-lint: add blank line before list & clarify sentence

  1. MD032 – a blank line is required between “Features:” and the list.
  2. The introductory sentence reads awkwardly; split the model names.
-Fan entities are added for Battery Circulator Fan/Circulator Fan, Air Purifier, and Air Purifier Table
+Fan entities are added for Battery Circulator Fan, Circulator Fan, Air Purifier, and Air Purifier Table

 #### Battery Circulator Fan/Circulator Fan
 …
-Features:
+Features:

   <!-- blank line above satisfies MD032 -->

533-538: List spacing + wording improvements

  • MD032 – needs a blank line after “Features:”.
  • Use “battery level” to match wording elsewhere.
  • “get states” → “retrieve state” (singular is used in other sections).
-Features:
+Features:

-- get states, including `cleaning`, `docked`, `idle`, `paused`, `returning`, and `error`; refer to Known limitations for more details
+- retrieve state (values: `cleaning`, `docked`, `idle`, `paused`, `returning`, `error` – see Known limitations)
 - start
 - return to base
-- get battery
+- get battery level

569-572: Grammar tweak for subject-verb agreement

-For robot vacuum K10+ and K10+ Pro, due to firmware implementation, it only returns these states, `cleaning` and `docked`
+Due to firmware limitations, the K10+ and K10+ Pro robot vacuums only return two states: `cleaning` and `docked`.
📜 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 529056f and 0a13739.

📒 Files selected for processing (1)
  • source/_integrations/switchbot.markdown (6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`source/_integrations/*`: Integration documentation must use the provided template structure and section order.

source/_integrations/*: Integration documentation must use the provided template structure and section order.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • source/_integrations/switchbot.markdown
🪛 markdownlint-cli2 (0.17.2)
source/_integrations/switchbot.markdown

437-437: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


438-438: Multiple consecutive blank lines
Expected: 1; Actual: 3

(MD012, no-multiple-blanks)


502-502: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


534-534: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

⏰ 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

@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
current This PR goes into the current branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants