#pragma once

#include <Arduino.h>
#include <array>

namespace cyd {

// Stored in NVS via Preferences. Keep this struct simple and POD-like.
struct Settings {
    // WiFi credentials
    String wifiSsid;
    String wifiPass;

    // ThermoPro BLE
    String thermoproMac; // e.g. "C9:48:1D:B1:E1:E7"

    // HTTP API that the CYD exposes to frontends. Optional destination URL if the
    // device should also POST readings somewhere else.
    String apiEndpoint; // e.g. "http://192.168.1.50/api/thermopro/readings"
    String apiToken;    // shared secret for X-Bridge-Token when forwarding

    // Behaviour
    uint16_t pollIntervalSec = 15; // how often to read / refresh state
    char unit = 'F';                 // 'F' or 'C'
    String deviceId = "cyd-smoker";

    // Probe labels, indexed 0..3 for probes 1..4.
    std::array<String, 4> probeNames = {
        "Probe 1", "Probe 2", "Probe 3", "Probe 4"
    };

    // Version marker to allow future migrations.
    uint16_t version = 1;
};

} // namespace cyd
