// COMMON SETTINGS


// #define DEBUG
// #define DEBUG_XTASKS

// macros
#define MANUFACTURER              "PAPIO LTD"
#define NTP_SERVER                "pool.ntp.org"
#define NTP_SERVER_TIMEOUT_S      30
#define LOG_LEVEL                 0
#define UPDATE_TIMEOUT_S          1800      // 1800 = 30min, after this time Bridge reports failure of SENSOR (REMOTE) DEVICE 
#define MIN_ALLOWED_HEAP_SIZE     60000 // 20000     // bytes, restart ESP if below, checked in check_volts() and hearbeat() as some devices have no volts
#define MAX_WEBLOG_ENTRIES        50       // 3 sensors * 12 time per hour * 5 hours = 180, each entry is around 200 bytes
#define MAX_INFLUXDB_ERRORS       10        // restart ESP after so many influxdb connection errors
#define START_CP_ON_BOOT          1         // if 1 then CP, if 0 then serial
#define ENCRYPT_ESPNOW            0         // if 1 encryption is ON and limited number of clients is 6, with 0/off it is 20
#define MQTT_CHECK_INTERVAL_S     5         // how often to check MQTT in case of failure
#define MAX_MQTT_ERRORS           10        // restart ESP after so many MQTT connection errors

// InfluxDB:
#define WRITE_PRECISION           WritePrecision::S
#define MAX_BATCH_SIZE            10        //  how many writed to buffer before it goes to DB
#define WRITE_BUFFER_SIZE         50        //  safety buffer in case of failures

// if not in devices_config.h
#ifndef HEARTBEAT_INTERVAL_S
    #define HEARTBEAT_INTERVAL_S      300       // 300 // bridge heartbeat every 5 minutes
#endif

#ifndef FW_CHECK_INTERVAL_M
    #define FW_CHECK_INTERVAL_M       1400        // 60 minutes * 24h = 1440, once a day, how often to check FW on server 
#endif

#ifndef CHECK_FW_ON_BOOT
    #define CHECK_FW_ON_BOOT            0        // no by default
#endif
// if not in devices_config.h END


// Either MQTT or InfluxDB - both are not working together
#if (USE_MQTT == 1) and (USE_INFLUXDB == 1)
    #error "You cannot use both: MQTT and InfluxDB"
    #error "Choose any of them or none but not both"
#endif

//use one of them below: STATUS LED or ERROR LED  - blinks when new message comes from DEVICES
// #define BLINK_STATUS_LED_ON_RECEIVED_DATA   
#define BLINK_ERROR_LED_ON_RECEIVED_DATA    

#define BATTERY_INTERVAL_S        300 //180   // in seconds, how often to update battery status and charging status of the bridge on HomeKit (battery/charging is measured every second)
#define LOW_BATTERY_THRESHOLD     30  // in % to start complaining (low battery status = 1)
#define IDENTIFY_BLINKS           10  // number of blinks when identify is called (bridge only)

// DEVICES
// sensors fake MAC addresses - must be the same on sensor devices!
#define DEVICE_ID_1               "1A:01:01:01:01:01" // C3
#define DEVICE_ID_1_NAME          "box 1 sensors"
#define DEVICE_ID_2               "1A:01:01:01:01:02" // S2 - without the box - development, office
#define DEVICE_ID_2_NAME          "box 2 sensors"
#define DEVICE_ID_3               "1A:01:01:01:01:03" // C3
#define DEVICE_ID_3_NAME          "box 3 sensors"
#define DEVICE_ID_4               "1A:01:01:01:01:04" // C3
#define DEVICE_ID_4_NAME          "box 4 sensors"
#define DEVICE_ID_5               "1A:01:01:01:01:05" // C3
#define DEVICE_ID_5_NAME          "box 5 sensors"
#define DEVICE_ID_6               "1A:01:01:01:01:06" // C3
#define DEVICE_ID_6_NAME          "box 6 sensors"
#define DEVICE_ID_7               "1A:01:01:01:01:07" // C3
#define DEVICE_ID_7_NAME          "box 7 sensors"
// DEVICES END

// test DEVICES
#define DEVICE_ID_8               "1A:01:01:01:01:08" // C3
#define DEVICE_ID_8_NAME          "test 8 sensors"

#define DEVICE_ID_9               "1A:01:01:01:01:09" // C3
#define DEVICE_ID_9_NAME          "test 9 sensors"

#define DEVICE_ID_10               "1A:01:01:01:01:10" // C3
#define DEVICE_ID_10_NAME          "test 10 sensors"

#define DEVICE_ID_11               "1A:01:01:01:01:11" // C3
#define DEVICE_ID_11_NAME          "test 11 sensors"

#define DEVICE_ID_12               "1A:01:01:01:01:12" // C3
#define DEVICE_ID_12_NAME          "test 12 sensors"

#define DEVICE_ID_13               "1A:01:01:01:01:13" // C3
#define DEVICE_ID_13_NAME          "test 13 sensors"

#define DEVICE_ID_14               "1A:01:01:01:01:14" // C3
#define DEVICE_ID_14_NAME          "test 14 sensors"

#define DEVICE_ID_15               "1A:01:01:01:01:15" // C3
#define DEVICE_ID_15_NAME          "test 15 sensors"

#define DEVICE_ID_16               "1A:01:01:01:01:16" // C3
#define DEVICE_ID_16_NAME          "test 16 sensors"

#define DEVICE_ID_17               "1A:01:01:01:01:17" // C3
#define DEVICE_ID_17_NAME          "test 17 sensors"

#define DEVICE_ID_18               "1A:01:01:01:01:18" // C3
#define DEVICE_ID_18_NAME          "test 18 sensors"

#define DEVICE_ID_19               "1A:01:01:01:01:19" // C3
#define DEVICE_ID_19_NAME          "test 19 sensors"

#define DEVICE_ID_20               "1A:01:01:01:01:20" // C3
#define DEVICE_ID_20_NAME          "test 20 sensors"

#define DEVICE_ID_21               "1A:01:01:01:01:21" // C3
#define DEVICE_ID_21_NAME          "test 21 sensors"

#define DEVICE_ID_22               "1A:01:01:01:01:22" // C3
#define DEVICE_ID_22_NAME          "test 22 sensors"

#define DEVICE_ID_23               "1A:01:01:01:01:23" // C3
#define DEVICE_ID_23_NAME          "test 23 sensors"

#define DEVICE_ID_42               "1A:01:01:01:01:42" // C3
#define DEVICE_ID_42_NAME          "test-42-s2"

#define DEVICE_ID_44               "1A:01:01:01:01:44" // C3
#define DEVICE_ID_44_NAME          "test-44-c3"