-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
added dhw alternating operation #901
Conversation
Because of compiler error, in Polish translation, we don't use uppercase boolean option "WŁĄCZONO/WYŁĄCZONO" but "wł./wył." instead.
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 see the intension to add "OFF" to the bool input with pl language, but we have to keep the toLower(value) to match all mixed case writings like "True", "On".
Please re-add bool_str = toLower(value)
and change in the if's to bool_str == toLower(Helpers::translated_word(FL_(OFF))
then all options should work.
now in mqtt discovery topics you can see e.g: "uniq_id": "thermostat_OG1_mode_type" (for Polish lang.) but should be: "uniq_id": "thermostat_hc1_mode_type",
Because of compiler error, in Polish translation, we don't use uppercase boolean option "WŁĄCZONO/WYŁĄCZONO" but "wł./wył." instead.
Done. Sorry for delay. It works but I noticed that |
I think you have to check the special charcater here explicide: Line 665 in 88404bc
|
toupper() is used e.g. here: Line 1135 in 88404bc
and it doesn't work. The first letter of HA friendy names starting with Polish character is not capitalized (e.g. "łączny czas grzania"), so I assume that std::tolower() will not work also. |
Yes the std::tolower only converts A-Z. I thought of something like a Helpers::tolower:
|
that would work. Or just don't bother with toLower/Upper because of the different charsets. I don't think we'll miss much. |
I wouldn't want special characters to be ignored. This can cause various problems in other places, especially if more languages using special characters will be added in the future. The main cause of problems with special characters (e.g. Polish letters) is due to the fact that in UTF-8 they are not encoded in 1 byte, but in 2 bytes (in UTF-8 there are characters that require even 4 bytes!). My commit 4f05dda doesn't "break" anything, but fixes a bug with the boolean "wł./wył." option, so I think it can be merged (and possibly improved in the future). Since there are currently no entities starting in Polish with a special character other than "ł", temporary solution could by replacing Line 1135 in 88404bc
Ultimately, however, own |
src/helpers.cpp
Outdated
switch (*c) { | ||
case 0xC3: | ||
if (*(c + 1) == 0xB3) //ó (0xC3,0xB3) -> Ó (0xC3,0x93) | ||
*(c + 1) = 0x93; |
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.
You can change this to match more special characters to:
// grave, acute, circumflex, diaeresis, etc.
if ((*(c + 1) >= 0xA0) && (*(c + 1) <= 0xBE)) {
*(c + 1) -= 0x20;
}
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.
when this is done I'll merge
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.
done. sorry for the delay
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.
thanks!
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.
ok to merge @MichaelDvP ?
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.
In the thermostat menu options look like this: