Skip to content

Commit

Permalink
MILLIMOLE_PER_LITER
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet committed Nov 7, 2024
1 parent cf8773d commit 31cfbb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ class UnitOfBloodGlucoseConcentration(StrEnum):
"""Blood glucose concentration units."""

MILLIGRAMS_PER_DECILITER = "mg/dL"
MILLIMOLS_PER_LITER = "mmol/L"
MILLIMOLE_PER_LITER = "mmol/L"


# Speed units
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/util/unit_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class BloodGlugoseConcentrationConverter(BaseUnitConverter):
UNIT_CLASS = "blood_glucose_concentration"
_UNIT_CONVERSION: dict[str | None, float] = {
UnitOfBloodGlucoseConcentration.MILLIGRAMS_PER_DECILITER: 18,
UnitOfBloodGlucoseConcentration.MILLIMOLS_PER_LITER: 1,
UnitOfBloodGlucoseConcentration.MILLIMOLE_PER_LITER: 1,
}
VALID_UNITS = set(UnitOfBloodGlucoseConcentration)

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 @@ -85,7 +85,7 @@
_GET_UNIT_RATIO: dict[type[BaseUnitConverter], tuple[str | None, str | None, float]] = {
BloodGlugoseConcentrationConverter: (
UnitOfBloodGlucoseConcentration.MILLIGRAMS_PER_DECILITER,
UnitOfBloodGlucoseConcentration.MILLIMOLS_PER_LITER,
UnitOfBloodGlucoseConcentration.MILLIMOLE_PER_LITER,
18,
),
ConductivityConverter: (
Expand Down Expand Up @@ -143,11 +143,11 @@
90,
UnitOfBloodGlucoseConcentration.MILLIGRAMS_PER_DECILITER,
5,
UnitOfBloodGlucoseConcentration.MILLIMOLS_PER_LITER,
UnitOfBloodGlucoseConcentration.MILLIMOLE_PER_LITER,
),
(
1,
UnitOfBloodGlucoseConcentration.MILLIMOLS_PER_LITER,
UnitOfBloodGlucoseConcentration.MILLIMOLE_PER_LITER,
18,
UnitOfBloodGlucoseConcentration.MILLIGRAMS_PER_DECILITER,
),
Expand Down

0 comments on commit 31cfbb8

Please sign in to comment.