#pragma once
#include "constants.hpp"
/***********************************************
 *               Pin Definitions               *
 ***********************************************/
// There are 4 rows of lights
#define LIGHT_ROW_1_PIN 0
#define LIGHT_ROW_2_PIN 1
#define LIGHT_ROW_3_PIN 2
#define LIGHT_ROW_4_PIN 3
// There are 3 rows of fans
#define FAN_ROW_1_PIN 4
#define FAN_ROW_2_PIN 5
#define FAN_ROW_3_PIN 6
// There are one power relay for the air purifier
#define AIR_PURIFIER_PIN 7
// There are one power relay for the mosquito zapper
#define MOSQUITO_ZAPPER_PIN 8
// There are one power relay for the socket
#define SOCKET_CONTACTOR_PIN 9
/***********************************************
 *               Air Conditioner               *
 ***********************************************/

// @note The infrared codes are defined in ir_codes.hpp and ir_codes.cpp
#define AC_MIN_TEMP 16
#define AC_MAX_TEMP 32
#define AC_MODES 3
#define AC_FAN_SPEEDS 4
#define AC_MODE_NAMES {"off", "cool", "fan_only"}
#define AC_FAN_SPEED_NAMES {"auto", "high", "medium", "low"}
#define AC_IR_TX_PIN 12 // GP Type
#define AC_IR_CHANNEL RMT_CHANNEL_0
#define AC_SENSOR_TYPE AC_SENSOR_TYPE_DHT22
#define AC_SENSOR_PIN 32 // GP Type

/***********************************************
 *            Display Configuration            *
 ***********************************************/
// UART Configuration
#define INTERNAL_DISPLAY_UART Serial
#define INTERNAL_DISPLAY_BAUDRATE 115200
#define DISPLAY_UART Serial1
#define DISPLAY_TX 4
#define DISPLAY_RX 17
#define DISPLAY_COMMUNICATION_BAUDRATE 115200
#define DISPLAY_OTA_BAUDRATE 921600
#define DEFAULT_TEMP_LOWER_BOUND 18
#define DEFAULT_TEMP_UPPER_BOUND 30
#define AC_TEMP_PRESS_DELAY 500 // ms

/***********************************************
 *      Persistent Storage Configuration       *
 ***********************************************/
#define AC_FRAM_ADDR 10000 // 3 bytes
#define AC_LOCK_FRAM_ADDR 10010 // 10 byte
#define AC_DISPLAY_MODE_FRAM_ADDR 10020 // 1 byte
#define AC_DISPLAY_TEMP_LOWER_BOUND_ADDR 10030 // 6 byte
#define AC_DISPLAY_TEMP_UPPER_BOUND_ADDR 10040 // 6 byte

/***********************************************
 *      Remote Variables & Smart Variables     *
 ***********************************************/
#define AQI_STATE_TOPIC "/iqair/usaqi"
#define AQI_REQUEST_TOPIC "/iqair/request"
#define AC_LOCK_RELATIVE_TOPIC "/ac/lock"
#define AC_TEMP_LOWER_BOUND_RELATIVE_TOPIC "/ac/temp_bound/lower"
#define AC_TEMP_UPPER_BOUND_RELATIVE_TOPIC "/ac/temp_bound/upper"
