Skip to content

Commit

Permalink
3phase energy meter flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dzurikmiroslav committed Aug 1, 2024
1 parent afc83e3 commit 579d3a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/protocols/src/http_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cJSON* http_json_get_evse_config(void)
cJSON_AddBoolToObject(json, "socketLockDetectionHigh", socket_lock_is_detection_high());
cJSON_AddNumberToObject(json, "socketLockRetryCount", socket_lock_get_retry_count());

cJSON_AddStringToObject(json, "energyMeter", energy_meter_mode_to_str(energy_meter_get_mode()));
cJSON_AddStringToObject(json, "energyMeterMode", energy_meter_mode_to_str(energy_meter_get_mode()));
cJSON_AddNumberToObject(json, "energyMeterAcVoltage", energy_meter_get_ac_voltage());
cJSON_AddNumberToObject(json, "energyMeterThreePhases", energy_meter_is_three_phases());

Expand Down Expand Up @@ -123,8 +123,8 @@ esp_err_t http_json_set_evse_config(cJSON* json)
socket_lock_set_retry_count(cJSON_GetObjectItem(json, "socketLockRetryCount")->valuedouble);
}

if (cJSON_IsString(cJSON_GetObjectItem(json, "energyMeter"))) {
RETURN_ON_ERROR(energy_meter_set_mode(energy_meter_str_to_mode(cJSON_GetObjectItem(json, "energyMeter")->valuestring)));
if (cJSON_IsString(cJSON_GetObjectItem(json, "energyMeterMode"))) {
RETURN_ON_ERROR(energy_meter_set_mode(energy_meter_str_to_mode(cJSON_GetObjectItem(json, "energyMeterMode")->valuestring)));
}
if (cJSON_IsNumber(cJSON_GetObjectItem(json, "energyMeterAcVoltage"))) {
RETURN_ON_ERROR(energy_meter_set_ac_voltage(cJSON_GetObjectItem(json, "energyMeterAcVoltage")->valuedouble));
Expand Down

0 comments on commit 579d3a1

Please sign in to comment.