#ifndef TAHOMA_H
#define TAHOMA_H

#include <Arduino.h>
#include <WiFi.h>   
#include <iostream>
#include <base64.h>
#include <HTTPClient.h>
#include <ArduinoJson.h> // Include the ArduinoJson library for JSON parsing
#include <ESPAsyncWebserver.h>
#include <WiFiClientSecure.h>
#define MAX_NUM_DEVICES 32 // Maximum number of devices to fetch

class Tahoma {
public:
    typedef struct {
        String name; // Device name
        String url;  // Device URL
    } device_t;
    // Constructor with hostname and token
    // Initializes the Tahoma object with the provided hostname and token
    Tahoma(const String hostname, const String token);

    // Destructor
    ~Tahoma();
    void getAllDevices(void); // Fetches the device name from the Tahoma system
    String getDeviceName(const String _url); // Fetches the device name from the Tahoma system
    void getAllDeviceNames(void); // Fetches all device names from the Tahoma system
private:
    device_t devicelist[MAX_NUM_DEVICES];
    String hostname; // Hostname of the Tahoma system
    String token;    // Authentication token for the Tahoma system
    bool connected; // Connection status

    // Simulate fetching data from the Tahoma system
    void fetchData();
};

#endif // TAHOMA_H