You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The localizations could be implemented in the code but not the translation file.
The template is more difficult because it needs to have multiple if statements to support everything (This is currently done in the python code). But i will look into it
Idea:
Have event triggers for different types of events like "room change", "lesson cancelled"...
Plus have services to get changed rooms, cancelled lessons (maybe this is not even necessary, the action "webuntis.get_timetable" should contain this information already, and could be filtered)
The results of this service could be used to create custom notifications.
However, this requries some knowledge about processing the json result.
I use a template sensor like this for room changes:
{% set lessonList = namespace(lesson=[]) %}
{% set count = namespace(value=0) %}
{% set count.value = 0 %}
{% set lessons = state_attr("sensor.NAME-GOES-HERE_next_lesson_to_wake_up", "day") | from_json %}
{% for lesson in lessons -%}
{%- if lesson.original_rooms.0 is defined -%}
{% set lessonList.lesson = lessonList.lesson + [lesson.subjects.0.long_name] %}
{% set count.value = count.value + 1 %}
{%- endif -%}
{%- endfor %}
{%- if count.value == 0 -%}
Keine Raumwechsel
{%- else -%}
{{ lessonList.lesson | unique | join(', ')+" " }}
{%- endif -%}
or this one for "Vertretungslehrer"
{% set lessonList = namespace(lesson=[]) %}
{% set count = namespace(value=0) %}
{% set count.value = 0 %}
{% set lessons = state_attr("sensor.NAME-GOES-HERE_next_lesson_to_wake_up", "day") | from_json %}
{% for lesson in lessons -%}
{%- if lesson.original_teachers.0 is defined -%}
{% set lessonList.lesson = lessonList.lesson + [lesson.subjects.0.long_name] %}
{% set count.value = count.value + 1 %}
{%- endif -%}
{%- endfor %}
{%- if count.value == 0 -%}
Keine Vertretungslehrer
{%- else -%}
{{ lessonList.lesson | unique | join(', ')+" " }}
{%- endif -%}
Hey - I would appreciate it if we could have personal notification templates and also localizations of the strings in it.
Any chance?
The text was updated successfully, but these errors were encountered: