Skip to content

Commit

Permalink
fixed bug in configprocessing and removed deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
vaterlangen committed Sep 26, 2024
1 parent cc601d2 commit 88852eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions include/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,8 @@ template std::optional<float> Utils::getNumericValueFromMqttPayload(char const*

template<typename T>
std::optional<T> Utils::getJsonElement(JsonObjectConst const root, char const* key, size_t nesting /* = 0*/) {
if (root.containsKey(key)){

auto item = root[key].as<JsonVariantConst>();

if (item.is<T>() && item.nesting() == nesting){
return item.as<T>();
}
if (!root[key].isNull() && root[key].is<T>() && root[key].nesting() == nesting){
return root[key].as<T>();
}
return std::nullopt;
}
Expand Down
21 changes: 11 additions & 10 deletions webapp/src/views/BatteryAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,17 @@
:tooltip="$t('batteryadmin.ZendureForceLimitDescription')"
/>

<InputElement
v-if="batteryConfigList.zendure_force_limit"
:label="$t('batteryadmin.ZendureOutputLimit')"
v-model="batteryConfigList.zendure_output_limit"
type="number"
min="0"
max="1200"
step="1"
:postfix="$t('batteryadmin.Watt')"
/>
<template v-if="batteryConfigList.zendure_force_limit">
<InputElement
:label="$t('batteryadmin.ZendureOutputLimit')"
v-model="batteryConfigList.zendure_output_limit"
type="number"
min="0"
max="1200"
step="1"
:postfix="$t('batteryadmin.Watt')"
/>
</template>

<InputElement
:label="$t('batteryadmin.ZendureMinSoc')"
Expand Down

0 comments on commit 88852eb

Please sign in to comment.