diff options
author | makefu <github@syntax-fehler.de> | 2023-06-03 15:27:46 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2023-06-03 15:27:46 +0200 |
commit | be3284417942c0164c1b32c9cf34ba44bcfb86c3 (patch) | |
tree | 4302b9ce28125003e4daf5ae411f65cef58537ef /makefu/2configs/home/ham/lib | |
parent | dd0a6294c8699640f47127f237104aac9d96c896 (diff) |
ma home: deploy home-assistant via docker
Diffstat (limited to 'makefu/2configs/home/ham/lib')
-rw-r--r-- | makefu/2configs/home/ham/lib/default.nix | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/makefu/2configs/home/ham/lib/default.nix b/makefu/2configs/home/ham/lib/default.nix index cf1c32abd..0d89d1e9e 100644 --- a/makefu/2configs/home/ham/lib/default.nix +++ b/makefu/2configs/home/ham/lib/default.nix @@ -27,12 +27,11 @@ in #} { delay.seconds = 1; } { delay = '' - {% set duration = state_attr("${entity}","media_duration") %} - {% set seconds = duration % 60 %} + {% set duration = state_attr("${entity}","media_duration") or 0 %} + {% set seconds = (duration % 60 ) %} {% set minutes = (duration / 60)|int % 60 %} {% set hours = (duration / 3600)|int %} {{ "%02i:%02i:%02i"|format(hours, minutes, seconds)}} - ''; } { |