Skip to content

Commit

Permalink
edited models
Browse files Browse the repository at this point in the history
  • Loading branch information
KipK committed Feb 5, 2023
1 parent 019c404 commit bc9f6fb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
11 changes: 11 additions & 0 deletions models/Config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ x-examples:
hostname: openevse-a7d4
sntp_hostname: pool.ntp.org
time_zone: 'Europe/London|GMT0BST,M3.5.0/1,M10.5.0'
limit_default_type: none
limit_default_value": 0
emoncms_server: 'https://emoncms.org'
emoncms_node: openevse-a7d4
emoncms_apikey: _DUMMY_PASSWORD
Expand Down Expand Up @@ -86,6 +88,7 @@ x-examples:
ocpp_auth_offline: true
mqtt_protocol: mqtt
charge_mode: fast
is_threephase: false
x-tags:
- Config
properties:
Expand Down Expand Up @@ -177,6 +180,12 @@ properties:
time_zone:
type: string
minLength: 1
limit_default_type:
type: string
minLength: 1
limit_default_value:
type: integer
minLength: 1
emoncms_server:
type: string
minLength: 1
Expand Down Expand Up @@ -295,3 +304,5 @@ properties:
default: 600
description: |
The maximum number of seconds to randomly add/subtract from the a scheduled charge start time, eg a value of 600 will adjust the start time my +/- 10 minutes. This is to help prevent large syncrinised loads when multiple verchiles start charging at the same time.
is_threephase:
type: boolean
6 changes: 6 additions & 0 deletions models/Status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,9 @@ properties:
offset:
type: string
description: The current timezone
has_limit:
type: boolean
description: A limit has been set
limit_version:
type: integer
description: /limit endpoint current version
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ debug_flags =
#-D ENABLE_DEBUG_MQTT
#-D ENABLE_DEBUG_EMONCMS
#-D ENABLE_DEBUG_TESLA_CLIENT
# -D ENABLE_DEBUG_LIMIT
#-D ENABLE_DEBUG_LIMIT
#-D ENABLE_PROFILE
src_build_flags =
# -D ARDUINOJSON_USE_LONG_LONG
Expand Down
8 changes: 6 additions & 2 deletions src/app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,14 @@ void config_changed(String name)
limitprops.setType(limitType);
limitprops.setValue(limit_default_value);
limitprops.setAutoRelease(false);
if (limit.hasLimit()) {
if (limitType == LimitType::None) {
uint32_t val = 0;
config_set("limit_default_value", val);
config_commit();
limit.clear();
}
limit.set(limitprops);
else
limit.set(limitprops);
}
}

Expand Down

0 comments on commit bc9f6fb

Please sign in to comment.