Skip to content

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jeremypoulter
Copy link
Collaborator

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.

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'
@jeremypoulter jeremypoulter requested a review from Copilot April 23, 2025 20:48
Copy link
Contributor

github-actions bot commented Apr 23, 2025

Test Results

42 tests  ±0   42 ✅ ±0   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit e5f0801. ± Comparison against base commit 9ed769b.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@Copilot Copilot AI left a 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);
Copy link
Preview

Copilot AI Apr 23, 2025

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.

@jeremypoulter jeremypoulter marked this pull request as draft April 23, 2025 20:51
Base automatically changed from local_ui_tidyup to master June 11, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant