Skip to content

Allow null LED bar mode in config responses - #687

Open
lin-hongkuan wants to merge 1 commit into
Open-Air-Foundation:mainfrom
lin-hongkuan:codex/airgradient-null-led-bar-mode
Open

Allow null LED bar mode in config responses#687
lin-hongkuan wants to merge 1 commit into
Open-Air-Foundation:mainfrom
lin-hongkuan:codex/airgradient-null-led-bar-mode

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Summary

Some AirGradient devices can return "ledBarMode": null from /config while the rest of the configuration payload is valid. The current model requires led_bar_mode to always be a LedBarMode, so deserialization raises InvalidFieldValue before consumers can use the rest of the response.

Allow Config.led_bar_mode to be None and add a regression test for that payload shape. This keeps existing enum values unchanged and still requires callers to pass a real LedBarMode when setting the LED bar mode.

This is the dependency-layer fix for home-assistant/core#168434.

Validation

  • .venv\\Scripts\\python.exe -m pytest -o addopts=--cov=airgradient tests -q
  • .venv\\Scripts\\ruff check src tests
  • .venv\\Scripts\\ruff format --check src tests
  • .venv\\Scripts\\mypy src

@lin-hongkuan

Copy link
Copy Markdown
Author

The failing Verify check appears to be the PR label gate from .github/workflows/pr-labels.yaml. This should be labeled �ugfix, but I don't have permission to add labels to the upstream repository. Could a maintainer please add the �ugfix label?

@lin-hongkuan

Copy link
Copy Markdown
Author

The Verify job is failing only because this PR does not currently have one of the required type labels. I do not have permission to add labels in this repository; \�ugfix\ seems appropriate for this change.

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.

1 participant