diff --git a/src/command.cpp b/src/command.cpp index ce346bea6..ac1f018cc 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -537,14 +537,14 @@ bool Command::list(const uint8_t device_type, JsonObject output) { output[F_(entities)] = Helpers::translated_word(FL_(entities_cmd)); if (device_type == EMSdevice::DeviceType::SYSTEM) { - output["settings/showertimer"] = Helpers::translated_word(FL_(system_cmd)); - output["settings/showeralert"] = Helpers::translated_word(FL_(system_cmd)); - output["settings/hideled"] = Helpers::translated_word(FL_(system_cmd)); + output["settings/showertimer"] = Helpers::translated_word(FL_(system_cmd)); + output["settings/showeralert"] = Helpers::translated_word(FL_(system_cmd)); + output["settings/hideled"] = Helpers::translated_word(FL_(system_cmd)); output["settings/analogenabled"] = Helpers::translated_word(FL_(system_cmd)); - output["mqtt/enabled"] = Helpers::translated_word(FL_(system_cmd)); - output["ntp/enabled"] = Helpers::translated_word(FL_(system_cmd)); - output["ap/enabled"] = Helpers::translated_word(FL_(system_cmd)); - output["syslog/enabled"] = Helpers::translated_word(FL_(system_cmd)); + output["mqtt/enabled"] = Helpers::translated_word(FL_(system_cmd)); + output["ntp/enabled"] = Helpers::translated_word(FL_(system_cmd)); + output["ap/enabled"] = Helpers::translated_word(FL_(system_cmd)); + output["syslog/enabled"] = Helpers::translated_word(FL_(system_cmd)); } // create a list of commands we have registered, and sort them std::list sorted_cmds; @@ -670,11 +670,7 @@ bool Command::device_has_commands(const uint8_t device_type) { for (const auto & emsdevice : EMSESP::emsdevices) { if (emsdevice && (emsdevice->device_type() == device_type)) { - for (const auto & cf : cmdfunctions_) { - if (cf.device_type_ == device_type) { - return true; - } - } + return true; } } diff --git a/src/helpers.cpp b/src/helpers.cpp index d536b2678..a141a60b0 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -256,11 +256,17 @@ char * Helpers::render_value(char * result, const double value, const int8_t for double v = value < 0 ? value - 1.0 / (2 * p[format]) : value + 1.0 / (2 * p[format]); auto whole = (long long)v; - if (whole == 0 && v < 0) { + if (whole <= 0 && v < 0) { result[0] = '-'; result++; + whole = -whole; + v = -v; } +#ifndef EMSESP_STANDALONE lltoa(whole, result, 10); +#else + ultostr(result, whole, 10); +#endif while (*result != '\0') { result++;