// evse_api.c - Main EVSE control logic

#include "evse_fsm.h"
#include "evse_error.h"
#include "evse_limits.h"
#include "evse_config.h"
#include "evse_api.h"
#include "evse_session.h"
#include "evse_pilot.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "esp_log.h"

static const char *TAG = "evse_api";


// ================================
// Public Configuration Interface
// ================================

void evse_set_enabled(bool value) {
    ESP_LOGI(TAG, "Set enabled %d", value);
    evse_config_set_enabled(value);
}

bool evse_is_available(void) {
    return evse_config_is_available();
}

void evse_set_available(bool value) {
    ESP_LOGI(TAG, "Set available %d", value);
    evse_config_set_available(value);
}

bool evse_get_session(evse_session_t *out) {
    return evse_session_get(out);
}