diff --git a/platformio.ini b/platformio.ini index 59a0d24..8ec1912 100644 --- a/platformio.ini +++ b/platformio.ini @@ -8,18 +8,31 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:nodemcu-32s] +[common] platform = espressif32 board = nodemcu-32s framework = arduino -upload_port = COM3 upload_speed = 921600 monitor_speed = 115200 -build_flags = +build_flags = -I ./src/xcp - -I ./src/Receivers433 - -I ./src/Receivers433/Receivers3ByteKeys + -I ./src/Receivers433 + -I ./src/Receivers433/Receivers3ByteKeys lib_deps = - adafruit/Adafruit GFX Library@^1.12.4 - thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.6.1 - knolleary/PubSubClient @ ^2.8 + adafruit/Adafruit GFX Library@^1.12.4 + thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.6.1 + knolleary/PubSubClient @ ^2.8 + +[env:EG] +extends = common +upload_port = COM3 +build_flags = + ${common.build_flags} + -D VERSION_DG_ONLY=0 + +[env:DG] +extends = common +upload_port = COM3 +build_flags = + ${common.build_flags} + -D VERSION_DG_ONLY=1 diff --git a/src/MyMqttClient.cpp b/src/MyMqttClient.cpp index 9d8fdfe..8162c3a 100644 --- a/src/MyMqttClient.cpp +++ b/src/MyMqttClient.cpp @@ -124,7 +124,7 @@ void MyMqttClient::onLoop() { char payload[48]; snprintf(payload, sizeof(payload), - "{\"event\":\"rssi\",\"rssi\":%d}", (int)WiFi.RSSI()); + "{\"event\":\"rssi\",\"rssi\":%d, \"variant\": \"" PROJECT_VARIANT "\" }", (int)WiFi.RSSI()); mqttClient.publish(MQTT_TOPIC_STATUS, payload); } } diff --git a/src/main.h b/src/main.h index a68e232..bfe8a35 100644 --- a/src/main.h +++ b/src/main.h @@ -22,7 +22,9 @@ /* --------- SYMBOLIC CONSTANTS ---------*/ -#define VERSION_DG_ONLY 0 +#ifndef VERSION_DG_ONLY +#define VERSION_DG_ONLY 0 /* default: EG — overridden by build environment */ +#endif #define VERSION_SMALL_DISPLAY 1