-
-
Notifications
You must be signed in to change notification settings - Fork 36.5k
Simplify availability property in WLED #157800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hey there @frenck, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
frenck
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR simplifies the availability property implementation across WLED segment entities by replacing a try/except KeyError pattern with a more Pythonic in operator check. This addresses a technical debt item tracked in the quality scale configuration.
- Replaces try/except blocks with direct
inmembership checks for cleaner code - Updates quality_scale.yaml to mark entity-unavailable requirement as completed
- Applies the same pattern consistently across all segment-based entities
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| homeassistant/components/wled/light.py | Simplified availability check for segment light entities using in operator instead of try/except |
| homeassistant/components/wled/number.py | Simplified availability check for segment number entities using in operator instead of try/except |
| homeassistant/components/wled/select.py | Simplified availability check for segment select entities using in operator instead of try/except |
| homeassistant/components/wled/switch.py | Simplified availability check for segment switch entities using in operator instead of try/except |
| homeassistant/components/wled/quality_scale.yaml | Removed entity-unavailable todo item since the availability checks are now properly implemented |
Breaking change
Proposed change
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: