Extend time unit to years
This commit is contained in:
parent
74c6a19302
commit
0fab037cbc
|
@ -127,7 +127,10 @@ class Gauge(Widget):
|
||||||
unit = self.lts.description["unit"]
|
unit = self.lts.description["unit"]
|
||||||
log.debug("unit = %s", unit)
|
log.debug("unit = %s", unit)
|
||||||
if unit == "s":
|
if unit == "s":
|
||||||
if value >= 86400:
|
if value >= 365.25 * 86400:
|
||||||
|
value /= 365.25 * 86400
|
||||||
|
unit = "years"
|
||||||
|
elif value >= 86400:
|
||||||
value /= 86400
|
value /= 86400
|
||||||
unit = "days"
|
unit = "days"
|
||||||
elif value >= 3600:
|
elif value >= 3600:
|
||||||
|
|
Loading…
Reference in New Issue