Skip to content

Commit

Permalink
Fix compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pzbitskiy committed Aug 3, 2024
1 parent eb27777 commit 5393c38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion main/language_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ char buffer[200]; // buffer for reading the string to (needs to be large enough
const char *translatedWord(const char *const *strings, const bool force_en)
{
uint8_t language_index = system_language_index; // default 0 for English
uint8_t index = 0;

if (!strings)
{
return ""; // no translations
}
#ifdef ESP32
// see how many translations we have for this entity. if there is no translation for this, revert to EN
// uint8_t index = 0;
// if (!force_en && (countItems(strings) >= language_index + 1 && strlen(strings[language_index])))
// {
// index = language_index;
Expand Down
26 changes: 13 additions & 13 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ void handleMetrics(AsyncWebServerRequest *request)
heatpumpSettings currentSettings = hp.getSettings();
heatpumpStatus currentStatus = hp.getStatus();

String hppower = currentSettings.power == "ON" ? "1" : "0";
String hppower = strcmp(currentSettings.power, "ON") == 0 ? "1" : "0";

String hpfan = currentSettings.fan;
if (hpfan == "AUTO")
Expand All @@ -1663,31 +1663,31 @@ void handleMetrics(AsyncWebServerRequest *request)
hpvane = "0";

String hpwidevane = "-2";
if (currentSettings.wideVane == "SWING")
if (strcmp(currentSettings.wideVane, "SWING") == 0)
hpwidevane = "0";
if (currentSettings.wideVane == "<<")
if (strcmp(currentSettings.wideVane, "<<") == 0)
hpwidevane = "1";
if (currentSettings.wideVane == "<")
if (strcmp(currentSettings.wideVane, "<") == 0)
hpwidevane = "2";
if (currentSettings.wideVane == "|")
if (strcmp(currentSettings.wideVane, "|") == 0)
hpwidevane = "3";
if (currentSettings.wideVane == ">")
if (strcmp(currentSettings.wideVane, ">") == 0)
hpwidevane = "4";
if (currentSettings.wideVane == ">>")
if (strcmp(currentSettings.wideVane, ">>") == 0)
hpwidevane = "5";
if (currentSettings.wideVane == "<>")
if (strcmp(currentSettings.wideVane, "<>") == 0)
hpwidevane = "6";

String hpmode = "-2";
if (currentSettings.mode == "AUTO")
if (strcmp(currentSettings.mode, "AUTO") == 0)
hpmode = "-1";
if (currentSettings.mode == "COOL")
if (strcmp(currentSettings.mode, "COOL") == 0)
hpmode = "1";
if (currentSettings.mode == "DRY")
if (strcmp(currentSettings.mode, "DRY") == 0)
hpmode = "2";
if (currentSettings.mode == "HEAT")
if (strcmp(currentSettings.mode, "HEAT") == 0)
hpmode = "3";
if (currentSettings.mode == "FAN")
if (strcmp(currentSettings.mode, "FAN") == 0)
hpmode = "4";
if (hppower == "0")
hpmode = "0";
Expand Down

0 comments on commit 5393c38

Please sign in to comment.