Skip to content
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 number device classes #2580

Merged
merged 3 commits into from
Feb 26, 2025
Merged

Conversation

TheJulianJES
Copy link
Member

@TheJulianJES TheJulianJES commented Feb 26, 2025

Proposed change

This PR updates the docs for all number device classes. These should mostly match sensor device classes, but the dev docs weren't being updated as well as the dev docs for the sensor device classes. The following is done:

  • add missing NumberDeviceClass.DURATION
  • add missing NumberDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS
  • fix NumberDeviceClass.CO2
  • fix NumberDeviceClass.CO
  • update description of all device classes to match descriptions from the SensorDeviceClass docs

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Removed stale or deprecated documentation

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

Summary by CodeRabbit

  • New Features

    • Introduced expanded measurement options with the addition of Duration and Volatile Organic Compound Parts.
  • Documentation

    • Updated definitions for various measurement metrics by adjusting units for atmospheric pressure and pressure.
    • Refined naming conventions for carbon measurements and improved formatting for clarity.
    • Overall, these updates enhance accuracy and consistency in the measurement information presented.

Copy link
Contributor

coderabbitai bot commented Feb 26, 2025

📝 Walkthrough

Walkthrough

The documentation update in docs/core/entity/number.md refines various NumberDeviceClass constants and their descriptions. Unit changes were applied to atmospheric pressure and pressure, with distance now including nautical miles. Two constants have been renamed (from CARBON_DIOXIDE to CO2 and from CARBON_MONOXIDE to CO), and two new constants (DURATION and VOLATILE_ORGANIC_COMPOUNDS_PARTS) have been added. Additionally, minor formatting adjustments and clarification of descriptions were made, such as specifying accumulated precipitation.

Changes

File Path Change Summary
docs/.../number.md - Updated description: NumberDeviceClass.ATMOSPHERIC_PRESSURE now uses mmHg instead of inHg.
- Updated description: NumberDeviceClass.PRESSURE now uses mmHg instead of inHg.
- Updated description: NumberDeviceClass.PRECIPITATION now specifies "Accumulated precipitation".
- Updated NumberDeviceClass.DISTANCE to include nmi (nautical miles).
- Renamed constants: CARBON_DIOXIDECO2, CARBON_MONOXIDECO.
- Added new constants: DURATION and VOLATILE_ORGANIC_COMPOUNDS_PARTS.

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?

❤️ 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 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 (1)
docs/core/entity/number.md (1)

75-75: SULPHUR_DIOXIDE Constant – Spelling Review

The description reads "Concentration of sulphure dioxide." Please confirm if the spelling "sulphure" is intentional or if it should be corrected to "sulphur" (or "sulfur") to maintain consistency with standard terminology.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0021208 and a4e228e.

📒 Files selected for processing (1)
  • docs/core/entity/number.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 (21)
docs/core/entity/number.md (21)

34-34: APPARENT_POWER Constant – Formatting Confirmation

The definition for NumberDeviceClass.APPARENT_POWER appears unchanged content-wise and only reflects formatting adjustments.


36-36: AREA Constant – Formatting Updated

The NumberDeviceClass.AREA entry now has corrected formatting for the supported units list. No content change is observed.


37-37: ATMOSPHERIC_PRESSURE Unit List – Verify Intended Units

The updated line for NumberDeviceClass.ATMOSPHERIC_PRESSURE includes both mmHG and inHg. The PR objective mentioned updating the unit from inHg to mmHg to align with sensor documentation. Please verify whether the inclusion of inHg is intentional or if it should be removed.


40-40: CO2 Constant Renamed Correctly

The constant has been renamed to CO2 from CARBON_DIOXIDE and the description is accurate.


41-41: CO Constant Renamed Correctly

The change from CARBON_MONOXIDE to CO is clear and consistent with the updated documentation.


46-46: DISTANCE Constant – Nautical Miles Added

The supported units for NumberDeviceClass.DISTANCE now include nmi (nautical miles) as intended.


47-47: DURATION Constant – New Addition

The new NumberDeviceClass.DURATION has been added with a clear description and appropriate time units. This aligns with the sensor documentation pattern.


48-48: ENERGY Constant – Formatting and Clarity

Although there is a tilde marking on this line, the content and description for NumberDeviceClass.ENERGY remain consistent. The minor formatting adjustment is acceptable.


58-58: NITROGEN_DIOXIDE Constant – Formatting Reviewed

The definition of NumberDeviceClass.NITROGEN_DIOXIDE appears correctly formatted with no content changes.


59-59: NITROGEN_MONOXIDE Constant – Formatting Reviewed

This definition is clear and matches the intended description.


60-60: NITROUS_OXIDE Constant – Formatting Reviewed

The NumberDeviceClass.NITROUS_OXIDE entry is correctly formatted and the description is accurate.


61-61: OZONE Constant – Formatting Reviewed

The entry for NumberDeviceClass.OZONE is updated in formatting while retaining its accurate description.


62-62: PH Constant – Formatting Reviewed

The NumberDeviceClass.PH entry is now up-to-date and clearly stated.


63-63: PM1 Constant – Formatting Reviewed

The entry for NumberDeviceClass.PM1 is clear and accurate.


64-64: PM25 Constant – Formatting Reviewed

The NumberDeviceClass.PM25 constant is correctly formatted with an accurate description.


65-65: PM10 Constant – Formatting Reviewed

The presentation for NumberDeviceClass.PM10 is now clearer with the updated formatting.


68-68: PRECIPITATION Description – Clarification Confirmed

The description for NumberDeviceClass.PRECIPITATION now explicitly states "Accumulated precipitation," which enhances clarity.


70-70: PRESSURE Constant – Verify Unit Consistency

For NumberDeviceClass.PRESSURE, the supported units still include both mmHg and inHg. Since the update guidance mentioned changing the unit from inHg to mmHg, please confirm if inHg should be removed to maintain consistency with the sensor device classes.


71-71: REACTIVE_POWER Constant – Formatting Updated

The NumberDeviceClass.REACTIVE_POWER constant is now properly formatted with a concise description.


78-78: VOLATILE_ORGANIC_COMPOUNDS_PARTS – New Addition Confirmed

The new constant NumberDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS is added with the correct supported units and a clear description.


81-81: VOLUME_FLOW_RATE Constant – Formatting Reviewed

The definition for NumberDeviceClass.VOLUME_FLOW_RATE appears clear and its formatting is consistent with the other entries.

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, @TheJulianJES 👍

../Frenck

@frenck frenck merged commit f4abc07 into master Feb 26, 2025
5 checks passed
@frenck frenck deleted the tjj-add_missing_number_device_class branch February 26, 2025 07:59
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