-
Notifications
You must be signed in to change notification settings - Fork 11
Refactor init setup helpers and document data/options TODO #710
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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #710 +/- ##
==========================================
- Coverage 89.32% 89.29% -0.03%
==========================================
Files 29 29
Lines 1921 1925 +4
Branches 66 66
==========================================
+ Hits 1716 1719 +3
- Misses 205 206 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
86b306d to
29c57af
Compare
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 refactors the Lovelace resource management code to improve maintainability by extracting helper functions, simplifies entity tracking by converting from dictionaries to sets, removes duplicate code, and documents TODO guidance for config entry data vs options usage.
- Extracted Lovelace resource registration and cleanup logic into dedicated helper functions
- Changed entity tracking from
dict[str, bool]toset[str]for clearer intent - Documented TODO item about config entry data vs options usage guidance
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| custom_components/lock_code_manager/init.py | Refactored Lovelace resource handling into helper functions (_get_lovelace_resources, _async_register_strategy_resource, _async_cleanup_strategy_resource), converted entity tracking from dicts to sets, and removed duplicate invoke_lock_slot_adders calls |
| TODO.md | Added documentation TODO for clarifying when to use config_entry.data vs config_entry.options |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed change
Type of change
Additional information