From 063cc9e14fb82ff7ac22288e107184b52041c3a8 Mon Sep 17 00:00:00 2001 From: Laubau Date: Sat, 14 Feb 2026 12:35:48 +0100 Subject: [PATCH 1/2] Added TREND_MESSAGE constant --- custom_components/libreview/const.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/custom_components/libreview/const.py b/custom_components/libreview/const.py index f295424..d494994 100755 --- a/custom_components/libreview/const.py +++ b/custom_components/libreview/const.py @@ -25,7 +25,13 @@ 4: "mdi:arrow-top-right-thick", 5: "mdi:arrow-up-thick", } - +TREND_MESSAGE = { + 1: "decreasing_fast", + 2: "decreasing", + 3: "stable", + 4: "increasing", + 5: "increasing_fast", +} class GlucoseUnitOfMeasurement(Enum): MMOLL = "mmol/L" From 899b3d0fae3a80dc479328b2eaacc2086bd152c0 Mon Sep 17 00:00:00 2001 From: Laubau Date: Sat, 14 Feb 2026 12:36:19 +0100 Subject: [PATCH 2/2] Added trend and measurement_timestamp as extra_state_attributes --- custom_components/libreview/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/libreview/sensor.py b/custom_components/libreview/sensor.py index 2975a3b..92ec566 100644 --- a/custom_components/libreview/sensor.py +++ b/custom_components/libreview/sensor.py @@ -149,4 +149,6 @@ def extra_state_attributes(self) -> Dict[str, int | float]: "target_low_mmol_l": round(self.connection.target_low / 18, 1), "target_high_mg_dl": self.connection.target_high, "target_low_mg_dl": self.connection.target_low, + "trend": TREND_MESSAGE.get(self.trend_arrow, "unknown"), + "measurement_timestamp": self.gcm.factory_timestamp.replace(tzinfo=UTC), }