Bug Fix for Precharge Contactor Handling in SHUTDOWN_REQUESTED State and Web Interface Enhancement for Contactor Status Display #584
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.
What
This PR addresses a bug fix and introduces a new feature in the Battery Emulator project. The bug affects the handling of precharge contactor in the SHUTDOWN_REQUESTED state, and the feature adds enhanced visibility to contactor states in the web interface.
Why
When the battery emulator reaches the MAX_ALLOWED_FAULT_TICKS limit, it enters the SHUTDOWN_REQUESTED state. However, an issue in the handle_contactors introduced on equipment stop functionality code was allowing the system to immediately transition to a DISCONNECTED state. This bypassed the proper shutdown sequence, causing the precharge contactor to remain in a HIGH state. Additionally, providing visibility into the states of all contactors (precharge, negative, and positive) in the web interface allows users to better monitor and diagnose the system status.
How
The bug fix ensures that, when the system enters the SHUTDOWN_REQUESTED state, equipment_stop_active is also set to true, ensuring the contactors follow the intended shutdown sequence. Furthermore, the web interface has been updated to display the states of all key contactors (precharge, negative, and positive), giving users clear, real-time insight into their statuses directly from the webserver interface.