From f5475f36fb89a5683118b14e89f7a0246e3a6282 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 20 May 2023 13:24:27 -0400 Subject: [PATCH] Tweaks to my stream info macro --- custom_templates/status.jinja | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/custom_templates/status.jinja b/custom_templates/status.jinja index 9bcd93c..d77b3e9 100644 --- a/custom_templates/status.jinja +++ b/custom_templates/status.jinja @@ -129,13 +129,17 @@ Kallen is staying elsewhere overnight. {% endmacro %} {% macro twitchStreamInfo(method) %} -{% from 'time.jinja' import next_twitch_stream %} -{% set streamstart = state_attr('input_datetime.tony_streaming_start_time','timestamp') | timestamp_custom('%-I:%M %p',false) %} +{% from 'time.jinja' import next_twitch_stream, calendar_event_today %} +{% if is_state('input_boolean.tony_streaming_today','on') %} + {% set streamstart = state_attr('input_datetime.tony_streaming_start_time','timestamp') | timestamp_custom('%-I:%M %p',false) %} +{% else %} + {% set streamstart = as_timestamp(state_attr('calendar.tony_s_twitch_schedule','start_time')) | int | timestamp_custom('%-I:%M %p') %} +{% endif %} {% set game = state_attr('sensor.twitch_ironnerd24','game') %} {% set viewers = state_attr('sensor.twitch_ironnerd24','viewers') %} {% if is_state('sensor.twitch_ironnerd24','streaming') %} Tony is currently streaming. The current stream category is {{ game }}. The current viewer count is {{ viewers }}. -{% elif is_state('input_boolean.tony_streaming_today','on') %} +{% elif is_state('input_boolean.tony_streaming_today','on') or calendar_event_today('calendar.tony_s_twitch_schedule') %} {% if method == 'tts' %} {{ [ "Tony will be pretending to be a real content creator tonight. ",