forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Assignment2 Chan Kai Wen #15
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
Open
kwchan03
wants to merge
585
commits into
dev
Choose a base branch
from
assignment2_ChanKaiWen
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: balloob <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
…157675) Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
…7680) Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
…#154491) Co-authored-by: Copilot <[email protected]> Co-authored-by: Martin Hjelmare <[email protected]>
Co-authored-by: Joostlek <[email protected]> Co-authored-by: Copilot <[email protected]>
Co-authored-by: Jan Bouwhuis <[email protected]> Co-authored-by: jbouwh <[email protected]>
Co-authored-by: Norbert Rittel <[email protected]>
Co-authored-by: J. Nick Koston <[email protected]>
…7982) Co-authored-by: Abílio Costa <[email protected]>
Co-authored-by: epenet <[email protected]> Co-authored-by: Franck Nijhof <[email protected]>
suhadaudd11
approved these changes
Jan 24, 2026
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.
Addressed Component/Module/Part of the System
Module: homeassistant/core.py
Specific Part: The analysis focuses on the
async_stopfunction, which was refactored from a monolithic block into a modular controller, and theasync_startfunction, which was decorated by@log_execution_timefor observability. These components control the critical startup and shutdown sequences of the Home Assistant Core.Graph Created and Its Completeness
I have selected a Call Graph to visualize the refactoring of
async_stopand the application of the new decorator.Graph Completeness:
This graph provides a complete representation of the reengineering effort because:
async_stopacts as a central controller, calling the five extracted helper functions:_can_stop,_async_shutdown_jobs,_async_stop_integrations,_async_final_write, and_async_close.@log_execution_timedecorator attached to bothasync_startandasync_stop, showing how observability was applied without modifying internal logic.set_state,async_fire_internal). The edges are labeled with parameters (STOPPING,NOT_RUNNING), verifying that the original shutdown sequence and logic remain intact.The Call Graph analysis highlights three key structural improvements:
async_stophas been drastically lowered. The main controller is now a simple linear sequence calling five helper nodes, rather than a monolithic block containing all logic._async_stop_integrationswaiting onasync_block_till_done) without debugging unrelated code in other stages.