; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env]
framework = arduino
lib_deps = 
	arduino-libraries/NTPClient@^3.2.1
	bblanchon/ArduinoJson@^6.20.0
	ihormelnyk/OpenTherm Library@^1.1.4
	knolleary/PubSubClient@^2.8
	jandrassy/TelnetStream@^1.2.4
	gyverlibs/EEManager@^2.0
	gyverlibs/GyverPID@^3.3
	gyverlibs/GyverBlinker@^1.0
	milesburton/DallasTemperature@^3.11.0
	laxilef/TinyLogger@^1.0.2
	https://github.com/Laxilef/WiFiManager/archive/refs/heads/patch-1.zip
	;https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2
build_flags = -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -mtext-section-literals
upload_speed = 921600
monitor_speed = 115200
version = 1.3.4

; Defaults
[esp8266_defaults]
platform = espressif8266
lib_deps = 
	${env.lib_deps}
	nrwiersma/ESP8266Scheduler@^1.0
lib_ignore = 
extra_scripts = 
	post:tools/build.py
build_flags = ${env.build_flags}

[esp32_defaults]
platform = espressif32
lib_deps =
	${env.lib_deps}
	laxilef/ESP32Scheduler@^1.0.0
lib_ignore = 
extra_scripts = 
	post:tools/esp32.py
	post:tools/build.py
build_flags = ${env.build_flags}


; Boards
[env:d1_mini]
platform = ${esp8266_defaults.platform}
board = d1_mini
lib_deps = ${esp8266_defaults.lib_deps}
lib_ignore = ${esp8266_defaults.lib_ignore}
extra_scripts = ${esp8266_defaults.extra_scripts}
build_flags = 
	${esp8266_defaults.build_flags}
	-D OT_IN_PIN_DEFAULT=4
	-D OT_OUT_PIN_DEFAULT=5
	-D SENSOR_OUTDOOR_PIN_DEFAULT=12
	-D SENSOR_INDOOR_PIN_DEFAULT=14
	-D LED_STATUS_PIN=13
	-D LED_OT_RX_PIN=15
	-D USE_TELNET=1

[env:d1_mini_lite]
platform = ${esp8266_defaults.platform}
board = d1_mini_lite
lib_deps = ${esp8266_defaults.lib_deps}
lib_ignore = ${esp8266_defaults.lib_ignore}
extra_scripts = ${esp8266_defaults.extra_scripts}
build_flags = 
	${esp8266_defaults.build_flags}
	-D OT_IN_PIN_DEFAULT=4
	-D OT_OUT_PIN_DEFAULT=5
	-D SENSOR_OUTDOOR_PIN_DEFAULT=12
	-D SENSOR_INDOOR_PIN_DEFAULT=14
	-D LED_STATUS_PIN=13
	-D LED_OT_RX_PIN=15
	-D USE_TELNET=1

[env:d1_mini_pro]
platform = ${esp8266_defaults.platform}
board = d1_mini_pro
lib_deps = ${esp8266_defaults.lib_deps}
lib_ignore = ${esp8266_defaults.lib_ignore}
extra_scripts = ${esp8266_defaults.extra_scripts}
build_flags = 
	${esp8266_defaults.build_flags}
	-D OT_IN_PIN_DEFAULT=4
	-D OT_OUT_PIN_DEFAULT=5
	-D SENSOR_OUTDOOR_PIN_DEFAULT=12
	-D SENSOR_INDOOR_PIN_DEFAULT=14
	-D LED_STATUS_PIN=13
	-D LED_OT_RX_PIN=15
	-D USE_TELNET=1

[env:s2_mini]
platform = ${esp32_defaults.platform}
board = lolin_s2_mini
lib_deps = ${esp32_defaults.lib_deps}
lib_ignore = ${esp32_defaults.lib_ignore}
extra_scripts = ${esp32_defaults.extra_scripts}
build_flags = 
	${esp32_defaults.build_flags}
	-D OT_IN_PIN_DEFAULT=33
	-D OT_OUT_PIN_DEFAULT=35
	-D SENSOR_OUTDOOR_PIN_DEFAULT=9
	-D SENSOR_INDOOR_PIN_DEFAULT=7
	-D LED_STATUS_PIN=11
	-D LED_OT_RX_PIN=12
	-D USE_TELNET=1

[env:s3_mini] 
platform = ${esp32_defaults.platform}
board = lolin_s3_mini
lib_deps = ${esp32_defaults.lib_deps}
lib_ignore = ${esp32_defaults.lib_ignore}
extra_scripts = ${esp32_defaults.extra_scripts}
build_flags = 
	${esp32_defaults.build_flags}
	-D OT_IN_PIN_DEFAULT=35
	-D OT_OUT_PIN_DEFAULT=36
	-D SENSOR_OUTDOOR_PIN_DEFAULT=13
	-D SENSOR_INDOOR_PIN_DEFAULT=12
	-D LED_STATUS_PIN=11
	-D LED_OT_RX_PIN=10
	-D USE_TELNET=1

[env:c3_mini] 
platform = ${esp32_defaults.platform}
board = lolin_c3_mini
lib_deps = ${esp32_defaults.lib_deps}
lib_ignore = ${esp32_defaults.lib_ignore}
extra_scripts = ${esp32_defaults.extra_scripts}
build_flags = 
	-D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
	-D OT_IN_PIN_DEFAULT=8
	-D OT_OUT_PIN_DEFAULT=10
	-D SENSOR_OUTDOOR_PIN_DEFAULT=0
	-D SENSOR_INDOOR_PIN_DEFAULT=1
	-D LED_STATUS_PIN=4
	-D LED_OT_RX_PIN=5
	-D USE_TELNET=1

[env:nodemcu_32s]
platform = ${esp32_defaults.platform}
board = nodemcu-32s
lib_deps = ${esp32_defaults.lib_deps}
lib_ignore = ${esp32_defaults.lib_ignore}
extra_scripts = ${esp32_defaults.extra_scripts}
build_flags = 
	${esp32_defaults.build_flags}
	-D OT_IN_PIN_DEFAULT=21
	-D OT_OUT_PIN_DEFAULT=22
	-D SENSOR_OUTDOOR_PIN_DEFAULT=12
	-D SENSOR_INDOOR_PIN_DEFAULT=13
	-D LED_STATUS_PIN=2 ; 18
	-D LED_OT_RX_PIN=19
	-D USE_TELNET=1
	;-D WOKWI=1
	;-D USE_TELNET=0
	;-D DEBUG_BY_DEFAULT=1
	;-D WM_DEBUG_MODE=3