Skip to content

Update off and unavailable in standby state #2728

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
merged 2 commits into from
Jul 16, 2025
Merged

Update off and unavailable in standby state #2728

merged 2 commits into from
Jul 16, 2025

Conversation

thecode
Copy link
Member

@thecode thecode commented Jul 16, 2025

Proposed change

Define when to show a device as off and when as unavailable in standby state.

Update developer documentation to reflect the accepted change from home-assistant/architecture#1251

This pull request updates the documentation to clarify the behavior of entities in Home Assistant when they are unavailable or in standby mode. It also introduces exceptions to the rules for handling unavailable entities, particularly for devices like media players that may require alternative methods to turn on. Below are the key changes grouped by theme:

Documentation Updates for Entity Behavior:

  • Updated the description of the available property in docs/core/entity.md to specify that Home Assistant can read the state or control the device, with a reference to the entity-unavailable rules for more details.
  • Added a note in docs/core/entity/media-player.md explaining how media players should be represented when in standby or unavailable states, with a link to the exceptions in the entity-unavailable rules.

New Exceptions for Unavailable Entities:

  • Expanded the entity-unavailable rules in docs/core/integration-quality-scale/rules/entity-unavailable.md to include scenarios where devices can be turned on using alternative methods, such as automations or secondary control channels. Provided an example for media players in standby mode.

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
    • Clarified the meaning of the "available" property for entities, specifying it applies if Home Assistant can read the state or control the device.
    • Added guidance on representing media player states in standby, distinguishing when to use "off" versus "unavailable".
    • Expanded documentation on exceptions for entity availability, including examples and reference links for further details.

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Tiny langauge tweaks

Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

📝 Walkthrough

"""

Walkthrough

Documentation was updated to clarify the meaning of the available property for entities, provide detailed guidance on handling standby and unavailable states for media players, and expand on exceptions for entity availability reporting. These changes affect only markdown documentation and do not alter any code or exported entities.

Changes

File(s) Change Summary
docs/core/entity.md Clarified the definition of the available property and added a reference link for further details.
docs/core/entity/media-player.md Added a note explaining how to represent standby and unavailable states for media players.
docs/core/integration-quality-scale/rules/entity-unavailable.md Expanded the "Exceptions" section with detailed scenarios and examples for device availability.

Sequence Diagram(s)

No sequence diagram generated as changes are limited to documentation updates without control flow or feature modifications.
"""


📜 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 03b8ad3 and cfc1190.

📒 Files selected for processing (2)
  • docs/core/entity/media-player.md (1 hunks)
  • docs/core/integration-quality-scale/rules/entity-unavailable.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/core/entity/media-player.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/core/integration-quality-scale/rules/entity-unavailable.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant

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

🧹 Nitpick comments (3)
docs/core/entity/media-player.md (1)

95-99: Break up the run-on sentence and fix minor style inconsistencies

The note is great but hard to read in its current form and contains a case/anchor mismatch.

:::note
-It is common that media players can't be controlled when in a standby state,  If Home Assistant can turn on the device using another protocol or method it should be shown as `OFF` even if the main channel used to control the device is currently unavailable, if Home Assistant has no way to turn on the device it should be shown as `unavailable`, see [entity-unavailable Exceptions](/docs/core/integration-quality-scale/rules/entity-unavailable.md#Exceptions) for more details.
+It is common that media players cannot be controlled while they are in standby.  
+• If Home Assistant can turn the device on via an alternative protocol or method, the entity should be reported as `OFF`, even if the main control channel is unavailable.  
+• If Home Assistant has no way to turn the device on, the entity should be reported as `unavailable`.  
+See the [entity-unavailable exceptions](/docs/core/integration-quality-scale/rules/entity-unavailable.md#exceptions) for more details.
:::

Changes:

  1. Split the long sentence into clear bullets.
  2. Expanded “can't” → “cannot” for a formal tone.
  3. Lower-cased the #exceptions anchor to match generated IDs.
  4. Removed double space after “state”.
docs/core/entity.md (1)

72-78: Use “can” instead of “is able to” for conciseness

Also keeps wording consistent with the rest of the table.

-| available                | `bool`                        | `True`  | Indicate if Home Assistant is able to read the state or control the underlying device, see [entity-unavailable](/docs/core/integration-quality-scale/rules/entity-unavailable.md) for more details.
+| available                | `bool`                        | `True`  | Indicate if Home Assistant can read the state or control the underlying device; see [entity-unavailable](/docs/core/integration-quality-scale/rules/entity-unavailable.md) for more details.
docs/core/integration-quality-scale/rules/entity-unavailable.md (1)

84-91: Align state constants and tighten grammar

Consistently use the exact enum strings (OFF, ON) and polish the prose.

-If an integration has a way to turn on a device, either via a user-defined automation trigger or by automatically creating a secondary control channel (e.g., using Wake On Lan or Infra-Red blaster) - then the device should be reported as `off` when it is in standby and unresponsive to the main channel (e.g., TCP).
+If an integration can turn a device on—either through a user-defined automation trigger or a secondary control channel (e.g., Wake-on-LAN or IR blaster)—the device should be reported as `OFF` while it is in standby and the primary control channel (e.g., TCP) is unresponsive.
@@
-- If the user configures an automation (e.g., using an IR blaster) to turn it on, the device will be shown as `off` while in standby.
-- Once turned on via the external method, and the main connection is established, the state will update to `on`.
+- If the user configures an automation (e.g., an IR blaster) to turn it on, the device will be shown as `OFF` while in standby.
+- Once powered on via the external method and the main connection is established, the state will update to `ON`.

Also capitalised “Wake-on-LAN” and removed the dash before then, which was breaking the sentence.

📜 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 612d557 and 03b8ad3.

📒 Files selected for processing (3)
  • docs/core/entity.md (1 hunks)
  • docs/core/entity/media-player.md (1 hunks)
  • docs/core/integration-quality-scale/rules/entity-unavailable.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/core/entity.md

[style] ~76-~76: As a shorter alternative for ‘able to’, consider using “can”.
Context: ... | True | Indicate if Home Assistant is able to read the state or control the underlyin...

(BE_ABLE_TO)

Co-authored-by: Franck Nijhof <git@frenck.dev>
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @thecode 👍

../Frenck

@frenck frenck merged commit 2c2ebba into master Jul 16, 2025
5 checks passed
@frenck frenck deleted the arch-1251 branch July 16, 2025 20:11
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy