-
Notifications
You must be signed in to change notification settings - Fork 11
Chore: Clean up TODO.md and refactor websocket module #729
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
- Remove completed items: - "Use both custom cards in strategy" (done in #724) - "Go through zwave_reconnect_test_plan.md for PR 704" (PR merged) - Fix incorrect websocket command name (subscribe_lock_codes, not subscribe_lock_slot_data) - Re-add schedule/entity condition types feature request 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
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 maintains the TODO.md file by removing completed tasks, correcting technical documentation, and adding a new feature request for alternative scheduling mechanisms.
- Removes two completed TODO items (custom cards strategy and zwave test plan)
- Corrects websocket command names in the documentation
- Adds comprehensive feature request for Schedule and Entity Condition Types as calendar alternatives
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Extract module-level state helper functions for reuse: - _get_text_state, _get_bool_state, _get_number_state, _get_last_changed - Extract config entry helpers: - _find_config_entry_by_title for config entry lookup by title - _get_slot_calendar_entity_id for calendar entity ID lookup from slot config - Update _get_slot_metadata, _serialize_slot_card_data, subscribe_code_slot, get_locks, and async_get_entry decorator to use new helpers - Remove ~50 lines of duplicate nested function definitions - Update TODO.md to mark websocket refactoring as complete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #729 +/- ##
==========================================
+ Coverage 88.96% 89.25% +0.28%
==========================================
Files 29 29
Lines 2366 2354 -12
Branches 78 78
==========================================
- Hits 2105 2101 -4
+ Misses 261 253 -8
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:
|
Test coverage for refactored helper functions: - _get_text_state: valid state, unknown, unavailable, nonexistent, None - _get_bool_state: on, off, unknown, unavailable, nonexistent, None - _get_number_state: integer, float conversion, invalid, unknown, unavailable - _get_last_changed: ISO timestamp, require_valid_state filtering - _find_config_entry_by_title: exact match, slugified match, nonexistent - _get_slot_calendar_entity_id: with calendar, without, nonexistent slot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Proposed change
Maintenance PR with two changes:
TODO.md Changes
subscribe_lock_slot_data→subscribe_lock_codes/subscribe_code_slotWebsocket Refactoring
Extracted module-level helper functions:
_get_text_state()_get_bool_state()_get_number_state()_get_last_changed()_find_config_entry_by_title()_get_slot_calendar_entity_id()Updated functions:
async_get_entry,_get_slot_metadata,_serialize_slot_card_data,subscribe_code_slot,get_locksTests Added
Added 30 unit tests for the refactored helper functions covering:
require_valid_stateparameter behaviorType of change
Additional information
🤖 Generated with Claude Code