-
-
Notifications
You must be signed in to change notification settings - Fork 67
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: "State of Operation", "Float voltage" and "Absorption Voltage" #1576
base: development
Are you sure you want to change the base?
Conversation
…e" from the Solar Charger
include/solarcharger/Stats.h
Outdated
@@ -26,6 +26,15 @@ class Stats { | |||
// sum of today's yield of all MPPT charge controllers in Wh | |||
virtual std::optional<float> getYieldDay() const; | |||
|
|||
// state of operation from the first available controller | |||
virtual std::optional<uint8_t> getStateOfOperation() const { return std::nullopt; }; |
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.
can we return an enum instead of a number?
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, sure.
include/solarcharger/Stats.h
Outdated
@@ -26,6 +26,20 @@ class Stats { | |||
// sum of today's yield of all MPPT charge controllers in Wh | |||
virtual std::optional<float> getYieldDay() const; | |||
|
|||
// state of operation from the first available controller | |||
enum class StateOfOperation : uint8_t { |
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.
using victron values as the base of the enum does not match our wish to have a generic solarcharger implementation. Having all victron related enum cases is fine but the mapping from a number to the enum case should be implementation specific.
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 reduced the cases to the minimum. Actual I just need Off, Bulk, Adsorption and Float. All other states will be handled as Various.
I'm not sure if I did it the right way.
I want to get the "State of Operation", "Float voltage" and "Absorption Voltage" from the victron charge controller.
But I don't want to force every solar charger provider to provide these functions.
If other provider (MPPT) support these functions, then other functions like the "Surplus" or the "Batterie Guard" should also work.
At least that was the idea behind.
Any suggestions?