diff --git a/include/defaults.h b/include/defaults.h index 3500a7ff2..2ae863b5a 100644 --- a/include/defaults.h +++ b/include/defaults.h @@ -160,8 +160,8 @@ #define BATTERY_ZENDURE_MAX_SOC 100 #define BATTERY_ZENDURE_BYPASS_MODE 0 #define BATTERY_ZENDURE_MAX_OUTPUT 800 -#define BATTERY_ZENDURE_AUTO_SHUTDOWN 1 -#define BATTERY_ZENDURE_FORCE_LIMIT 0 +#define BATTERY_ZENDURE_AUTO_SHUTDOWN true +#define BATTERY_ZENDURE_FORCE_LIMIT false #define BATTERY_ZENDURE_OUTPUT_LIMIT BATTERY_ZENDURE_MAX_OUTPUT #define HUAWEI_ENABLED false diff --git a/src/Utils.cpp b/src/Utils.cpp index 2dee2ca67..e8926a973 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -238,13 +238,8 @@ template std::optional Utils::getNumericValueFromMqttPayload(char const* template std::optional Utils::getJsonElement(JsonObjectConst const root, char const* key, size_t nesting /* = 0*/) { - if (root.containsKey(key)){ - - auto item = root[key].as(); - - if (item.is() && item.nesting() == nesting){ - return item.as(); - } + if (!root[key].isNull() && root[key].is() && root[key].nesting() == nesting){ + return root[key].as(); } return std::nullopt; } diff --git a/webapp/src/views/BatteryAdminView.vue b/webapp/src/views/BatteryAdminView.vue index d898eac24..c5ea22de8 100644 --- a/webapp/src/views/BatteryAdminView.vue +++ b/webapp/src/views/BatteryAdminView.vue @@ -252,16 +252,17 @@ :tooltip="$t('batteryadmin.ZendureForceLimitDescription')" /> - +