Git Product home page Git Product logo

hass-pronote's People

Contributors

delphiki avatar gaphi avatar vingerha avatar viper5000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hass-pronote's Issues

impossible de configurer Pronote pour la Guyane

Lors de la configuration automatique, l'adresse n'est pas comprise.
Il semble que ENT soit: WILAPA ou WILAPA-GUYANE
Via le Web voilà ce que je suis obligé de faire pour accéder à Pronote:

https://9730108e.index-education.net/pronote/
renvoie automatiquement sur
https://educonnect.education.gouv.fr/idp/profile/SAML2/Redirect/SSO?execution=e4s1
en se connectant sur cette adresse
Login et MDP
Cela renvoie sur l'adresse:
https://wilapa-guyane.com/auth/saml/wayf?callback=https%3A%2F%2Fwilapa-guyane.com%2Fcas%2Flogin%3Fservice%3Dhttps%253A%252F%252F9730108E.index-education.net%252Fpronote%252Fparent.html#/
Je clique sur "Parent"
https://wilapa-guyane.com/timeline/timeline
Puis en naviguant cliquer sur pronote.
Ensuite cela devient la bonne l'adresse
https://9730108e.index-education.net/pronote/parent.html?identifiant=zcnwsg5Z5G5MWZ92

Que dois-je faire pour pouvoir recevoir les infos via Home Assistant ?

Cordialement

Template

Bonjour, j'abuse surement, mais je débute et j'aimerais savoir s'il existait un template d'utilisation de ce module pour une implémentation plus facile pour les néophytes .
Merci

Integration ne fonctionne plus depuis la dernière update et bloque HA

Bonjour,

Depuis la dernière mise à jour, j'ai le message suivant dans les logs :
2023-10-21 22:33:58.968 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: pronote

Et mon home assistant n'arrive plus à fonctionner correctement.

Impossible d'aller dans les devices & services pour désactiver pronote, et du coup c'est tout cassé.

Comment faire ?

Merci,

Détails :
Version docker
Home Assistant 2023.10.4
Frontend 20231005.0 - latest

Se connecter en tant que Parents avec educonnect ?

Bonjour,
Je viens d'intégrer le module et je souhaite me connecter en tant que "Parents" via mes identifiants "Educonnect".
Pour le champ URL, je me suis connecté à Pronote via le site de l'établissement avec mes identifiants Educonnect puis j'ai fait un copier/Coller intégral du lien.
Dans identifiant et mot de passe, j'ai entré mes identifiants educonnect.
Dans le champs ENT, que dois-je mettre? sachant que je souhaite me connecter sur un collège de l'académie de Toulouse.
J'ai essayé avec occitanie_toulouse_edu, occitanie_toulouse, ecollege_haute_garonne_edu mais quand je valide, j'ai le emssage : Erreur authentification.
Merci beaucoup par avance pour votre aide.

Suggestion - Update of read me file for sensors

This suggestion could be tagged "documentation"...

This wonderful "BETA" integration have evolved in the last few monthes.

It would be great to reflect all the work performed in the various sensors in the readme file (and prepare the next phase after the BETA...).

More specificaly, while there is a nice table list with all the sensors, the various attributes of each sensor are not described. It would be great to have for each sensor:

  • at least a simple list of all attributes (maybe with a description of the behaviour if needed).
  • a simple card showing all atributes would be a nice addon (for example a simple entity or markdown card, without any fancy cardmod or theme).

Thanks again for all the work done !

"Erreur d'authentification", malgrés des login qui fonctionnent sur l'appli.

Bonjour,

J'ai cette erreur. Voici les infos que j'ai :

L'URL : https://xxxxxxxxxxx.index-education.net/pronote/
Mon nom d'utilisateur et le mot de passe, je n'ai pas de "ENT" à ma connaissance.

Voici l'erreur que je vois dans les log :

This error originated from a custom integration.

Logger: custom_components.pronote.config_flow
Source: custom_components/pronote/config_flow.py:59
Integration: Pronote (documentation, issues)
First occurred: 15:38:13 (2 occurrences)
Last logged: 15:40:11

Page html is different than expected. Be sure that pronote_url is the direct url to your pronote page.
('Decryption failed while trying to un pad. (probably bad decryption key/iv)', 'exception happened during login -> probably bad username/password')

J'ai bien sûr vérifié l'url plusieurs fois.

No devices or entries

Bonjour,
lors de l'intégration j'ai cette erreur
2023-09-25 16:54:09.174 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry DENIS Maïlys (via compte parent) for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 546, in async_unload
result = await component.async_unload_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 137, in async_unload_entry
return await component.async_unload_entry(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Je suis sur un HA sous docker en 2023.7.3 j'ai pris la dernière version de hass-pronote 0.8.1
Une autre point comment mettre à jour les informations de connexion.
Merci de votre aide

Invalid URL when trying to connect to pronote (val_doise)

Hi,

I am trying to configure pronote component.

I have verified all needed information as explained in docs. My user and password are working fine when connecting directly to pronote web app.

When trying to configure the component, I fill fields as following :

URL : https://0951403j.index-education.net/pronote/
User : firtname.lastname
Password : mypassword
ENT : val_doise

When validating, I caught this error : "Erreur d'authentification"

In home assistant logs, I have following error :

Logger: custom_components.pronote.config_flow
Source: custom_components/pronote/config_flow.py:60
Integration: Pronote (documentation, issues)
First occurred: 00:53:04 (11 occurrences)
Last logged: 01:56:19

HTTPSConnectionPool(host='ent0951403j.moncollege.valdoise.frparent.html', port=443): Max retries exceeded with url: / >(Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f5b12d610>: Failed to establish a new >connection: [Errno -2] Name does not resolve'))
Unable to connect to pronote, please try again later
Page html is different than expected. Be sure that pronote_url is the direct url to your pronote page.
Fail to connect with CAS https://cas.moncollege.valdoise.fr/login?selection=eleveparent : probably wrong login information

It seems that there is a missing '/' between url and parent.html. Plus, the URL used is not the one I specified.

Could you please have a look on this issue ?

Thanks,

Mattieu.

timetable_period exceed maximum size of 16384 bytes

Bonjour,
il y a l'avertissement suivant qui remonte dans mes logs.
J'ai l'impression que le "timetable_period" est un peu long. Il faudrait peut-être réduire la période remontée à 10 jours (ou 7 ou 12...).

Logger: homeassistant.components.recorder.db_schema
Source: components/recorder/db_schema.py:578
Integration: Recorder ([documentation](https://www.home-assistant.io/integrations/recorder), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+recorder%22))
First occurred: 6 novembre 2023 à 16:43:05 (116 occurrences)
Last logged: 06:45:24

State attributes for sensor.pronote_xxx_alice_timetable_period exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored
State attributes for sensor.pronote_xxx_sixtine_timetable_period exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

Pronote did not return ICal token

En version 0.6.0:

2023-09-13 23:59:54.515 ERROR (MainThread) [custom_components.pronote.coordinator] Error getting data from pronote: Pronote did not return ICal token
2023-09-13 23:59:54.518 ERROR (MainThread) [custom_components.pronote.coordinator] Unexpected error fetching XXX XXX (via compte parent) data: Pronote did not return ICal token
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pronote/coordinator.py", line 214, in _async_update_data
�
    raise ex
  File "/config/custom_components/pronote/coordinator.py", line 191, in _async_update_data
    self.data['ical_url'] = await self.hass.async_add_executor_job(client.export_ical)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pronotepy/clients.py", line 470, in export_ical
    raise ICalExportError("Pronote did not return ICal token")
pronotepy.exceptions.ICalExportError: Pronote did not return ICal token

Ajout de la séléction du trimestre ? [évaluations, absences]

Bonjour, d'abord merci pour votre travail c'est top,

en regardant un peu je penssais à une erreur en voyant que les evalutions était indisponible dans la liste des sensor (présent mais indispo)

En regardant le code je pense à présent qu'il s'agit simplement d'une entré vide car nous sommes pile dans la transition du second trimestre.

J'imagine que cette fonction ne retourne que la periode courante :

def get_evaluations(client):
    evaluations = client.current_period.evaluations
    evaluations = sorted(evaluations, key=lambda evaluation: (evaluation.name))
    return sorted(evaluations, key=lambda evaluation: (evaluation.date), reverse=True)

est- il possible d'imaginer récupérer toutes les périodes non vides et les attribuer à des sous-sensor ?
ou garder la structure sensor.pronote.xxx_evaluations qui reste pour le current et ajouter simplement :

  • sensor.pronote.xxx_evaluations_t1
  • sensor.pronote.xxx_evaluations_t2
  • sensor.pronote.xxx_evaluations_t3

et modifier

def get_evaluations(client, period):
    evaluations = client.[period].evaluations
    evaluations = sorted(evaluations, key=lambda evaluation: (evaluation.name))
    return sorted(evaluations, key=lambda evaluation: (evaluation.date), reverse=True)

et

try:
            self.data['evaluations'] = await self.hass.async_add_executor_job(get_evaluations, client, "current_period")
        except Exception as ex:
            _LOGGER.info("Error getting evaluations from pronote: %s", ex)

try:
            self.data['evaluations_t1'] = await self.hass.async_add_executor_job(get_evaluations, client, "trimestre1")
        except Exception as ex:
            _LOGGER.info("Error getting evaluations from pronote: %s", ex)

//etc

à noter que je ne connais pas du tout python c'est pourquoi je ne me lance pas dans une PR, je n'ai pas du tout épluché le requetes pronote et je ne comprend pas bien cette fonction non-plus : self.hass.async_add_executor_job(get_evaluations, client, "trimestre1")

Merci en tout cas cet ajout serais un plus mais c'est déjà très bien.

Remove false ERROR in logs

2023-09-15 16:12:57.734 ERROR (MainThread) [custom_components.pronote.coordinator] Error getting ical_url from pronote: Pronote did not return ICal token

Il ne s'agit pas d'une erreur mais d'une information lorsque les ical ne sont pas proposées par pronote, même s'il s'agit d'une exception au sens de l'informatique.

Peut-on déclasser ce log (et les similaires) pour alléger les fichiers système ?
Merci !

Error doing job: Task exception was never retrieved

Après la mise à jour en 0.13.3 (depuis une version bien plus ancienne), mes journaux sont remplis de :

2023-11-09 09:55:58.970 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 233, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 389, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 172, in async_update_listeners
    update_callback()
  File "/config/custom_components/portainer/entity.py", line 114, in _handle_coordinator_update
    self._data = self.coordinator.data[self.description.data_path][self._uid]
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'fa766f4f21a00706f49e97954ec945b60165f600fab0861ff649927781da5405'

Une idée ?

Erreur 'NoneType' and 'datetime.timedelta'

Bonjour,

Depuis ce matin, apres màj en version 0.13.3, j'ai l'erreur suivante qui apparait:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pronote/coordinator.py", line 183, in _async_update_data
    next_day_alarm = get_day_start_at(self.data['lessons_next_day']) - timedelta(minutes=alarm_offset)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'NoneType' and 'datetime.timedelta'

Ayant 2 enfants scolarisés dans 2 établissements différents, cela ne se produit que sur un seul des 2 comptes. J'ai tenté de supprimer et recréer le compte en erreur avec les méthodes URL+Password et QRCode mais j'arrive a la même erreur à chaque fois.

Erreurs avec 0.9.0

Celle-ci était déjà là dans 0.7.0
J'ai reconfiguré les comptes
L'erreur vient de la compte de mon file qui n'a pas de grades
Compte demo (parent fanny) ná pas de soucis
EDIT: j'ai vu tes changements dans coordinator et c'est app pareil que j'avais fait sur 070 local...curieux...je vais tester de plus

EDIT2: correction, comme dit avant, mon fils a recu un note mais sans grade.average (null) donc le float/re.sub échoue

EDIT3:, j'ai enlevé float/re.sub et ça marche .. je ne sais pas comment faire une if/then ici

Last logged: 06:58:47

Error adding entities for domain sensor with platform pronote
Error while setting up pronote platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1002, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 730, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 830, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 774, in _async_generate_attributes
    attr.update(self.extra_state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pronote/sensor.py", line 233, in extra_state_attributes
    'class_average': float(re.sub(',', '.', grade.average)),
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/re/__init__.py", line 185, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'

Absence du titre du contrôle noté

Dans la variable d'état *_grades, les notes ne disposent pas de la description du devoir qui apparaît pourtant sur le site www de pronote.

Serait-il possible de rajouter cette information par exemple "Interrogation révisions rentrée".

Merci !

problème de connexion

Bonjour, problème de connexion avec HA, tout est bien intégrer cependant j'ai trouver la source du problème:
mon adresse IP a été bloqué je penses par le trop grand nombre de demande ( toutes les 15minutes ) dans la journée, serait il possible de modifié ou de rendre modifiable ce paramètre de façon aisée ( au moment ou l'ont créer l'intégration avec le qrcode).

Par avance merci, très content de cette intégration je vous félicite.

Toulouse Edu problème de connection

Bonjour,
voici mon probleme, désormais il faut passer via educonnect, j'ai eu beau essayer l'académie toulouse EDu, cela ne fonctionne pas.
voici les logs que j'ai dans HA:

sept. 22 15:47:44 linux-t430 home-assistant[26445]: 2023-09-22 15:47:44.184 DEBUG (SyncWorker_11) [pronotepy.ent.generic_func] [ENT https://cas.mon-ent-occitanie.fr/login?selection=TOULO-EDU_parent_eleve&service=https://example.com/] Logging in with XXXXXXX
sept. 22 15:47:44 linux-t430 home-assistant[26445]: 2023-09-22 15:47:44.546 DEBUG (SyncWorker_11) [pronotepy.ent.generic_func] [EduConnect https://educonnect.education.gouv.fr/idp/profile/SAML2/POST/SSO?execution=e1s1] Logging in with XXXXXX
sept. 22 15:47:45 linux-t430 home-assistant[26445]: 2023-09-22 15:47:45.087 CRITICAL (SyncWorker_11) [custom_components.pronote.config_flow] Page html is different than expected. Be sure that pronote_url is the direct url to your pronote page.

day_start_at attributes not updated

L'attribut day_start_at des entités timetable (pronote_...timetable_today, pronote...timetable_next_day, pronote...timetable_tomorrow, pronote..._timetable_period) ne se met pas à jour.

Version 0.8.2

Aide sur le style card-mod

Bonsoir,
Je cherche à pouvoir utiliser l'attribut background-color issu d'un item de la classe sensor.pronote_ENFANT_timetable_today
Seulement cela n'affiche pas la bonne valeur.

Merci de votre aide

je pose ici le code de la carte , merci de me dire si ce n'est pas le bon endroit

type: markdown
content: >-
  {% set items =
  state_attr('sensor.pronote_xxxxx_maxime_timetable_today','lessons') %}
  <div>{{state_attr('sensor.pronote_xxxxx_maxime', 'full_name')|
  regex_replace('DENIS ','')}} - Emploi du temps du :
  {{as_timestamp(items[0].start_at) | int | timestamp_custom('%d/%m/%Y', true)}}
  </div>

  <table>   {% for i in range(0, items | count, 1) %}  <tr> 
    {%- if items[i].canceled != True -%} 
    <td style="background: {{ items[i].background_color }}; padding: 12px 12px; border-radius: 50px; ">&npsp;{{ items[i].background_color }}</td>
    <td><mark>{{ items[i].start_time}}</td> 
    <td><mark>{{ items[i].end_time }}</td></mark>
    <td>{{ items[i].lesson }}
  {% else %} <td><del>{{ items[i].start_time }}</td> <td><del>{{
  items[i].end_time}}</td> <td><del>{{ items[i].lesson }}</del>&emsp;{%- endif
  -%} {% if items[i].status != None %} <span> {{ items[i].status }}</td> {%
  endif %} <td> {{items[i].classroom }}</td> </tr> {% endfor %} </table> 
theme: Mushroom Square Shadow
card_mod:
  style:
    .: |
      ha-card ha-markdown {
        padding:0px
      }
      ha-card ha-markdown.no-header {
        padding:0px
      }
    ha-markdown$: |
      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: 100%;
        outline: 0px solid #393c3d;
        margin-top:5px;
      } caption {
          text-align: center;
          font-weight: bold;
          font-size: 1.2em;
      } td {
          padding: 5px 10px 5px 10px;
          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: #009767;
          color: #222627;
          border-radius: 5px;
          padding: 5px;
      }
      span {
          background: #EC4B34;
          color: #222627;
          border-radius: 5px;
          padding: 5px;
      }
      span {
          padding: 5px;
      }
      tr:nth-child(n+2) > td:nth-child(2) {
        text-align: left;
      }```

mise a jour de pronote

salut@delphiki, je voie qu'il y a une mise a jour tout les 15 minutes, peut tu nou laisse l'option de la mise a jour , car les week end et les vacances ca ne saire a rien.

ENT with multiple schools.

Hello,
I have a problem with the parent account login.
I have 3 children in different schools (primary and secondary). When I connect to the ENT to access pronote, I go through an intermediate page to select the school (primary or secondary). I don't think this page is a scenario envisaged in your script. Do you have a solution (other than using my children's account, which is the only option currently available)? Thanks.

Capture d’écran 2023-09-06 à 14 10 31

Pas de mise à jour

Bonjour,

Tout d'abord, beau boulot !

Sur mon installation Raspberry Pi3B+Docker+HA+HACS+Pronote, les données ne sont pas mises à jour...
D'où cela peut-il venir et comment corriger ? Je n'ai pas identifié le mécanisme de mise à jour dans les sources (mais je ne suis pas familier du python)

Merci !

Erreur quand infos non publiées

Mon lycée ne publie pas de menus ou d'évaluations, donc l'intégration ne se charge pas.
Erreur :
Unexpected error fetching TANDONNET Samuel data: 'ListeJours' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/pronote/coordinator.py", line 214, in _async_update_data raise ex File "/config/custom_components/pronote/coordinator.py", line 210, in _async_update_data self.data['menus'] = await self.hass.async_add_executor_job(client.menus, date.today(), date.today() + timedelta(days=7)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pronotepy/clients.py", line 646, in menus l_list = response["donneesSec"]["donnees"]["ListeJours"]["V"] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'ListeJours'
Serait-il donc possible de simplement noter ces sensors comme indisponibles ou ajouter une option pour ne pas les charger pour éviter d'empêcher l'intégration de fonctionner?

Quelques entitées manquantes (?)

Bonjour et merci pour l'intégration! C'est vraiment génial

J'ai découvert autour de la version 0.5 et je viens de faire une update directement en 0.8.2
Lié ou non, j'ai 6 entitées qui semblent etre manquantes:

pronote

J'ai tenté de comprendre les logs, mais à part cette ligne:

2023-09-29 08:28:03.196 INFO (MainThread) [custom_components.pronote.coordinator] Error getting ical_url from pronote: Pronote did not return ICal token
qui semble liée au capteur #5, je ne vois pas ce qui aurait pu changer ces derniers jours

Auriez-vous une piste?

Erreur au chargement du profil

Bonjour,

la configuration de l'intégration se passe bien, mais aucun sensor n'est créé et le journal me remonte cette erreur :

Error unloading entry NOM Prénom (via compte parent) for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 544, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 138, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Est-ce que cette erreur est connue ? Comment la corriger ?

Merci beaucoup !
Paul

from_state attributes partagés avec to_state

Lors des modifications des 'grades', je réalise le calcul des différences entre from_state.grades et to_state.grade (la dernière note n'est pas toujours la nouveauté de ce que j'ai pu observer)

Lors des tests unitaires, cela fonctionne très bien mais en live, la différence est toujours nulle (aucune modification détectée).
Est-ce qu'il serait possible que l'objet utilisé soit le même en mémoire pour ces 2 structures, ce qui expliquerait l'absence de différence ?

Si tel est le cas, serait-il possible d'y remédier ?

Merci d'avance

pronote.sensor issue after configuration in HA

Hi,

Thanks for you work !
I was able to enter URL + Login & password in the integration.
The configuration is done but I have this message in logs :

Unable to prepare setup for platform pronote.sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
00:22:06 – (ERREUR) setup.py

If you have an idea ?
Thanks in advance

Correspondance des dates incorrecte

Hello,

J'ai un petit soucis dans les données récupérées. J'ai vu une personne avoir le même problème dans le git des card pour lovelace.

Les données de today sont celles d'hier, et celles de tomorrow/next day sont celles d'aujourd'hui.

Quelqu'un a le même souci ?

Merci d'avance
Nicolas

Login with qrcode

Bonjour,
félicitations pour le travail accompli, malheureusement pour moi il m'est toujours impossible de me connecter, peut être que la connexion via qrcode pourrait solutionner mon problème.

[(https://pronotepy.readthedocs.io/en/stable/quickstart.html#logging-in-with-qr-code-recommended)]

Erreur d'authentification

Bonjour,

Merci pour votre travail ! Hâte de faire fonctionner cette intégration :D

J'ai réussi à installer HACS, je trouve maintenant bien l'intégration Pronote et j'ai l'invite de configuration. J'ai bien essayé plusieurs ENT, mais les autres indiquent une erreur de login, celui ci met un message de log différent:

2023-09-11 14:45:45.455 DEBUG (SyncWorker_11) [pronotepy.ent.generic_func] [EduConnect https://educonnect.education.gouv.fr/idp/profile/SAML2/Unsolicited/SSO?execution=e1s1] Logging in with xxx
2023-09-11 14:45:46.197 CRITICAL (SyncWorker_11) [custom_components.pronote.config_flow] Page html is different than expected. Be sure that pronote_url is the direct url to your pronote page.

Est-ce que vous auriez une idée de ce qui pourrait se passer ?

Merci d'avance

Pronote et skolengo authentification

Bonjour à tous,
j'a un soucis avec la configuration de l'integration pronote.
j'utilise Skolengo pour les notes, agenda et autres mais cela ne veux pas se logguer dans l'integration alors que cela fonctionne bien sur le site et l'application.
Es ce que quelqu'un pourrait me confirmer que cela fonctionne bien avec Skolengo ?
merci

initialisation

Hello,
I connect 3 pronote to my home assistant.
It works a few minute, then :
image

all sensors are unavailable.
nothing in logs

Thank's

HyperPlanning

Salut, merci pour ton intégration.

Mon école (privée) utilise une surcouche de pronote : hyperplanning.
Je peux générer un QRCode, voici le stacktrace lors d'un login via QRCode (l'erreur via URL ne te sera pas utile pour cette issue)

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421
First occurred: 10:13:13 (2 occurrences)
Last logged: 10:20:21

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pronote/config_flow.py", line 134, in async_step_qr_code_login
    client = await self.hass.async_add_executor_job(get_client_from_qr_code, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pronote/pronote_helper.py", line 51, in get_client_from_qr_code
    client = (pronotepy.ParentClient if data['account_type'] == 'parent' else pronotepy.Client).qrcode_login(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pronotepy/clients.py", line 135, in qrcode_login
    return cls(url, login, jeton, mode="qr_code", uuid=uuid)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pronotepy/clients.py", line 695, in __init__
    super().__init__(pronote_url, username, password, ent, mode, uuid)
  File "/usr/local/lib/python3.11/site-packages/pronotepy/clients.py", line 390, in __init__
    super().__init__(pronote_url, username, password, ent, mode, uuid)
  File "/usr/local/lib/python3.11/site-packages/pronotepy/clients.py", line 81, in __init__
    self.attributes, self.func_options = self.communication.initialise()
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pronotepy/pronoteAPI.py", line 85, in initialise
    raise PronoteAPIError(
pronotepy.exceptions.PronoteAPIError: Unable to connect to pronote, please try again later

Voici les informations du QRCode :

{"jeton":"46D57534E92D07CF5B3Fxxxxxxxxxxxxxx0F117D","login":"2798xxxxxx353C","url":"https://ifsovichy23-24.hyperplanning.fr/hp/mobile.etudiant"}

Je suis dispo en MP via Discord par exemple (gogui63), pour le debug 🍻
Voici également des URLS de test : https://www.index-education.com/fr/hyperplanning-info74-demo-des-espaces-web-et-mobile.php

Des infos sur l'API semblent dispo ici : https://www.index-education.com/fr/ServiceWeb-Hyperplanning-Cours.php

Impossible de lancer l'intégration pronote

Bonjour,

J'ai bien installé via HACS le composant pronote mais quand j'essaye de faire l'intégration pour la configuration la page de préparation à la configuration tourne en boucle.. Depuis le 0.7, j'ai ce comportement

State is not JSON serializable on punishments sensor

Here's an anonymised excerpt from my logs on HA:

State is not JSON serializable: <state sensor.pronote_xxx_punishments=1; updated_at=2023-10-20T14:18:18.214254+02:00, punishments=[{'date': '2023-10-17', 'subject': False, 'reasons': ['XXX'], 'circumstances': 'XXX', 'nature': 'Retenue', 'duration': '0:00:00', 'homework': '', 'exclusion': False, 'during_lesson': False, 'homework_documents': [{'name': 'xxx.pdf', 'url': 'https://xxx.index-education.net/pronote/FichiersExternes/xx/xxx.pdf?Session=xxx', 'type': 1}], 'circumstance_documents': [], 'giver': 'X', 'schedule': [{'start': datetime.datetime(2023, 10, 18, 13, 35), 'duration': datetime.timedelta(0)}], 'schedulable': True}], friendly_name=pronote_xxx_punishments @ 2023-10-20T14:18:18.214264+02:00>: Type is not JSON serializable: datetime.timedelta

I guess the problem stems from pronotepy passing in a timedelta object for schedules of punishments and that type not being natively translatable to a JSON string.

If you think that would work in this context, I can try locally applying something like this to the timedelta object (or others from the same question) and send a PR once tested on my instance.

Erreur après upgrade en 0.8

Hello

Tout marchait bien pour moi en 0.7
Upgrade en 0.8, reboot, et là j'ai ça comme erreur donnée par HA dans les notifications:

Home Assistant Core
Unable to prepare setup for platform pronote.sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
15:36:48 – (ERROR) setup.py

Les sensors associés au gamin sont maintenant absents de HA.

Je vais tenter d'effacer et remettre l'intégration, on va voir si ça change quelque chose.

EDIT: pareil après plusieurs reboot, suppression et réinstallation de la v0.8. Aucun sensor pronote créé

Suppression, puis réinstall de la 0.7, et ça fonctionne de nouveau, et les sensors sont de nouveau créés.

Informations du menu de la cantine

Hello,

Je me demandais s'il était possible de récupérer les informations du menu de la cantine pour le jour même et le lendemain ?

Je ne sais pas si ces informations sont récupérées par pronotepy, mais si c'est le cas, serait-ce possible de créer des sensors pour ces données ?

Merci d'avance
Nicolas

No device or entities

Hi,

After add Pronote, I have the name of my son, but I don't have device or entities.
It's strange.
I use ENT Essone.

Perhaps it's -- in the name the problem ?

Thanks for your help,

2023-09-20 19:59:19.442 DEBUG (SyncWorker_2) [pronotepy.ent.generic_func] [ENT https://www.moncollege-ent.essonne.fr/auth/login] Logging in with prenom.nom
2023-09-20 19:59:20.621 ERROR (MainThread) [custom_components.pronote.coordinator] Error getting data from pronote: 'NoneType' object does not support item assignment
2023-09-20 19:59:20.624 ERROR (MainThread) [custom_components.pronote.coordinator] Unexpected error fetching NAME1--NAME2 Prénom (via compte parent) data: 'NoneType' object does not support item assignment
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/pronote/coordinator.py", line 221, in _async_update_data
raise ex
File "/config/custom_components/pronote/coordinator.py", line 161, in _async_update_data
self.data['account_type'] = data['account_type']
~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object does not support item assignment
2023-09-20 19:59:20.634 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 431, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 834, in _async_write_ha_state
name := (entry and entry.name) or self._friendly_name_internal()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 766, in friendly_name_internal
name = self.name
^^^^^^^^^
File "/config/custom_components/pronote/sensor.py", line 117, in name
return f"{DOMAIN}
{self.coordinator.data['sensor_prefix']}"
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.