fix info command #2274, fix standanlone

This commit is contained in:
MichaelDvP
2024-12-06 07:57:29 +01:00
parent a218c7a781
commit facbbf1353
2 changed files with 15 additions and 13 deletions

View File

@@ -670,13 +670,9 @@ 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 false;
}

View File

@@ -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++;