Commit 4d78d1a
authored
Fix OverkizCommandParam STANDARD/HISTORICAL/ERROR/UNHEALTHY casing regression (#2126)
Follow-up to #2096.
## Problem
Four more `OverkizCommandParam` members were regressed from their
lowercase API state values to capitalized variants in #2085 — the same
bug class as `ON`/`OFF`/`UNKNOWN`/`BATTERY` (fixed in #2096):
| Member | Was | Now | Real lowercase source |
|--------|-----|-----|-----------------------|
| `STANDARD` | `"Standard"` | `"standard"` |
`io:MemorizedSimpleVolumeState`, `io:VentilationConfigurationModeState`,
`modbus:DHWModeState`, `modbus:YutakiDHWVirtualOperatingModeState` |
| `HISTORICAL` | `"Historical"` | `"historical"` | (Linky pair of
`STANDARD`) |
| `ERROR` | `"Error"` | `"error"` | `core:UpdateStatusState` |
| `UNHEALTHY` | `"Unhealthy"` | `"unhealthy"` |
`core:AirQualityIndexLevelState` |
The real Overkiz API returns these **state** values in lowercase, so
every equality comparison against these members silently fails —
breaking downstream consumers such as Home Assistant's `overkiz`
integration (e.g. DHW/ventilation state maps keyed on
`OverkizCommandParam.STANDARD`).
## Root cause
The capitalized values were harvested from *other* states that emit the
same word in different casing (`zigbee:LinkyModeState` →
`"Standard"`/`"Historical"`, `netatmo:HealthIndexState` →
`"Error"`/`"Unhealthy"`). Both casings are real API values, but they
collapse to one `SCREAMING_SNAKE` enum name. The generator's
alphabetical sort (codepoint order, capitals first) let the capitalized
catalog value claim the name and drop the lowercase value consumers
depend on — exactly the mechanism described in #2096.
## Fix
1. Restore the four values to lowercase in `pyoverkiz/enums/command.py`.
The generator's existing "preserve established value on a name
collision" guard now pins them on regeneration.
2. Extend the #2093 regression test (`TestOverkizCommandParamApiValues`)
to pin all four.
## Notes / follow-up
- `FAIR`/`POOR` were intentionally **left** as `"Fair"`/`"Poor"` — those
casings are the only values `netatmo:HealthIndexState` emits; no
lowercase variant exists in the API.
- The capitalized variants (`zigbee:LinkyModeState`
`"Standard"`/`"Historical"`, `netatmo:HealthIndexState`
`"Error"`/`"Unhealthy"`) are **dropped for now**. They're real state
values the single-name enum structurally can't represent alongside the
lowercase ones. Keeping both would require an explicit alias map in the
generator (e.g. `STANDARD_LINKY = "Standard"`) plus a hard failure on
unhandled collisions — tracked as a separate change.
## Verification
- `uv run utils/generate_enums.py` is idempotent — all four values stay
lowercase after regeneration (`+0 new` params).
- `uv run pytest tests/test_enums.py` — 10 passed.1 parent 2bfa37f commit 4d78d1a
2 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
1684 | | - | |
| 1684 | + | |
1685 | 1685 | | |
1686 | 1686 | | |
1687 | 1687 | | |
| |||
1771 | 1771 | | |
1772 | 1772 | | |
1773 | 1773 | | |
1774 | | - | |
| 1774 | + | |
1775 | 1775 | | |
1776 | 1776 | | |
1777 | 1777 | | |
| |||
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
2051 | | - | |
| 2051 | + | |
2052 | 2052 | | |
2053 | 2053 | | |
2054 | 2054 | | |
| |||
2089 | 2089 | | |
2090 | 2090 | | |
2091 | 2091 | | |
2092 | | - | |
| 2092 | + | |
2093 | 2093 | | |
2094 | 2094 | | |
2095 | 2095 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments