#pragma once

#include "interface.hpp"

#include <string>
#include <tuple>

namespace hwmon
{
namespace entry
{
static constexpr auto cinput = "input";
static constexpr auto clabel = "label";
static constexpr auto ctarget = "target";
static constexpr auto cenable = "enable";
static constexpr auto cfault = "fault";
static constexpr auto caverage = "average";
static constexpr auto caverage_interval = "average_interval";

static const std::string input = cinput;
static const std::string label = clabel;
static const std::string target = ctarget;
static const std::string enable = cenable;
static const std::string fault = cfault;
static const std::string average = caverage;
static const std::string average_interval = caverage_interval;
} // namespace entry

namespace type
{
static constexpr auto cfan = "fan";
static constexpr auto ctemp = "temp";
static constexpr auto cvolt = "in";
static constexpr auto ccurr = "curr";
static constexpr auto cenergy = "energy";
static constexpr auto cpower = "power";
static constexpr auto cpwm = "pwm";

static const std::string fan = cfan;
static const std::string temp = ctemp;
static const std::string volt = cvolt;
static const std::string curr = ccurr;
static const std::string energy = cenergy;
static const std::string power = cpower;
static const std::string pwm = cpwm;
} // namespace type

static constexpr auto typeAttrMap = {
    // 1 - hwmon class
    // 2 - unit
    // 3 - sysfs scaling factor
    // 4 - namespace
    std::make_tuple(hwmon::type::ctemp, ValueInterface::Unit::DegreesC, -3,
                    "temperature"),
    std::make_tuple(hwmon::type::cfan, ValueInterface::Unit::RPMS, 0,
                    "fan_tach"),
    std::make_tuple(hwmon::type::cvolt, ValueInterface::Unit::Volts, -3,
                    "voltage"),
    std::make_tuple(hwmon::type::ccurr, ValueInterface::Unit::Amperes, -3,
                    "current"),
    std::make_tuple(hwmon::type::cenergy, ValueInterface::Unit::Joules, -6,
                    "energy"),
    std::make_tuple(hwmon::type::cpower, ValueInterface::Unit::Watts, -6,
                    "power"),
};

inline auto getHwmonType(decltype(typeAttrMap)::const_reference attrs)
{
    return std::get<0>(attrs);
}

inline auto getUnit(decltype(typeAttrMap)::const_reference attrs)
{
    return std::get<1>(attrs);
}

inline auto getScale(decltype(typeAttrMap)::const_reference attrs)
{
    return std::get<2>(attrs);
}

inline auto getNamespace(decltype(typeAttrMap)::const_reference attrs)
{
    return std::get<3>(attrs);
}

using AttributeIterator = decltype(*typeAttrMap.begin());
using Attributes =
    std::remove_cv<std::remove_reference<AttributeIterator>::type>::type;

/** @brief Get Attribute tuple for the type
 *
 *  Given a type, it tries to find the corresponding tuple
 *
 *  @param[in] type the sensor type
 *  @param[in,out] A pointer to the Attribute tuple
 */
bool getAttributes(const std::string& type, Attributes& attributes);

} //  namespace hwmon
