From 4e4605bfb2ea365f933079ba67acc4a4c015f4d4 Mon Sep 17 00:00:00 2001 From: Marcio Granzotto Date: Mon, 1 Nov 2021 18:32:31 -0300 Subject: [PATCH 1/2] Round mmol/L SGV to 1 decimal point --- py_nightscout/models.py | 2 +- tests/test_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py_nightscout/models.py b/py_nightscout/models.py index d332b22..b8a6024 100644 --- a/py_nightscout/models.py +++ b/py_nightscout/models.py @@ -85,7 +85,7 @@ def json_transforms(cls, json_data): json_data["date"] = dateutil.parser.parse(json_data["dateString"]) def mgdlTommolL(self, mgdl): - return mgdl / 18 + return round(mgdl / 18, 1) class Treatment(BaseModel): diff --git a/tests/test_api.py b/tests/test_api.py index 5046de2..197ba6f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -42,7 +42,7 @@ async def test_get_sgv(api: nightscout.Api): entries = await api.get_sgvs() assert 10 == len(entries) assert 169 == entries[0].sgv - assert 9.38888888888889 == entries[0].sgv_mmol + assert 9.4 == entries[0].sgv_mmol assert "FortyFiveDown" == entries[0].direction assert -5.257 == entries[0].delta assert datetime(2020, 8, 5, 19, 1, 6, 533000, tzinfo=tzutc()) == entries[0].date From ab16e02f3949605a341c1988de70df15b5c83b72 Mon Sep 17 00:00:00 2001 From: Marcio Granzotto Date: Mon, 1 Nov 2021 18:34:25 -0300 Subject: [PATCH 2/2] Bump version to v1.3.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5ad42dd..9e6e282 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name="py_nightscout", - version="1.3.0", + version="1.3.1", description="A library that provides a Python async interface to Nightscout", long_description=README, long_description_content_type="text/markdown",