summaryrefslogtreecommitdiffstats
path: root/2configs/home/ham/lib/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-06-03 15:27:46 +0200
committermakefu <github@syntax-fehler.de>2023-06-03 15:27:46 +0200
commit5f8b941728d15caa0244f10109c1e18f355f91bb (patch)
tree6fef755c35d520c2f13e88d148035f4ec5558754 /2configs/home/ham/lib/default.nix
parent614f5911107e42d2ee2e6713dc387f773425ab1a (diff)
ma home: deploy home-assistant via docker
Diffstat (limited to '2configs/home/ham/lib/default.nix')
-rw-r--r--2configs/home/ham/lib/default.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/2configs/home/ham/lib/default.nix b/2configs/home/ham/lib/default.nix
index cf1c32abd..0d89d1e9e 100644
--- a/2configs/home/ham/lib/default.nix
+++ b/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)}}
-
'';
}
{
[cgit] Unable to lock slot /tmp/cgit/b7000000.lock: No such file or directory (2)