-
Notifications
You must be signed in to change notification settings - Fork 66
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
Feature: Publish Huawei AC charger mode via MQTT #876
Conversation
Did the files of this project change to CRLF by default? I only added like 3 lines, yet the diff looks horrible. |
No, there has been no change yet. I am looking to align line endings with the upstream project and align files only present in this repo to the other files. What operating system are you on? Use unix2dos or dos2unix command line tools to switch line endings on Linux, the amend you change/commit and force-push. |
I'm on Linux. Thanks, that did the trick! Also I saw that you merged/reworked the sensible stuff from my old PR, big thank you for that. I was rather short on time the last couple of months. |
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.
Please address the second comment, where the getMode() can be implemented in the header (as its implementation is trivial) and add the const qualifier.
include/Huawei_can.h
Outdated
@@ -127,6 +127,7 @@ class HuaweiCanClass { | |||
RectifierParameters_t * get(); | |||
uint32_t getLastUpdate(); | |||
bool getAutoPowerStatus(); | |||
uint8_t getMode(); |
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.
Implement here (in header) and use const
qualifier.
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.
Implement here (in header) and use
const
qualifier.
Done 👍 While I'm at it, shall I also transform the getAutoPowerStatus() method in the same fashion?
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, thanks. Are there more trivial getters?
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.
getLastUpdate() and getAutoPowerStatus() -> also transformed now. I'm unsure about the generic get() for RectifierParameters_t *; as I don't really recognize that syntax and my editor complains about a type mismatch if I try to move that to the header file.
Thanks for your appreciation! |
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.
Let's accept the whitespace changes, as they are progress in the right direction. Other than that, the changes look good (cannot test myself, but the changes seems to be alright).
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns. |
Since we can set this parameter using MQTT, we should also be able to read its current value