Skip to content
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

New Limit engine for Wifi module. #535

Merged
merged 19 commits into from
Feb 6, 2023
Merged

Conversation

KipK
Copy link
Collaborator

@KipK KipK commented Jan 30, 2023

Limit engine for Wifi module. Replace limits from OpenEvse module.

New /limit API endpoint
Added classes:
Limit
LimitProperties
LimitType class

POST { "type": type, "value": value, "auto_release" : optional bool }
type actually possible are : 'time", "energy", "soc", "range"

Disable state when time or energy session > defined limit.
Release disable claim when car is disconnected.

time_limit in minutes
session_energy in w/h

Todo:

  • add configuration and feature on UI

fix #225

@KipK KipK changed the title Add Limit class, enables limits over API WiP: Add Limit class, enables limits over API Jan 31, 2023
new /limit API endpoint
Added classes:
Limit
LimitProperties
LimitType class

POST { "type": type, "value": value, "auto_release" : optional bool }
type actually possible are : 'time", "energy", "soc", "range"
only time & energy are implemented.

Disable state when time or energy session > defined limit.
Release disable claim when car is disconnected.

time_limit in minutes
session_energy in w/h
@KipK
Copy link
Collaborator Author

KipK commented Jan 31, 2023

Seems we are good for review now

@KipK KipK mentioned this pull request Jan 31, 2023
@KipK KipK changed the title WiP: Add Limit class, enables limits over API New Limit engine for Wifi module. Jan 31, 2023
@KipK
Copy link
Collaborator Author

KipK commented Jan 31, 2023

Mhh not ready to merge, something I've changed crash the fw. Will check tomorrow

models/Limit.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@jeremypoulter jeremypoulter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some great work. Just a few changes and I think this will work well

models/Limit.yaml Outdated Show resolved Hide resolved
src/limit.cpp Show resolved Hide resolved
src/limit.cpp Outdated Show resolved Hide resolved
use onSessionComplete() event
@KipK
Copy link
Collaborator Author

KipK commented Feb 1, 2023

All changes done, seems we are good to go.
I have to think about the best UX to handle this on GUI now.

I think of a first selector for the Type, then a conditionned input ( time input for time, selector/ or number input for energy, slider for soc, selector/number input for range

@KipK
Copy link
Collaborator Author

KipK commented Feb 4, 2023

@jeremypoulter , I've finished to setup the UI2 for those new limits. Ready to push it when this is merged.
there's a change requested marked but it's outdated i think.

@jeremypoulter
Copy link
Collaborator

Mid reviewing/testing, hopefully a day or two

KipK added a commit to KipK/openevse-gui-v2 that referenced this pull request Feb 4, 2023
@KipK
Copy link
Collaborator Author

KipK commented Feb 4, 2023

I've pushed the gui limit branch here, if you want to test with :

https://github.com/KipK/openevse-gui-v2/tree/Limit

Added default limits at boot ( UI undone )
Default limit set from /config have auto_release set to false
add "limit_version" event
@KipK
Copy link
Collaborator Author

KipK commented Feb 5, 2023

I"ve added new settings in the /config , it allows to set a permanent limit. On the UI side I'll place it in the configuration section, to differentiate from limits from the main charging page.
Limits from the main page has auto_release = true, and can be deleted from the main page.
Those from the config, with auto_release = false have a lock icon instead of a delete one when displayed on the home.
They can only be deleted from the config. I haven't made the config part on UI yet

@jeremypoulter jeremypoulter merged commit 7c2a177 into OpenEVSE:master Feb 6, 2023
@KipK
Copy link
Collaborator Author

KipK commented Feb 6, 2023

thx UI merged to master.

@KipK KipK deleted the limits branch February 24, 2023 05:53
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.

Add SoC and range limits
2 participants