Skip to content

Commit

Permalink
Merge pull request #53 from hacf-fr/51-utiliser-des-points-au-lieu-de…
Browse files Browse the repository at this point in the history
…-virgules-dansles-notes

51 utiliser des points au lieu de virgules dansles notes
  • Loading branch information
Giga77 authored Nov 23, 2024
2 parents ac8d826 + 2fd3475 commit d8fb04b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions custom_components/ecole_directe/ecole_directe_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,10 @@ def get_grades_evaluations(token, eleve, annee_scolaire, config_path):
response["disciplines"] = get_disciplines_periode(periode_json)
if periode_json["ensembleMatieres"]:
response["moyenne_generale"] = {
"moyenneGenerale": periode_json["ensembleMatieres"].get("moyenneGenerale", ""),
"moyenneClasse": periode_json["ensembleMatieres"].get("moyenneClasse", ""),
"moyenneMin": periode_json["ensembleMatieres"].get("moyenneMin", ""),
"moyenneMax": periode_json["ensembleMatieres"].get("moyenneMax", ""),
"moyenneGenerale": periode_json["ensembleMatieres"].get("moyenneGenerale", "").replace(",","."),
"moyenneClasse": periode_json["ensembleMatieres"].get("moyenneClasse", "").replace(",","."),
"moyenneMin": periode_json["ensembleMatieres"].get("moyenneMin", "").replace(",","."),
"moyenneMax": periode_json["ensembleMatieres"].get("moyenneMax", "").replace(",","."),
"dateCalcul": periode_json["ensembleMatieres"].get("dateCalcul", ""),
}

Expand Down Expand Up @@ -580,10 +580,10 @@ def get_disciplines_periode(data):
for discipline_json in data["ensembleMatieres"]["disciplines"]:
discipline = {
"name": discipline_json.get("discipline", "").lower(),
"moyenne": discipline_json.get("moyenne", ""),
"moyenneClasse": discipline_json.get("moyenneClasse", ""),
"moyenneMin": discipline_json.get("moyenneMin", ""),
"moyenneMax": discipline_json.get("moyenneMax", ""),
"moyenne": discipline_json.get("moyenne", "").replace(",","."),
"moyenneClasse": discipline_json.get("moyenneClasse", "").replace(",","."),
"moyenneMin": discipline_json.get("moyenneMin", "").replace(",","."),
"moyenneMax": discipline_json.get("moyenneMax", "").replace(",","."),
"appreciations": discipline_json.get("appreciations", ""),
}
disciplines.append(discipline)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ecole_directe/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"documentation": "https://github.com/hacf-fr/hass-ecoledirecte",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/hacf-fr/hass-ecoledirecte/issues",
"version": "0.3.17"
"version": "0.3.18"
}
1 change: 1 addition & 0 deletions custom_components/ecole_directe/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def extra_state_attributes(self):

return {
"updated_at": self.coordinator.last_update_success_time,
"nom": discipline["name"],
"moyenneClasse": discipline["moyenneClasse"],
"moyenneMin": discipline["moyenneMin"],
"moyenneMax": discipline["moyenneMax"],
Expand Down

0 comments on commit d8fb04b

Please sign in to comment.