Skip to content

Commit

Permalink
Fix PVWatts-Battery REopt in UI callback
Browse files Browse the repository at this point in the history
When REopt API returns null battery size and user clicks **Yes** when asked whether to set battery size to zero, set battery size to zero instead of resetting to original size.
  • Loading branch information
cpaulgilman committed Aug 22, 2024
1 parent 74e911d commit 10ad545
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deploy/runtime/ui/Battery Model Simple with REopt.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,13 +781,15 @@
"\t\t\t\"\\nOptimal power (kW): \" + to_string(0) + \"\\n\\nReplace \" + ",
"\t\t\t\"'Battery capacity' and 'Battery power' with results from REopt?\";",
"\t\tapply = yesno(apply_str);",
"\t\tif (apply){",
"\t\tif (apply) {",
"\t\t\tvalue('batt_simple_kw', 0.0);",
"\t\t\tvalue('batt_simple_kwh', 0.0);",
"\t\t}",
"\t\t}\r",
"\t\telse {",
"\t\tvalue(\"batt_simple_dispatch\",dispatch_original_mode); //restore original dispatch mode for early exit from ReOPT",
"\t\tvalue(\"batt_simple_kw\", batt_kw_original);",
"\t\tvalue(\"batt_simple_kwh\", batt_kwh_original); ",
"\t\tvalue(\"batt_simple_kwh\", batt_kwh_original); \r",
"\t\t}",
"\t\texit;",
"\t}",
"",
Expand Down

0 comments on commit 10ad545

Please sign in to comment.