Skip to content

Fix AdvantiumCookAction and AdvantiumWarmStatus ValueError for unknown enum values#110

Open
floydpink wants to merge 1 commit intosimbaja:masterfrom
floydpink:master
Open

Fix AdvantiumCookAction and AdvantiumWarmStatus ValueError for unknown enum values#110
floydpink wants to merge 1 commit intosimbaja:masterfrom
floydpink:master

Conversation

@floydpink
Copy link
Copy Markdown

Fixes #109

Problem

The _missing_ methods for AdvantiumCookAction and AdvantiumWarmStatus raise ValueError for unrecognized values sent by the appliance (e.g., values 38 and 250). The converter's try/except catches this and falls back to a completely empty ErdAdvantiumCookSetting(), discarding all fields. This error logs every ~30 seconds, filling the Home Assistant log with noise.

Fix

Return a safe default (UNKNOWN / OFF) for any unrecognized value instead of raising. This matches the pattern already used by AdvantiumCookMode._missing_, which returns NO_MODE for values 153, 223, and 253.

Effect

  • Before: unknown enum value → ValueError → entire cook setting discarded, error logged
  • After: unknown enum value → safe default → full cook setting preserved (temperature, power level, cook time, etc. all come through), no error logged

No side effects — UNKNOWN and OFF are existing enum values already handled by downstream code.

…n enum values

The _missing_ methods for AdvantiumCookAction and AdvantiumWarmStatus raise
ValueError for unrecognized values sent by the appliance (e.g., 38 and 250).
This causes noisy error logs every ~30 seconds even though the converter
catches the exception and falls back to a default.

Return a safe default (UNKNOWN/OFF) for any unrecognized value, matching the
pattern already used by AdvantiumCookMode._missing_.

Fixes simbaja#109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdvantiumCookAction and AdvantiumWarmStatus raise ValueError for valid appliance values

1 participant