droso-hass / idfm

Custom component for ile de france mobilités
14 stars 3 forks source link

Certaines gares ne fonctionnent pas. #4

Closed dextouu closed 2 years ago

dextouu commented 2 years ago

Bonjour, j'ai essayé la ligne D et la R ne fonctionnent pas quand on sélectionne certaines gares. ( ligne D: Melun, ligne R: Fontainebleau) melun


Source: /usr/local/lib/python3.9/site-packages/idfm_api/__init__.py:30
First occurred: 05:59:26 (3 occurrences)
Last logged: 05:59:28

Error while fetching information from https://api-iv.iledefrance-mobilites.fr/lines/line:IDFM:C01731/stops/stop_area:IDFM:61145/realTime - None
jugla commented 2 years ago

Same issue on some bus line. The "any" direction does not seems to work well. If I change the bus stop, it seems to be ok. Here after the logs : ` 2022-04-16 14:13:42 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session 2022-04-16 14:13:42 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connector 2022-04-16 14:13:42 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.idfm 2022-04-16 14:13:42 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.idfm 2022-04-16 14:13:42 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.idfm entity: sensor.idfm_mairie_sceaux_any_0 2022-04-16 14:13:42 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.idfm entity: sensor.idfm_mairie_sceaux_any_1 2022-04-16 14:13:42 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.idfm entity: sensor.idfm_mairie_sceaux_any_2 2022-04-16 14:13:42 ERROR (MainThread) [idfm_api] Error while fetching information from https://api-iv.iledefrance-mobilites.fr/lines/line:IDFM:C01213/stops/stop_area:IDFM:70010 /realTime - None 2022-04-16 14:13:42 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.idfm entity: binary_sensor.idfm_192_ratp_mairie_sceaux

`

Here what is shown on dashboard image

NB : if you go on other bus stop , the integration works. Addition to "ANY" there are direction values. The issue is linked to this ?

jugla commented 2 years ago

My guess in error value, you have realTime - None If the guess is ok, perhaps, can you add an attribute saying that realTime is not provided for this station

drosoCode commented 2 years ago

@dextouu Cela devrait etre corrigé dans la nouvelle version (1.1.3), pouvez-vous tester ?

drosoCode commented 2 years ago

@jugla It seems like the bus stop "Mairie - Sceaux" doesn't provide any realtime information (see here) , while the others bus stops does (like this one).

I don't really see the point of adding an attribute just to say that the data is not avaialable as this is already reported by home assistant with the state "Inconnu".

jugla commented 2 years ago

For unknown state, I understand what you said. No real time --> unknown. It's more if you want to report error to the user , it's easier if you have a dedicated attribute (let's say on the binary sensor)

drosoCode commented 2 years ago

I think that an attribute would be more suited for a value that changes, here the "no real time" is probably something that will not change, so I think that's fine to just reaport it as an error in the logs.

jugla commented 2 years ago

attribute will be fine ;-)