Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vingerha committed Dec 29, 2022
2 parents c232c6d + 070ddb1 commit 00c7374
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -43,6 +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 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
Expand Down
112 changes: 112 additions & 0 deletions example_markdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,115 @@
tr:nth-child(n+2) > td:nth-child(2) {
text-align: left;
}
- type: markdown
content: |
<div>Punishments</div>
<table>
{% set dates = state_attr('sensor.pronote_parent_fanny_punishment','date')%}
<tr>
<td><h4>Date<h3></td>
<td><h4>ReasonCourse</td>
<td><h4>Punishment</td>
<td><h4>Duration</td>
</tr>
{% for i in range(0, dates | count, 1) %}
<tr>
{% if state_attr('sensor.pronote_parent_fanny_punishment','exclusion')[i] == '1' %}
<td>
<strong>
{{ dates[i]}}</strong></td>
{% else %}
<td>{{dates[i]}}</td>
{% endif %}
<td>{{ state_attr('sensor.pronote_parent_fanny_punishment','reasons')[i] }}</td>
<td>{{ state_attr('sensor.pronote_parent_fanny_punishment','nature')[i] }}</td>
<td>{{ state_attr('sensor.pronote_parent_fanny_punishment','duration')[i] }}</td>
</tr>
{% 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;
}

0 comments on commit 00c7374

Please sign in to comment.