-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add simple EvAPI and extend EvManager with simplistic SoC calculation #891
base: main
Are you sure you want to change the base?
Conversation
7ae8d8d
to
bc64cb7
Compare
Signed-off-by: Kai-Uwe Hermann <[email protected]>
bc64cb7
to
b7a727d
Compare
Signed-off-by: Kai-Uwe Hermann <[email protected]>
…nnectors" This allows both the API and EvAPI modules to run simultaneously Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
This allows an EV implementation to report more detailed information such as SoC Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Maybe we can combine the new |
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.
In general, things are looking good. See my two comments.
|
||
std::list<std::unique_ptr<EvSessionInfo>> info; | ||
|
||
const std::string api_base = "everest_api/"; |
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.
Perhaps make this a static inline constexpr std::string_view
modules/EvAPI/EvAPI.cpp
Outdated
std::string var_base = ev_base + "/var/"; | ||
|
||
std::string var_ev_info = var_base + "ev_info"; | ||
ev->subscribe_ev_info([this, &ev, var_ev_info](types::evse_manager::EVInfo ev_info) { | ||
json ev_info_json = ev_info; | ||
this->mqtt.publish(var_ev_info, ev_info_json.dump()); | ||
}); | ||
|
||
std::string var_session_info = var_base + "session_info"; | ||
ev->subscribe_bsp_event([this, var_session_info, &session_info](const auto& bsp_event) { | ||
session_info->update_state(types::board_support_common::event_to_string(bsp_event.event)); | ||
this->mqtt.publish(var_session_info, *session_info); | ||
}); |
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.
I think it could improve readability if those blocks are refactored to static functions like publish_ev_info
and publish_session_info
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
This is was only used for AC, where we now get it via the config Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
…e enum Signed-off-by: Kai-Uwe Hermann <[email protected]>
…s cmd the EvManager goes to state ISO_CHARGING_REGULATED and then the new simulate_soc() works also for DC Signed-off-by: Sebastian Lukas <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
3e55818
to
a86c62d
Compare
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
I can open a follow-up PR for that |
if (not state_has_changed and | ||
(sim_data.state == SimState::CHARGING_REGULATED or sim_data.state == SimState::CHARGING_FIXED or | ||
sim_data.state == SimState::ISO_CHARGING_REGULATED)) { | ||
simulate_soc(); |
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.
Maybe this should already be triggered at startup, right now the ev_info is only published when a charging session is ongoing, but the SoC information is available all the time
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.
Yes, I think you could do this and only sim_data.battery_charge_wh
will be increased during charging.
I am not sure why I was added into this code review. @hikinggrass This does not seem to touch Rust or Bazel? |
Doesn't touch rust or bazel, review request were triggered by accident from a botched merge of main into this branch. I've removed the accidentally added reviewers again |
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.
👍
Describe your changes
Issue ticket number and link
Checklist before requesting a review