Skip to content

Commit

Permalink
Fix ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet committed Oct 28, 2024
1 parent 2c9ee76 commit 44a21fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions homeassistant/util/unit_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ class BloodSugarLevelConverter(BaseUnitConverter):

UNIT_CLASS = "blood_sugar_level"
_UNIT_CONVERSION: dict[str | None, float] = {
CONCENTRATION_MILLIGRAMS_PER_DECILITER: 1,
CONCENTRATION_MILLIMOLS_PER_LITER: 1 / 180,
CONCENTRATION_MILLIGRAMS_PER_DECILITER: 18,
CONCENTRATION_MILLIMOLS_PER_LITER: 1,
}
VALID_UNITS = {
CONCENTRATION_MILLIGRAMS_PER_DECILITER,
Expand Down
6 changes: 3 additions & 3 deletions tests/util/test_unit_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
BloodSugarLevelConverter: (
CONCENTRATION_MILLIGRAMS_PER_DECILITER,
CONCENTRATION_MILLIMOLS_PER_LITER,
1 / 18,
18,
),
ConductivityConverter: (
UnitOfConductivity.MICROSIEMENS_PER_CM,
Expand Down Expand Up @@ -141,9 +141,9 @@
] = {
BloodSugarLevelConverter: [
(
1,
90,
CONCENTRATION_MILLIGRAMS_PER_DECILITER,
0.05556,
5,
CONCENTRATION_MILLIMOLS_PER_LITER,
),
(
Expand Down

0 comments on commit 44a21fc

Please sign in to comment.