Skip to content

Commit

Permalink
Merge pull request emsesp#1525 from Bingo2023/dev2
Browse files Browse the repository at this point in the history
Dev2 - corrected mode control for HA (including translations).
  • Loading branch information
proddy authored Dec 28, 2023
2 parents b29c36d + d035a29 commit 77700c4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1208,13 +1208,17 @@ bool Mqtt::publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp,
}

snprintf(mode_str_tpl,
sizeof(mode_str_tpl),
"{%%if %s%%}off{%%elif %s=='manual'%%}heat{%%elif %s=='day'%%}heat{%%elif %s=='night'%%}off{%%elif %s=='off'%%}off{%%else%%}auto{%%endif%%}",
hc_mode_cond,
hc_mode_s,
hc_mode_s,
hc_mode_s,
hc_mode_s);
sizeof(mode_str_tpl),
"{%%if %s%%}off{%%elif %s=='%s'%%}heat{%%elif %s=='%s'%%}heat{%%elif %s=='%s'%%}off{%%elif %s=='%s'%%}off{%%else%%}auto{%%endif%%}",
hc_mode_cond,
hc_mode_s,
Helpers::translated_word(FL_(manual)),
hc_mode_s,
Helpers::translated_word(FL_(day)),
hc_mode_s,
Helpers::translated_word(FL_(night)),
hc_mode_s,
Helpers::translated_word(FL_(off)));

snprintf(name_s, sizeof(name_s), "Hc%d", hc_num);

Expand Down

0 comments on commit 77700c4

Please sign in to comment.