-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
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
Allow liter for gas sensor device class #141518
base: dev
Are you sure you want to change the base?
Conversation
Hey there @home-assistant/core, @Shulyaka, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
We also need to update the valid gas units on the energy sensor for the energy dashboard in |
Fixed the energy dashboard, please review again |
if self.hass.config.units is METRIC_SYSTEM: | ||
default_price_unit = UnitOfVolume.CUBIC_METERS | ||
else: | ||
default_price_unit = UnitOfVolume.CENTUM_CUBIC_FEET |
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.
I would like to have a second opinion on this, since it will now do a conversion in cases where it didn't before.
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.
The problem is that we allow gas to be measured either in a volume or as energy, so I don't think this will work (that's what the comment is trying to say).
It should be possible to do some rewrite, but that should happen in a separate PR, not in a PR adding support for liters.
Proposed change
Haier water heaters report their gas usage in liters,
so the corresponding custom integration produces WARNING logs like:
This patch fix the warning by allowing liter
L
as a valid unit for the gas sensor device class.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: