From 44a21fcc60f94f3bba1d90dd049fa01bcdde97ad Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:40:53 +0000 Subject: [PATCH] Fix ratio --- homeassistant/util/unit_conversion.py | 4 ++-- tests/util/test_unit_conversion.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/util/unit_conversion.py b/homeassistant/util/unit_conversion.py index 6e88abac14580f..82a85e4e803075 100644 --- a/homeassistant/util/unit_conversion.py +++ b/homeassistant/util/unit_conversion.py @@ -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, diff --git a/tests/util/test_unit_conversion.py b/tests/util/test_unit_conversion.py index 5aabde847ff7f6..4ba7eb64169a96 100644 --- a/tests/util/test_unit_conversion.py +++ b/tests/util/test_unit_conversion.py @@ -87,7 +87,7 @@ BloodSugarLevelConverter: ( CONCENTRATION_MILLIGRAMS_PER_DECILITER, CONCENTRATION_MILLIMOLS_PER_LITER, - 1 / 18, + 18, ), ConductivityConverter: ( UnitOfConductivity.MICROSIEMENS_PER_CM, @@ -141,9 +141,9 @@ ] = { BloodSugarLevelConverter: [ ( - 1, + 90, CONCENTRATION_MILLIGRAMS_PER_DECILITER, - 0.05556, + 5, CONCENTRATION_MILLIMOLS_PER_LITER, ), (