-
-
Notifications
You must be signed in to change notification settings - Fork 117
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 support for Lolin C3 mini #620
Conversation
src/emsdevice.cpp
Outdated
@@ -768,7 +768,7 @@ void EMSdevice::generate_values_web(JsonObject & output) { | |||
if (divider > 0) { | |||
obj["s"] = Helpers::render_value(s, (float)1 / divider, 1); | |||
} else if (divider < 0) { | |||
obj["s"] = Helpers::render_value(s, (-1) * divider, 0); | |||
obj["s"] = Helpers::render_value(s, (float)(-1) * divider, 0); |
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.
what is the reason behind adding this?
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.
It's interesting because this was causing compile issues for me even without any modification. (src/emsdevice.cpp:771:78: error: call of overloaded 'render_value(char [10], int, int)' is ambiguous) I'm using the 5.1.1 version of the espriff 32 lib.
doc["min_temp"] = Helpers::render_value(min_s, 5, 0, EMSESP::system_.fahrenheit() ? 2 : 0); | ||
doc["max_temp"] = Helpers::render_value(max_s, 30, 0, EMSESP::system_.fahrenheit() ? 2 : 0); | ||
doc["min_temp"] = Helpers::render_value(min_s, (uint32_t)5, 0, EMSESP::system_.fahrenheit() ? 2 : 0); | ||
doc["max_temp"] = Helpers::render_value(max_s, (uint32_t)30, 0, EMSESP::system_.fahrenheit() ? 2 : 0); |
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.
and also what is the reason behind adding these two casts?
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.
same as above
looks ok, I've added a comment. @MichaelDvP do you want to review too? |
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.
Nice that C3 works with little changes.
The C3 is set on compile-time, but the board-profile can changed in settings to a non-C3, Is this usefull? Also on ESP32 the C3 can be selected.
I think it's better to fix board in cpp code to C3 mini and in webcode disable selection box if C3Mini is set in program, otherwise dont add C3Mini to selection box.
Hi Michael, |
I think of something like removing C3MINI from types and modify `SettingsApplication.tsx to:
Than fix in cpp the board_profile to But there are also other ways to check. You can simply not show the complete ValidateTextField. |
Also @CheeseE we'll be pushing the dev branch to main soon so suggest this PR goes into the next dev build. just a FYI |
@CheeseE can you merge your change into the latest dev and ammend the PR? |
Adding support for Lolin C3 mini: link
This board is pin to pin compatible with the old D1 mini. No need to cut the enclosure when upgrading from old gateways, and because of the low power RISC-V CPU it can be still powered from EMS bus.