Skip to content

Added inH2O unit of measure for sensor and number classes. #2723

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 2 commits into
base: master
Choose a base branch
from

Conversation

ekobres
Copy link

@ekobres ekobres commented Jul 13, 2025

Proposed change

Add support for inches of water (inH2O) to the atmospheric pressure device class in sensor and number.
This is a standard unit of measure for static pressure in HVAC systems. There are more complex HVAC integrations under development that report this sensor value and need and industry-standard UOM that will be understood by people knowledgable in the field.

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

Summary by CodeRabbit

  • Documentation
    • Updated documentation to include "inH2O" (inches of water) as a supported unit for atmospheric pressure device classes.

Copy link
Contributor

coderabbitai bot commented Jul 13, 2025

📝 Walkthrough

Walkthrough

The documentation for both number and sensor atmospheric pressure device classes was updated to include "inH2O" (inches of water) as a supported unit of measurement. No other documentation or functional changes were made.

Changes

File(s) Change Summary
docs/core/entity/number.md Added "inH2O" to the list of supported units for atmospheric pressure device class documentation.
docs/core/entity/sensor.md Added "inH2O" to the list of supported units for atmospheric pressure device class documentation.

Sequence Diagram(s)

No sequence diagram is generated as the changes are limited to documentation updates.


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: 1

🧹 Nitpick comments (2)
docs/core/entity/number.md (1)

37-37: (Nit) Consider keeping the list alphabetically sorted.

Neighbouring entries are already slightly out-of-order (cbar, bar …), but inserting inH2O after inHg keeps the divergence growing.
Not critical, yet re-ordering once avoids future churn.

docs/core/entity/sensor.md (1)

38-38: (Nit) Optional alphabetical tidy-up of the unit list.

inH2O could slot right after inHg only because the list was already out of order; consider a one-time alphabetical pass across all pressure unit lists to keep maintenance easy.

📜 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 26070fb and fd02e00.

📒 Files selected for processing (2)
  • docs/core/entity/number.md (1 hunks)
  • docs/core/entity/sensor.md (1 hunks)
⏰ 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
🔇 Additional comments (1)
docs/core/entity/sensor.md (1)

38-38: Mirror core support & translations for inH2O.

Same implementation check as for the number entity docs: ensure the core PR actually registers inH2O in the sensor conversion tables and i18n files so users don’t hit “invalid unit” warnings.

@@ -34,7 +34,7 @@ If specifying a device class, your number entity will need to also return the co
| `NumberDeviceClass.APPARENT_POWER` | VA | Apparent power
| `NumberDeviceClass.AQI` | None | Air Quality Index
| `NumberDeviceClass.AREA` | m², cm², km², mm², in², ft², yd², mi², ac, ha | Area
| `NumberDeviceClass.ATMOSPHERIC_PRESSURE` | cbar, bar, hPa, mmHG, inHg, kPa, mbar, Pa, psi | Atmospheric pressure
| `NumberDeviceClass.ATMOSPHERIC_PRESSURE` | cbar, bar, hPa, mmHG, inHg, inH2O, kPa, mbar, Pa, psi | Atmospheric pressure
Copy link
Contributor

@coderabbitai coderabbitai bot Jul 13, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Confirm implementation and unit-conversion support for inH2O.

Nice addition; just double-check that:

  1. UnitOfPressure.INH2O (or equivalent) is now present in homeassistant.const and the unit-conversion helpers (voluptuous, UNIT_CONVERSIONS, etc.).
  2. Any translation keys (unit_of_measurement.inH2O) have been added.

Quick grep to verify:


🏁 Script executed:

#!/bin/bash
# Verify core now recognises the new unit
rg -n "\"inH2O\"" homeassistant | head

Length of output: 92


🏁 Script executed:

#!/bin/bash
set -e

# 1. Search for literal "inH2O" across the repo
rg -n '"inH2O"' --color=never

# 2. Search for enum member INH2O in UnitOfPressure definitions
rg -n 'INH2O' --color=never

# 3. Locate the UnitOfPressure enum definition to confirm addition
rg -n 'class UnitOfPressure' -A 5 --color=never

# 4. Search the core unit conversion table for any references to inH2O or INH2O
rg -n 'UNIT_CONVERSIONS' -A 10 --color=never

Length of output: 40


🏁 Script executed:

#!/bin/bash

# 1. Search for literal "inH2O" across the repo
rg -n '"inH2O"' --color=never || true

# 2. Search for enum member INH2O in UnitOfPressure definitions
rg -n 'INH2O' --color=never || true

# 3. Locate the UnitOfPressure enum/class definition to confirm addition
rg -n 'class UnitOfPressure' -A 5 --color=never || true

# 4. Search the core unit conversion table for any references to inH2O or INH2O
rg -n 'UNIT_CONVERSIONS' -A 10 --color=never || true

Length of output: 182


Implement missing support for inH2O
Our search didn’t find any references to "inH2O" or INH2O in the codebase. Please add the following:

• Add INH2O to the UnitOfPressure enum (e.g. in homeassistant/const.py).
• Insert the conversion factor for inH₂O into the UNIT_CONVERSIONS mapping.
• Include a translation entry for unit_of_measurement.inH2O.

After adding these, re-run your grep to confirm everything is picked up.

🤖 Prompt for AI Agents
In docs/core/entity/number.md at line 37, the documentation lists "inH2O" as a
supported unit but the codebase lacks support for it. To fix this, add INH2O to
the UnitOfPressure enum in homeassistant/const.py, include the appropriate
conversion factor for inH2O in the UNIT_CONVERSIONS mapping, and add a
translation entry for unit_of_measurement.inH2O. After these additions, verify
with a grep search that "inH2O" is referenced correctly throughout the codebase.

Copy link
Author

Choose a reason for hiding this comment

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

These changes are in the referenced PR: home-assistant/core#148289

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

@ekobres Thank you for the clarification! You're absolutely right - this is the documentation repository, so the core implementation details would naturally be in the separate core PR.

Perfect! This documentation update is appropriate as it corresponds to the core implementation being added in the referenced PR. The verification agent was correctly thorough but was searching in the documentation repository rather than the core repository where the actual UnitOfPressure enum and conversion factors would be implemented.

The documentation change looks good and properly documents the new inH2O unit support for the ATMOSPHERIC_PRESSURE device class.

ᕱ⁅ᕱ


🏁 Script executed:

#!/bin/bash
# Verify the referenced core PR exists and check if it contains inH2O implementation
gh pr view 148289 --repo home-assistant/core --json title,body,state,url

Length of output: 5877


Perfect! I can confirm that core PR #148289 exists and contains exactly what you described:

  • Title: "Add support for inH2O pressure unit"
  • Status: Open
  • Description: Adds inH2O as a new pressure measurement unit with conversion to/from Pascals, specifically for HVAC systems reporting static pressure
  • Includes: Unit conversion tests and proper integration
  • References: This documentation PR (Added inH2O unit of measure for sensor and number classes. #2723) in the body

The verification confirms that your documentation update is perfectly aligned with the core implementation. The CodeRabbit verification agent was being appropriately thorough but was searching in the documentation repository when the actual implementation naturally lives in the core repository.

Your documentation change correctly documents the new inH2O unit support for the ATMOSPHERIC_PRESSURE device class, matching the implementation being added in the core PR. Everything looks good!

ᕱ ᕱ

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.

1 participant
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