-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Fix typing of ConfigEntry in WLED #155571
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
base: dev
Are you sure you want to change the base?
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
|
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 updates the WLED integration to use a custom typed ConfigEntry (WLEDConfigEntry) in the async_get_options_flow method signature instead of the generic ConfigEntry type. This aligns with a pattern used in other integrations to provide better type safety when accessing config entry runtime data.
Key Changes
- Removed the generic
ConfigEntryimport fromhomeassistant.config_entries - Added import of the custom
WLEDConfigEntrytype from the local__init__.pymodule - Updated the type hint for the
config_entryparameter inasync_get_options_flowfromConfigEntrytoWLEDConfigEntry
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.
Please update coordinator.py also
core/homeassistant/components/wled/coordinator.py
Lines 34 to 40 in bff6f85
| config_entry: ConfigEntry | |
| def __init__( | |
| self, | |
| hass: HomeAssistant, | |
| *, | |
| entry: ConfigEntry, |
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Breaking change
Proposed change
This PR updates the WLED integration to use a custom typed
ConfigEntry(WLEDConfigEntry) in theasync_get_options_flowmethod signature instead of the genericConfigEntrytype. This aligns with a pattern used in other integrations to provide better type safety when accessing config entry runtime data and it is required by strict-typing rule. No behaviour change, but it is needed to make linter happy.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: