Tweaks to my stream info macro

This commit is contained in:
2023-05-20 13:24:27 -04:00
parent 52c0c3c7a6
commit f5475f36fb

View File

@ -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. ",