From 16d105b70ba09a8f0c451ac7e11e133450bfeb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Thu, 17 Mar 2022 01:51:31 +0100 Subject: [PATCH] Hide member list if it is empty for valid SpaceAPI --- templates/status.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/status.json b/templates/status.json index 5990415..6d61d96 100644 --- a/templates/status.json +++ b/templates/status.json @@ -18,8 +18,8 @@ "sensors": { "people_now_present": [ { - "value": {{"sensor/space/member/present" | mqtt | jsonize "int"}}, - "names": {{"sensor/space/member/names" | mqtt | csvlist | jsonize "[]string"}} + "value": {{"sensor/space/member/present" | mqtt | jsonize "int"}}{{$names := "sensor/space/member/names" | mqtt}}{{if ne $names ""}}, + "names": {{$names | csvlist | jsonize "[]string"}}{{end}} } ], "space_members": [