From ed2263932792cc61662b9406edc9ac6ede1d6e12 Mon Sep 17 00:00:00 2001 From: ccostan Date: Fri, 5 Jan 2018 15:42:02 -0500 Subject: [PATCH] Updates to a nice clean Days, Hours, Minute format. --- sensor/hass_stats.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sensor/hass_stats.yaml b/sensor/hass_stats.yaml index c4b53ddd..318381af 100755 --- a/sensor/hass_stats.yaml +++ b/sensor/hass_stats.yaml @@ -24,4 +24,18 @@ {%- endif -%} {{ ', ' }} {%- endif -%} - {{ '%02d' % hours }}:{{ '%02d' % minutes }} + {%- if hours > 0 -%} + {%- if hours == 1 -%} + 1 hour + {%- else -%} + {{ hours }} hours + {%- endif -%} + {{ ', ' }} + {%- endif -%} + {%- if minutes > 0 -%} + {%- if minutes == 1 -%} + 1 minute + {%- else -%} + {{ minutes }} minutes + {%- endif -%} + {%- endif -%}