From 0fab037cbca38aef5880a9ad82bcb81b45873d76 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Tue, 27 Dec 2022 11:10:06 +0100 Subject: [PATCH] Extend time unit to years --- dashboard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard.py b/dashboard.py index f4167e7..5cf84bb 100644 --- a/dashboard.py +++ b/dashboard.py @@ -127,7 +127,10 @@ class Gauge(Widget): unit = self.lts.description["unit"] log.debug("unit = %s", unit) if unit == "s": - if value >= 86400: + if value >= 365.25 * 86400: + value /= 365.25 * 86400 + unit = "years" + elif value >= 86400: value /= 86400 unit = "days" elif value >= 3600: