From 1748e98bfc714e147c12b8fc233432412ed186c2 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 7 Dec 2023 01:03:23 +0100 Subject: [PATCH] Themes: don't show opening_hours_state title icon if seasonal is set and the item is closed due to seasonal restrictions --- assets/layers/icons/icons.json | 36 +++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/assets/layers/icons/icons.json b/assets/layers/icons/icons.json index 872139f7e..289172380 100644 --- a/assets/layers/icons/icons.json +++ b/assets/layers/icons/icons.json @@ -77,7 +77,41 @@ "icon": { "class": "w-20 mx-1 flex items-center" }, - "render": "{opening_hours_state()}" + "render": "{opening_hours_state()}", + "condition": { + "or": [ + "seasonal=", + "seasonal=no", + { + "or": [ + { + "and": [ + "seasonal~.*winter.*", + "_now:date~....-(12|01|02)-.." + ] + }, + { + "and": [ + "seasonal~.*spring.*", + "_now:date~....-(03|04|05)-.." + ] + }, + { + "and": [ + "seasonal~.*summer.*", + "_now:date~....-(06|07|08)-.." + ] + }, + { + "and": [ + "seasonal~.*autumn.*", + "_now:date~....-(09|10|11)-.." + ] + } + ] + } + ] + } }, { "id": "phonelink",