-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add kV and MV unit conversion for voltages #36878
Add kV and MV unit conversion for voltages #36878
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
📝 WalkthroughWalkthroughThe pull request updates the documentation for the Number and Sensor integrations by expanding the supported units for the voltage device class. The change adds kilovolts (kV) and megavolts (MV) to the existing list of voltage units (V, mV, µV), providing a more comprehensive representation of voltage measurement units across these integrations. Changes
This change ensures consistent documentation of voltage units across different integrations, expanding the range of supported voltage measurements from three to five units. 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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
source/_integrations/number.markdown
(1 hunks)source/_integrations/sensor.markdown
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- source/_integrations/number.markdown
⏰ 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
@@ -94,7 +94,7 @@ The following device classes are supported for sensors: | |||
- **timestamp**: Datetime object or timestamp string (ISO 8601) | |||
- **volatile_organic_compounds**: Concentration of volatile organic compounds in µg/m³ | |||
- **volatile_organic_compounds_parts**: Ratio of volatile organic compounds in ppm or ppb | |||
- **voltage**: Voltage in V, mV, µV | |||
- **voltage**: Voltage in V, mV, µV, kV, MV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Documentation includes unsupported voltage units
The documentation adds kV (kilovolt) and MV (megavolt) units, but these units are not currently implemented in Home Assistant core. The documentation should only list the currently supported units:
- V (volt)
- mV (millivolt)
- µV (microvolt)
🔗 Analysis chain
LGTM! The voltage units are correctly documented.
The addition of kV and MV units is properly formatted and follows the ascending order of magnitude (µV, mV, V, kV, MV).
Let's verify that this documentation change matches the implementation in the parent PR:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the voltage units implementation in the core repository
# Note: This assumes the parent PR #135396 has been merged
# Clone the core repository and check the voltage device class implementation
git clone https://github.com/home-assistant/core.git
cd core
rg -A 5 "DEVICE_CLASS_VOLTAGE" homeassistant/const.py
Length of output: 1966
Script:
#!/bin/bash
# Search for voltage-related implementations with different patterns
cd core
# Search for voltage class and units
rg -i "voltage" homeassistant/const.py
# Search for unit conversion implementations
rg -i "UnitOfElectricPotential" homeassistant/
Length of output: 38538
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lschloetterer 👍
Proposed change
The parent pull request adds unit conversions for the metric prefixes kilo and mega to the voltage device class.
This PR reflects these changes in the docs.
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit