Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/core/entity/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

ᕱ ᕱ

| `NumberDeviceClass.BATTERY` | % | Percentage of battery that is left
| `NumberDeviceClass.BLOOD_GLUCOSE_CONCENTRATION` | mg/dL, mmol/L | Blood glucose concentration```
| `NumberDeviceClass.CO2` | ppm | Concentration of carbon dioxide.
Expand Down
2 changes: 1 addition & 1 deletion docs/core/entity/sensor.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If specifying a device class, your sensor entity will need to also return the co
| `SensorDeviceClass.APPARENT_POWER` | VA | Apparent power
| `SensorDeviceClass.AQI` | None | Air Quality Index
| `SensorDeviceClass.AREA` | m², cm², km², mm², in², ft², yd², mi², ac, ha | Area
| `SensorDeviceClass.ATMOSPHERIC_PRESSURE` | cbar, bar, hPa, mmHG, inHg, kPa, mbar, Pa, psi | Atmospheric pressure
| `SensorDeviceClass.ATMOSPHERIC_PRESSURE` | cbar, bar, hPa, mmHG, inHg, inH2O, kPa, mbar, Pa, psi | Atmospheric pressure
| `SensorDeviceClass.BATTERY` | % | Percentage of battery that is left
| `SensorDeviceClass.BLOOD_GLUCOSE_CONCENTRATION` | mg/dL, mmol/L | Blood glucose concentration
| `SensorDeviceClass.CO2` | ppm | Concentration of carbon dioxide.
Expand Down