Allow null LED bar mode in config responses - #687
Open
lin-hongkuan wants to merge 1 commit into
Open
Conversation
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? |
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. |
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.
Summary
Some AirGradient devices can return
"ledBarMode": nullfrom/configwhile the rest of the configuration payload is valid. The current model requiresled_bar_modeto always be aLedBarMode, so deserialization raisesInvalidFieldValuebefore consumers can use the rest of the response.Allow
Config.led_bar_modeto beNoneand add a regression test for that payload shape. This keeps existing enum values unchanged and still requires callers to pass a realLedBarModewhen 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