-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Add pressure mmhg unit conversion #35575
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Is anything using this code, ie the new unit?
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.
No, there is no code yet that uses this.
But in the forum I met a lot of requests to add these units. And I myself am more familiar with them. That's why I added them.
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.
mmHg is usual pressure unit for CIS sitizens
Uh oh!
There was an error while loading. Please reload this page.
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.
So if nothing is using it, why should it be added? As it sounds like this will add "dead" code to our codebase.
Uh oh!
There was an error while loading. Please reload this page.
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 reason is that this (and only this) unit of pressure measurement is familiar to the CIS population (and this is more than 280 million people). More precisely -- all former regions of the USSR.
Yes, this unit is not currently used in the Home Assistant code. But in the forum, people regularly ask to add it, for example, to the weather frontend.
What is the point of making “crutches” in separate modules when you can centrally add this unit to the core and solve the problem?
Uh oh!
There was an error while loading. Please reload this page.
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.
Just because you live in a country where other standards are generally accepted, gives no reason to ignore the standards generally accepted in countries on the other sixth of all the Earth’s land.
Yes, that integration developer could theoretically suggest this code. But for some reason he did not. Maybe because he didn’t even think that it was possible? Or maybe because the conversion of pressure units was added to the core code later than he did his component?
Adding this unit will allow this and other developers to make their work easier in the future. It will allow in the future users of Home Assistant from the CIS countries to use this system with great comfort.
I am sure that a little time will pass and this code will be claimed by developers and will cease to be dead.
Uh oh!
There was an error while loading. Please reload this page.
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.
By the way, I also found an example when a person needs reverse conversion: https://community.home-assistant.io/t/change-the-unit-in-bloomsky-sensors/35837
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.
We won't accept this PR until there's an active use case in the code.
Uh oh!
There was an error while loading. Please reload this page.
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.
Here is a use-case out-of-code. I, as many others, want to customize output of any weather sensor, which I'm not using ATM partially because there is no pressure unit, used in my country. I could use a template, but it would be a lot nicer to put one small setting in one sensor to make it work like all other system.
Please, put yourself in our shoes and image if your country's proffered pressure/temperature/whatever unit was not supported. Let's imagine for a second, that HA was originally developed not in the US, but somewhere in Europe with metric system. I really don't think that a US citizen coming with such a small proposal adding their unit of temperature measurement, would be rejected so harshly. There was a time, when there were no temperature units in HA, and it was corrected.
As for code usage - there are CIS weather services, such as Gismeteo and Yandex Weather, providing pressure in mmHg, not in hPa. And integrations for them could have used mmHg for their operation. Please see this integration's example code. This code could have used the proposed unit.
Uh oh!
There was an error while loading. Please reload this page.
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.
This is about adding "dead" code to our codebase. As soon as there is a use case for it in our codebase, we are happy to accept and add it.
The integration you have linked it not the Home Assistant codebase. Feel free to open up a PR to add an integration to our codebase that add this and the new integration.
PS: Did you know most of us are not in the US? Like everybody who reviewed this PR? Thanks.