Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

51 utiliser des points au lieu de virgules dansles notes #53

Merged
merged 2 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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