@ -32,13 +32,29 @@
/ / https : / / github . com / esp8266 / Arduino / issues / 5825
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / HEARTBEAT
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef HEARTBEAT_MODE
# define HEARTBEAT_MODE HEARTBEAT_REPEAT
# endif
# ifndef HEARTBEAT_INTERVAL
# define HEARTBEAT_INTERVAL heartbeat::Seconds(300ul) / / Interval between heartbeat messages
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / DEBUG
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Set global logger mode . One of :
/ / - DebugLogMode : : Enabled
/ / - DebugLogMode : : Disabled
/ / - DebugLogMode : : SkipBoot
# ifndef DEBUG_LOG_MODE
# define DEBUG_LOG_MODE DebugLogMode::Enabled / / Set global logger mode. One of:
/ / : : Enabled , : : Disabled or : : SkipBoot
# define DEBUG_LOG_MODE DebugLogMode::Enabled
# endif
/ / Serial debug log
@ -236,11 +252,11 @@
# endif
# ifndef GARLAND_D_PIN
# define GARLAND_D_PIN D2 / / WS2812 pin number
# define GARLAND_D_PIN 4 / / WS2812 pin number (default: D2 / GPIO4)
# endif
# ifndef GARLAND_LEDS
# define GARLAND_LEDS 60 / / Leds number
# define GARLAND_LEDS 60 / / Number of LEDs
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -267,30 +283,9 @@
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / HEARTBEAT
/ / HEARTBEAT REPORT
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# define HEARTBEAT_NONE 0 / / Never send heartbeat
# define HEARTBEAT_ONCE 1 / / Send it only once upon MQTT connection
# define HEARTBEAT_REPEAT 2 / / Send it upon MQTT connection and every HEARTBEAT_INTERVAL
# define HEARTBEAT_REPEAT_STATUS 3 / / Send it upon MQTT connection and every HEARTBEAT_INTERVAL only STATUS report
/ / Backwards compatibility check
# if defined(HEARTBEAT_ENABLED) && (HEARTBEAT_ENABLED == 0)
# define HEARTBEAT_MODE HEARTBEAT_NONE
# endif
# ifndef HEARTBEAT_MODE
# define HEARTBEAT_MODE HEARTBEAT_REPEAT
# endif
# ifndef HEARTBEAT_INTERVAL
# define HEARTBEAT_INTERVAL 300UL / / Interval between heartbeat messages (in sec)
# endif
# define UPTIME_OVERFLOW 4294967295UL / / Uptime overflow value
/ / Values that will be reported in heartbeat
# ifndef HEARTBEAT_REPORT_STATUS
# define HEARTBEAT_REPORT_STATUS 1
# endif
@ -364,11 +359,11 @@
# endif
# ifndef HEARTBEAT_REPORT_RANGE
# define HEARTBEAT_REPORT_RANGE THERMOSTAT_SUPPORT
# define HEARTBEAT_REPORT_RANGE 1
# endif
# ifndef HEARTBEAT_REPORT_REMOTE_TEMP
# define HEARTBEAT_REPORT_REMOTE_TEMP THERMOSTAT_SUPPORT
# define HEARTBEAT_REPORT_REMOTE_TEMP 1
# endif
# ifndef HEARTBEAT_REPORT_BSSID
@ -383,73 +378,6 @@
# define LOADAVG_INTERVAL 30000 / / Interval between calculating load average (in ms)
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / BUTTON
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef BUTTON_SUPPORT
# define BUTTON_SUPPORT 1
# endif
# ifndef BUTTON_DEBOUNCE_DELAY
# define BUTTON_DEBOUNCE_DELAY 50 / / Debounce delay (ms)
# endif
# ifndef BUTTON_REPEAT_DELAY
# define BUTTON_REPEAT_DELAY 500 / / Time in ms to wait for a second (or third...) click
# endif
# ifndef BUTTON_LNGCLICK_DELAY
# define BUTTON_LNGCLICK_DELAY 1000 / / Time in ms holding the button down to get a long click
# endif
# ifndef BUTTON_LNGLNGCLICK_DELAY
# define BUTTON_LNGLNGCLICK_DELAY 10000 / / Time in ms holding the button down to get a long-long click
# endif
# ifndef BUTTON_MQTT_SEND_ALL_EVENTS
# define BUTTON_MQTT_SEND_ALL_EVENTS 0 / / 0 - to send only events the are bound to actions
/ / 1 - to send all button events to MQTT
# endif
# ifndef BUTTON_MQTT_RETAIN
# define BUTTON_MQTT_RETAIN 0
# endif
/ / Generic digital pin support
# ifndef BUTTON_PROVIDER_GPIO_SUPPORT
# define BUTTON_PROVIDER_GPIO_SUPPORT 1
# endif
/ / Resistor ladder support . Poll analog pin and return digital LOW when analog reading is in a certain range
/ / ref . https : / / github . com / bxparks / AceButton / tree / develop / docs / resistor_ladder
/ / Uses BUTTON # _ANALOG_LEVEL for the individual button level configuration
# ifndef BUTTON_PROVIDER_ANALOG_SUPPORT
# define BUTTON_PROVIDER_ANALOG_SUPPORT 0
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / ENCODER
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef ENCODER_SUPPORT
# define ENCODER_SUPPORT 0
# endif
# ifndef ENCODER_MINIMUM_DELTA
# define ENCODER_MINIMUM_DELTA 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / LED
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef LED_SUPPORT
# define LED_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / RELAY
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -533,6 +461,73 @@
# define RELAY_MQTT_TOGGLE "2"
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / BUTTON
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef BUTTON_SUPPORT
# define BUTTON_SUPPORT 1
# endif
# ifndef BUTTON_DEBOUNCE_DELAY
# define BUTTON_DEBOUNCE_DELAY 50 / / Debounce delay (ms)
# endif
# ifndef BUTTON_REPEAT_DELAY
# define BUTTON_REPEAT_DELAY 500 / / Time in ms to wait for a second (or third...) click
# endif
# ifndef BUTTON_LNGCLICK_DELAY
# define BUTTON_LNGCLICK_DELAY 1000 / / Time in ms holding the button down to get a long click
# endif
# ifndef BUTTON_LNGLNGCLICK_DELAY
# define BUTTON_LNGLNGCLICK_DELAY 10000 / / Time in ms holding the button down to get a long-long click
# endif
# ifndef BUTTON_MQTT_SEND_ALL_EVENTS
# define BUTTON_MQTT_SEND_ALL_EVENTS 0 / / 0 - to send only events the are bound to actions
/ / 1 - to send all button events to MQTT
# endif
# ifndef BUTTON_MQTT_RETAIN
# define BUTTON_MQTT_RETAIN 0
# endif
/ / Generic digital pin support
# ifndef BUTTON_PROVIDER_GPIO_SUPPORT
# define BUTTON_PROVIDER_GPIO_SUPPORT 1
# endif
/ / Resistor ladder support . Poll analog pin and return digital LOW when analog reading is in a certain range
/ / ref . https : / / github . com / bxparks / AceButton / tree / develop / docs / resistor_ladder
/ / Uses BUTTON # _ANALOG_LEVEL for the individual button level configuration
# ifndef BUTTON_PROVIDER_ANALOG_SUPPORT
# define BUTTON_PROVIDER_ANALOG_SUPPORT 0
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / ENCODER
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef ENCODER_SUPPORT
# define ENCODER_SUPPORT 0
# endif
# ifndef ENCODER_MINIMUM_DELTA
# define ENCODER_MINIMUM_DELTA 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / LED
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef LED_SUPPORT
# define LED_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / WIFI
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -1132,7 +1127,6 @@
# define MQTT_KEEPALIVE 120 / / MQTT keepalive value
# endif
# ifndef MQTT_RECONNECT_DELAY_MIN
# define MQTT_RECONNECT_DELAY_MIN 5000 / / Try to reconnect in 5 seconds upon disconnection
# endif
@ -1188,71 +1182,6 @@
# define MQTT_ENQUEUE_MESSAGE_ID 1
# endif
/ / These particles will be concatenated to the MQTT_TOPIC base to form the actual topic
# define MQTT_TOPIC_JSON "data"
# define MQTT_TOPIC_ACTION "action"
# define MQTT_TOPIC_RELAY "relay"
# define MQTT_TOPIC_LED "led"
# define MQTT_TOPIC_BUTTON "button"
# define MQTT_TOPIC_IP "ip"
# define MQTT_TOPIC_SSID "ssid"
# define MQTT_TOPIC_BSSID "bssid"
# define MQTT_TOPIC_VERSION "version"
# define MQTT_TOPIC_UPTIME "uptime"
# define MQTT_TOPIC_DATETIME "datetime"
# define MQTT_TOPIC_TIMESTAMP "timestamp"
# define MQTT_TOPIC_FREEHEAP "freeheap"
# define MQTT_TOPIC_VCC "vcc"
# ifndef MQTT_TOPIC_STATUS
# define MQTT_TOPIC_STATUS "status"
# endif
# define MQTT_TOPIC_MAC "mac"
# define MQTT_TOPIC_RSSI "rssi"
# define MQTT_TOPIC_MESSAGE_ID "id"
# define MQTT_TOPIC_APP "app"
# define MQTT_TOPIC_INTERVAL "interval"
# define MQTT_TOPIC_HOSTNAME "host"
# define MQTT_TOPIC_DESCRIPTION "desc"
# define MQTT_TOPIC_TIME "time"
# define MQTT_TOPIC_RFOUT "rfout"
# define MQTT_TOPIC_RFIN "rfin"
# define MQTT_TOPIC_RFLEARN "rflearn"
# define MQTT_TOPIC_RFRAW "rfraw"
# define MQTT_TOPIC_UARTIN "uartin"
# define MQTT_TOPIC_UARTOUT "uartout"
# define MQTT_TOPIC_LOADAVG "loadavg"
# define MQTT_TOPIC_BOARD "board"
# define MQTT_TOPIC_PULSE "pulse"
# define MQTT_TOPIC_SPEED "speed"
# define MQTT_TOPIC_IRIN "irin"
# define MQTT_TOPIC_IROUT "irout"
# define MQTT_TOPIC_OTA "ota"
# define MQTT_TOPIC_TELNET_REVERSE "telnet_reverse"
# define MQTT_TOPIC_CURTAIN "curtain"
# define MQTT_TOPIC_CMD "cmd"
/ / Light module
# define MQTT_TOPIC_LIGHT "light"
# define MQTT_TOPIC_CHANNEL "channel"
# define MQTT_TOPIC_COLOR_RGB "rgb"
# define MQTT_TOPIC_COLOR_HSV "hsv"
# define MQTT_TOPIC_ANIM_MODE "anim_mode"
# define MQTT_TOPIC_ANIM_SPEED "anim_speed"
# define MQTT_TOPIC_BRIGHTNESS "brightness"
# define MQTT_TOPIC_MIRED "mired"
# define MQTT_TOPIC_KELVIN "kelvin"
# define MQTT_TOPIC_TRANSITION "transition"
/ / Thermostat module
# define MQTT_TOPIC_HOLD_TEMP "hold_temp"
# define MQTT_TOPIC_HOLD_TEMP_MIN "min"
# define MQTT_TOPIC_HOLD_TEMP_MAX "max"
# define MQTT_TOPIC_REMOTE_TEMP "remote_temp"
# define MQTT_TOPIC_ASK_TEMP_RANGE "ask_temp_range"
# define MQTT_TOPIC_NOTIFY_TEMP_RANGE_MIN "notify_temp_range_min"
# define MQTT_TOPIC_NOTIFY_TEMP_RANGE_MAX "notify_temp_range_max"
# ifndef MQTT_STATUS_ONLINE
# define MQTT_STATUS_ONLINE "1" / / Value for the device ON message
# endif
@ -1492,7 +1421,6 @@
# define INFLUXDB_PASSWORD "" / / Default password
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / THINGSPEAK
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -1842,30 +1770,18 @@
# define PROMETHEUS_SUPPORT 0
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Generic Fan support
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef FAN_SUPPORT
# define FAN_SUPPORT 0
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / ITEAD iFan support
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Note : enabling this will also implicitly enable FAN_SUPPORT
# ifndef IFAN_SUPPORT
# define IFAN_SUPPORT 0
# endif
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / Configuration helpers
/ / Configuration helpers to help detect features
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Provide generic way to detect debugging support
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef DEBUG_SUPPORT
# define DEBUG_SUPPORT ( \
DEBUG_SERIAL_SUPPORT | | \
@ -1875,3 +1791,6 @@
)
# endif
# ifndef FAN_SUPPORT
# define FAN_SUPPORT IFAN_SUPPORT
# endif