Skip to content

Commit

Permalink
Merge pull request #6 from marciogranzotto/marcio/round-mmol-sgv
Browse files Browse the repository at this point in the history
Round mmol/L SGV to 1 decimal point
  • Loading branch information
marciogranzotto authored Nov 1, 2021
2 parents d487a12 + ab16e02 commit 7cb2e50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion py_nightscout/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cb2e50

Please sign in to comment.