Skip to content

Commit

Permalink
Update controller.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
christian1980nrw authored Nov 3, 2024
1 parent 208be5b commit d19ce81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else
["shelly_ips"]="^\(\".*\"\)$"
["shellyuser"]="string"
["shellypasswd"]="string"
["use_charger"]="0|1|2"
["use_charger"]="0|1|2|3"
["limit_inverter_power_after_enabling"]="^(-1|[0-9]{2,5})$"
["energy_loss_percent"]="[0-9]+(\.[0-9]+)?"
["battery_lifecycle_costs_cent_per_kwh"]="[0-9]+(\.[0-9]+)?"
Expand Down Expand Up @@ -1095,8 +1095,8 @@ if [ -z "$SOC_percent" ]; then
fi

if ! [[ "$SOC_percent" =~ ^[0-9]+$ ]]; then
log_message >&2 "E: SOC cannot be read properly. Value is not an integer."
exit 1
log_message >&2 "D: SOC cannot be read properly. Value is not an integer and will be convert."
SOC_percent=${SOC_percent%.*}
elif (( $SOC_percent < 0 || $SOC_percent > 100 )); then
log_message >&2 "E: SOC value out of range: $SOC_percent. Valid range is 0-100."
exit 1
Expand Down

0 comments on commit d19ce81

Please sign in to comment.