You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix event parsing: use correct PlantEventDTO field names
The coordinator was mapping non-existent API fields (message,
timestamp, circuitPath, isActive) instead of the actual PlantEventDTO
fields (description, timeOccurred, sourcePath, timeResolved). This
caused all event sensors to show None and the error binary sensor
to never trigger.
Changes:
- Map correct API fields: description, timeOccurred, timeResolved,
sourcePath, code
- Derive is_active from timeResolved (null = active) instead of
non-existent isActive field
- Add warning events to has_error detection (was only blocking/locking)
- Extract _parse_event() helper for DRY event parsing
- Update sensor value_fn lambdas for renamed dataclass fields
- Update diagnostics PII redaction for renamed fields
- Add 7 tests for event parsing and is_active logic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ The integration lives in `custom_components/hoval_connect/`. User setup is email
30
30
-`fan.py` — Fan entity for HV ventilation: 0–100% speed slider (`FanEntityFeature.SET_SPEED`), on/off toggle (standby ↔ temporary-change), debounced slider input (1.5s), proper cleanup via `async_will_remove_from_hass`. Only created for HV circuits.
31
31
-`select.py` — Select entity for program selection (week1/week2/ecoMode/standby/constant). Shows user-defined program names from the API (`circuit.program_names`), falls back to `DEFAULT_NAMES`. Bidirectional mapping via `_display_name()` / `_api_key_from_display()`. Only created for HV/HK circuits.
32
32
-`sensor.py` — 9 sensor entities per circuit (outside temp, exhaust temp, air volume, humidity actual/target, operation mode, active week/day program, program air volume) + 6 plant-level sensors (latest event type/message/time, active event count, weather condition/temperature). Diagnostic sensors use `EntityCategory.DIAGNOSTIC`.
33
-
-`binary_sensor.py` — 2 binary sensors per plant (online status with connectivity class, error status with problem class)
33
+
-`binary_sensor.py` — 2 binary sensors per plant (online status with connectivity class, error/warning status with problem class — triggers on active blocking/locking/warning events)
34
34
-`diagnostics.py` — Diagnostic data export with automatic PII redaction
- The integration fetches circuits via v1 but controls via v3 — coordinator normalizes v1 values to v3 via `_V1_PROGRAM_MAP`
94
94
- Weather forecast available via `get_weather()` — returns condition + temperature
95
+
-`PlantEventDTO` fields: `eventType`, `description`, `timeOccurred`, `timeResolved`, `sourcePath`, `code`, `module`, `functionGroup`, `function`, `category` — event is active when `timeResolved` is null
96
+
- Event types: `locking`, `blocking`, `warning`, `info`, `offline`, `ok` — the error binary sensor triggers on active `blocking`, `locking`, or `warning` events
0 commit comments