Skip to content
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 get_unit_ratio to all BaseUnitConverter classes #317

Merged
merged 1 commit into from
Oct 10, 2022
Merged

Conversation

bachya
Copy link
Owner

@bachya bachya commented Oct 10, 2022

Describe what the PR does:

In support of #308, this PR adds a method to all BaseUnitConverter subclasses: get_unit_ratio. This is an approximate ratio between two units, and will be useful in scaling precision when converting from a "small" unit to a "big" unit.

Thanks to Home Assistant for the initial work and inspiration.

Does this fix a specific issue?

N/A

Checklist:

  • Confirm that one or more new tests are written for the new functionality.
  • Run tests and ensure everything passes (with 100% test coverage).
  • Update README.md with any new documentation.
  • Add yourself to AUTHORS.md.

@bachya bachya added the enhancement Enhancement of the code, not introducing new features. label Oct 10, 2022
@bachya bachya self-assigned this Oct 10, 2022
@bachya bachya merged commit 4267db3 into dev Oct 10, 2022
@bachya bachya deleted the unit-ratio branch October 10, 2022 21:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant