Created
November 5, 2025 21:28
-
-
Save Muspi/ddaebabc144a498fd8fa6e66a3f02c31 to your computer and use it in GitHub Desktop.
Home assistant Jinja widget for pronote
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% set now = now() %} | |
| {% set enfants = [ | |
| {"name":"Raphaรซl","emoji":"๐ฆ","today":state_attr("sensor.pronote_millon_raphael_today_s_timetable","lessons"),"tomorrow":state_attr("sensor.pronote_millon_raphael_tomorrow_s_timetable","lessons"),"color":"#1E88E5"}, | |
| {"name":"Baptiste","emoji":"๐ง","today":state_attr("sensor.pronote_millon_baptiste_today_s_timetable","lessons"),"tomorrow":state_attr("sensor.pronote_millon_baptiste_tomorrow_s_timetable","lessons"),"color":"#43A047"} | |
| ] %} | |
| {% for e in enfants %} | |
| {% set next_cours = namespace(text="") %} | |
| {% if e.today %} | |
| {% for cours in e.today %} | |
| {% set start = as_local(cours.start_at) %} | |
| {% if start > now and not next_cours.text %} | |
| {% set next_cours.text = "<div style='color:"+e.color+"; font-weight:bold;'>"+e.emoji+" "+e.name+"</div>" ~ | |
| "<div style='margin-left:5px;'>๐ง "+cours.lesson+" ๐ "+(cours.classroom | default("N/A"))+" ๐ "+start.strftime('%H:%M')+"</div>" %} | |
| {% endif %} | |
| {% endfor %} | |
| {% endif %} | |
| {% if not next_cours.text %} | |
| {% if e.tomorrow and e.tomorrow|length>0 %} | |
| {% set start = as_local(e.tomorrow[0].start_at) %} | |
| {% set next_cours.text = "<div style='color:"+e.color+"; font-weight:bold;'>"+e.emoji+" "+e.name+"</div>" ~ | |
| "<div style='margin-left:5px;'>๐ ๐ง "+e.tomorrow[0].lesson+" ๐ "+(e.tomorrow[0].classroom | default("N/A"))+" ๐ "+start.strftime('%H:%M')+"</div>" %} | |
| {% else %} | |
| {% set next_cours.text = "<div style='color:"+e.color+"; font-weight:bold;'>"+e.emoji+" "+e.name+"</div>" ~ | |
| "<div style='margin-left:5px;'>๐ Pas de cours prรฉvu</div>" %} | |
| {% endif %} | |
| {% endif %} | |
| {{ next_cours.text }} | |
| {% if not loop.last %} | |
| <br> | |
| {% endif %} | |
| {% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment