diff --git a/custom_components/ecole_directe/ecole_directe_helper.py b/custom_components/ecole_directe/ecole_directe_helper.py index c0682da..5bf096d 100644 --- a/custom_components/ecole_directe/ecole_directe_helper.py +++ b/custom_components/ecole_directe/ecole_directe_helper.py @@ -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", ""), } @@ -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) diff --git a/custom_components/ecole_directe/manifest.json b/custom_components/ecole_directe/manifest.json index 5c023d5..63e2914 100644 --- a/custom_components/ecole_directe/manifest.json +++ b/custom_components/ecole_directe/manifest.json @@ -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" } \ No newline at end of file diff --git a/custom_components/ecole_directe/sensor.py b/custom_components/ecole_directe/sensor.py index ba9bd03..1d0b197 100644 --- a/custom_components/ecole_directe/sensor.py +++ b/custom_components/ecole_directe/sensor.py @@ -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"],