From 38fb0de40c9907f14178bb80d89d513e28e19c3e Mon Sep 17 00:00:00 2001 From: vingerha <44190435+vingerha@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:25:16 +0100 Subject: [PATCH 1/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 814a840..a132717 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ With any new update/version, I do not (!) verify if this is backwards compatible **latest** Note: 'latest' will see updates as and when I see fit wihtout much communication (other then below) and I am not guaranteeing it to work. +- added Punishments as sensor **0.5.0** - integrated pronotepy 2.7.0 From b5095b2ab49ced934dd1dcd6887e6a2dee7d0f02 Mon Sep 17 00:00:00 2001 From: vingerha <44190435+vingerha@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:26:02 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a132717..0eb4440 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ The integration will create a device per student/user and sensors for - Absence - Homework - Evaluation (Note: Evaluation is replacing Grade over time, i.e. 'mentions' instead of grade-values) +- Punishment Note for below, you need to install the card-mod from hacs The sensors can be made visible in Home Assistant using the markdown-card, an example is included. (https://github.com/vingerha/pronote2mqtt/blob/main/example_markdown.yaml) From a13d62b584f51ff7c8040eddd39a1cfe609ae73b Mon Sep 17 00:00:00 2001 From: vingerha <44190435+vingerha@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:29:39 +0100 Subject: [PATCH 3/4] Added Punishment --- example_markdown.yaml | 112 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/example_markdown.yaml b/example_markdown.yaml index 5e48b82..da5fc8e 100644 --- a/example_markdown.yaml +++ b/example_markdown.yaml @@ -400,3 +400,115 @@ tr:nth-child(n+2) > td:nth-child(2) { text-align: left; } + - type: markdown + content: | +
Punishments
+ + {% set dates = state_attr('sensor.pronote_parent_fanny_punishment','date')%} + + + + + + + {% for i in range(0, dates | count, 1) %} + + {% if state_attr('sensor.pronote_parent_fanny_punishment','exclusion')[i] == '1' %} + + {% else %} + + {% endif %} + + + + + {% endfor %} + card_mod: + style: + .: | + ha-card ha-markdown { + padding:0px + } + ha-markdown $: | + h1 { + font-weight: normal; + font-size: 24px; + } + div { + background-color:rgb(100, 100, 100); + padding: 12px 12px; + color:white; + font-weight:normal; + font-size:1.2em; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + } + table{ + border-collapse: collapse; + font-size: 0.9em; + font-family: Roboto; + width: auto; + outline: 0px solid #393c3d; + margin-top: 10px; + } caption { + text-align: center; + font-weight: bold; + font-size: 1.2em; + } td { + padding: 5px 5px 5px 5px; + text-align: left; + border-bottom: 0px solid #1c2020; + } + tr { + border-bottom: 0px solid #1c2020; + } + tr:nth-of-type(even) { + background-color: rgb(54, 54, 54, 0.3); + } + tr:last-of-type { + border-bottom: transparent; + } + mark { + background: green; + color: #222627; + border-radius: 5px; + padding: 5px; + } + span { + background: red; + color: #222627; + border-radius: 5px; + padding: 5px; + } + p { + background: lightgreen; + color: #222627; + border-radius: 5px; + padding: 5px; + } + strong { + background: red; + color: #222627; + border-radius: 5px; + padding: 5px; + } + em { + background: yellow; + color: #222627; + border-radius: 5px; + padding: 5px; + } + u { + background: lightblue; + color: #222627; + border-radius: 5px; + padding: 5px; + } + span { + padding: 5px; + } + tr:nth-child(n+2) > td:nth-child(2) { + text-align: left; + } From 070ddb14c8f117057af244d2ea0d1a5976e86200 Mon Sep 17 00:00:00 2001 From: vingerha <44190435+vingerha@users.noreply.github.com> Date: Sat, 19 Nov 2022 08:04:08 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0eb4440..ae878ea 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,8 @@ With any new update/version, I do not (!) verify if this is backwards compatible **latest** Note: 'latest' will see updates as and when I see fit wihtout much communication (other then below) and I am not guaranteeing it to work. -- added Punishments as sensor +- added Punishments as sensor IMPORTANT: pronotepy 'master' needed if you want to use if for student. pronotepy has a solution but not yet integrated in this one, still using pronotepy 2.7.0. + **0.5.0** - integrated pronotepy 2.7.0

Date

ReasonCourse

Punishment

Duration

+ + {{ dates[i]}}{{dates[i]}}{{ state_attr('sensor.pronote_parent_fanny_punishment','reasons')[i] }}{{ state_attr('sensor.pronote_parent_fanny_punishment','nature')[i] }}{{ state_attr('sensor.pronote_parent_fanny_punishment','duration')[i] }}