-
Notifications
You must be signed in to change notification settings - Fork 127
Add lock screen functionality and fix limit session issues #962
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: master
Are you sure you want to change the base?
Conversation
When the session ended the limit was not cleared as it should be (if the auto release flag was set) Allow setting limits when the EV is disabled so they can act as a 'boost'
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 adds a lock screen to be displayed when the EVSE is disabled and refactors the limit session handling for proper claim management. Key changes include:
- Introducing LockScreen (header and implementation) with its related rendering and image assets.
- Updating the ScreenManager to transition between lock, charge, and boot screens depending on EVSE state.
- Changing limit session handling in limit.cpp to ensure proper claim release and enabling in default states.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/screens/screen_renderer.{h,cpp} | Added global message buffer functions and declarations shared across screens. |
src/screens/screen_manager.{h,cpp} | Added support and logic for the lock screen state. |
src/screens/screen_lock.{h,cpp} | Introduced LockScreen and its rendering functions. |
src/screens/screen_factory.h | Added new LockScreen case to the factory. |
src/limit.{h,cpp} | Revised limit session handling and claim management logic. |
src/lcd_tft.{h,cpp} | Updated message-display calls to use the centralized message functions. |
src/lcd_static/* | Included static lock screen image assets. |
src/emonesp.h | Enabled lock screen configuration and default message. |
Comments suppressed due to low confidence (1)
src/limit.cpp:220
- Ensure that this new branch verifying the EVSE's default disabled state is sufficiently covered by tests, so the claim behavior in this case is validated under various scenarios.
else if(EvseState::Disabled == config_default_state() && !_evse->clientHasClaim(EvseClient_OpenEVSE_Limit))
clear_message_line(y); | ||
} | ||
|
||
strncpy(_msg[y] + x, msg, LCD_MAX_LEN - x); |
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.
Consider adding a boundary check for the 'x' parameter before using it as an offset into _msg[y] to prevent a potential buffer overrun when x is not within the valid range (0 to LCD_MAX_LEN).
Copilot uses AI. Check for mistakes.
Introduce a lock screen that activates when the EVSE is disabled, along with enhancements to limit handling to ensure limits are cleared correctly at session end.