Skip to content

Commit

Permalink
Const improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gillesvs committed Feb 3, 2024
1 parent f179441 commit 2ba1200
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion custom_components/librelink/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

NAME = "LibreLink"
DOMAIN = "librelink"
VERSION = "1.1.2b"
VERSION = "1.1.3"
ATTRIBUTION = "Data provided by https://libreview.com"
LOGIN_URL = "https://api.libreview.io/llu/auth/login"
CONNECTION_URL = "https://api.libreview.io/llu/connections"
Expand All @@ -29,3 +29,6 @@
]
MMOL_L = "mmol/L"
MG_DL = "mg/dL"
MMOL_DL_TO_MG_DL = 18
REFRESH_RATE_MIN = 1

4 changes: 2 additions & 2 deletions custom_components/librelink/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
LibreLinkApiAuthenticationError,
LibreLinkApiError,
)
from .const import DOMAIN, LOGGER
from .const import DOMAIN, LOGGER, REFRESH_RATE_MIN


class LibreLinkDataUpdateCoordinator(DataUpdateCoordinator):
Expand All @@ -37,7 +37,7 @@ def __init__(
hass=hass,
logger=LOGGER,
name=DOMAIN,
update_interval=timedelta(minutes=1),
update_interval=timedelta(minutes=REFRESH_RATE_MIN),
)

async def _async_update_data(self):
Expand Down
3 changes: 2 additions & 1 deletion custom_components/librelink/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
GLUCOSE_TREND_MESSAGE,
MG_DL,
MMOL_L,
MMOL_DL_TO_MG_DL,
)
from .coordinator import LibreLinkDataUpdateCoordinator

Expand Down Expand Up @@ -138,7 +139,7 @@ def native_value(self):
self.patients["glucoseMeasurement"][
"ValueInMgPerDl"
]
/ 18
/ MMOL_DL_TO_MG_DL
)
),
1,
Expand Down

0 comments on commit 2ba1200

Please sign in to comment.