Fix OverkizCommandParam STANDARD/HISTORICAL/ERROR/UNHEALTHY casing regression#2126
Merged
Conversation
…gression Follow-up to #2096. Four more OverkizCommandParam members were regressed from their lowercase API state values to capitalized variants in #2085, the same way ON/OFF/UNKNOWN/BATTERY were: STANDARD = "Standard" -> "standard" # io/modbus DHW & ventilation states HISTORICAL = "Historical" -> "historical" ERROR = "Error" -> "error" # core:UpdateStatusState UNHEALTHY = "Unhealthy" -> "unhealthy" # core:AirQualityIndexLevelState The capitalized values were harvested from other states that happen to 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, and the alphabetical sort let the capitalized catalog value clobber the lowercase value downstream consumers (e.g. Home Assistant's overkiz integration) compare against. Restoring the lowercase values lets the generator's existing "preserve established value on a name collision" guard pin them on regeneration. The capitalized variants are dropped for now; representing both would need an explicit alias map (separate change). Extend the #2093 regression test to pin all four to their lowercase API state values.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up to #2096, fixing four additional OverkizCommandParam enum members (STANDARD, HISTORICAL, ERROR, UNHEALTHY) whose values were regressed from lowercase to capitalized in #2085. The real Overkiz API returns these state values in lowercase, so the capitalized values broke equality comparisons for downstream consumers like Home Assistant's overkiz integration.
Changes:
- Restored four
OverkizCommandParamvalues to their correct lowercase form inpyoverkiz/enums/command.py. - Extended the existing regression test class (
TestOverkizCommandParamApiValues) to pin all four new values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pyoverkiz/enums/command.py |
Changes ERROR, HISTORICAL, STANDARD, and UNHEALTHY enum values from capitalized to lowercase to match real API responses. |
tests/test_enums.py |
Adds four assertions to the existing regression test to pin the corrected lowercase values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2096.
Problem
Four more
OverkizCommandParammembers were regressed from their lowercase API state values to capitalized variants in #2085 — the same bug class asON/OFF/UNKNOWN/BATTERY(fixed in #2096):STANDARD"Standard""standard"io:MemorizedSimpleVolumeState,io:VentilationConfigurationModeState,modbus:DHWModeState,modbus:YutakiDHWVirtualOperatingModeStateHISTORICAL"Historical""historical"STANDARD)ERROR"Error""error"core:UpdateStatusStateUNHEALTHY"Unhealthy""unhealthy"core:AirQualityIndexLevelStateThe 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
overkizintegration (e.g. DHW/ventilation state maps keyed onOverkizCommandParam.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 oneSCREAMING_SNAKEenum 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
pyoverkiz/enums/command.py. The generator's existing "preserve established value on a name collision" guard now pins them on regeneration.TestOverkizCommandParamApiValues) to pin all four.Notes / follow-up
FAIR/POORwere intentionally left as"Fair"/"Poor"— those casings are the only valuesnetatmo:HealthIndexStateemits; no lowercase variant exists in the API.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.pyis idempotent — all four values stay lowercase after regeneration (+0 newparams).uv run pytest tests/test_enums.py— 10 passed.