Session status event without `sessionEnergy` kills the websocket reader (MissingField in PeblarSessionMeterData)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Start by reading PeblarSessionMeterData and PeblarSessionStatus.from_dict() in the package, then trace the session status callback and _read_messages error handling mentioned in the traceback. Check the existing tests for session status payloads and add coverage for the shown payload without sessionEnergy and for malformed messages. Done when the status parses and a bad payload does not terminate the websocket reader.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
With no car connected, the charger's session status event carries a meter_data object without sessionEnergy. PeblarSessionMeterData declares session_energy as a required int, so PeblarSessionStatus.from_dict() raises and the websocket reader task dies. The charger sends the current status right after subscribing, so this happens on every connect while no car is plugged in.
Payload received (energy counter rounded):
{'instantaneousPower': [0, 0, 0], 'totalEnergy': 1700000}
Traceback
mashumaro.exceptions.MissingField: Field "session_energy" of type int is missing in PeblarSessionMeterData instance
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/peblar/websocket.py", line 41, in async_run
await self._async_listen()
File "/usr/local/lib/python3.14/site-packages/peblar/websocket.py", line 209, in disconnect
await self._reader
File "/usr/local/lib/python3.14/site-packages/peblar/websocket.py", line 267, in _read_messages
self._handle_message(payload)
File "/usr/local/lib/python3.14/site-packages/peblar/websocket.py", line 323, in _handle_message
callback(data)
File "/usr/local/lib/python3.14/site-packages/peblar/websocket.py", line 129, in <lambda>
lambda data: callback(PeblarSessionStatus.from_dict(data)),
mashumaro.exceptions.InvalidFieldValue: Field "meter_data" of type Optional[PeblarSessionMeterData] in PeblarSessionStatus has invalid value {'instantaneousPower': [0, 0, 0], 'totalEnergy': 1700000}
Effect in Home Assistant
The exception is a mashumaro error, not a PeblarError, so the retry loop in the integration's PeblarSessionListener.async_run does not catch it. The listener task ends with "Task exception was never retrieved" (once per start) and is not restarted until the entry is reloaded. Polling continues, so entities keep updating; only the early refresh on a session change is lost.
Expected
A session status without sessionEnergy parses (field optional, or defaulting to 0), and a payload that fails to parse does not end the reader. The comment in _read_messages already states that intent for unparsable JSON.
Versions
- peblar 2.1.0
- Home Assistant Core 2026.11.2
- Charger firmware 1.10.0+1+WL-1, customization Peblar-1.16
- State at the time: no EV connected
- Lenguaje dominante
- Python
- Estrellas
- 12
- Forks
- 10
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de frenck/python-peblar
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
frenck/python-peblar#466 · 1 comentario ·
-
Dependency DashboardAbiertono-stale
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
frenck/python-peblar#4 ·
Todos los issues de frenck/python-peblar
Issues similares
-
docs(contributing): the two things that silently block a PRPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoavailable documentation good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 95/100
Nixitov/Riptide-Native#944 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
JTHCode/secretguard#24 ·
Los mantenedores suelen responder en 1 día
-
area: middleware documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
omarelshamy25x/shamy-hijri#63 ·
Los mantenedores suelen responder en 1 día