mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 12:17:05 +00:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bb8669ed2 | ||
|
|
34f4a9a8e0 | ||
|
|
a517f3471c | ||
|
|
9c706b7b0e | ||
|
|
b1c8346700 | ||
|
|
272ed8c578 | ||
|
|
a9e473dbc6 | ||
|
|
4baccf5863 | ||
|
|
ad84eb8b8a | ||
|
|
23f2bfc6d8 | ||
|
|
34d2f25652 | ||
|
|
294683ece1 | ||
|
|
56bd1cb19c | ||
|
|
812f530c4b | ||
|
|
97258a531d | ||
|
|
7d2ef727a7 | ||
|
|
9e83213a13 |
@@ -21,6 +21,7 @@ for ENV in \
|
||||
dev_ESP8266PUYA_1024\
|
||||
dev_ESP8266PUYA_1024_VCC\
|
||||
hard_SONOFF_POW\
|
||||
hard_Shelly_1\
|
||||
esp32dev;\
|
||||
do
|
||||
echo
|
||||
|
||||
Vendored
+26
@@ -1,3 +1,29 @@
|
||||
-------------------------------------------------
|
||||
Changes in release mega-20180904 (since mega-20180903)
|
||||
-------------------------------------------------
|
||||
|
||||
Release date: Tue Sep 4 04:00:34 CEST 2018
|
||||
|
||||
TD-er (1):
|
||||
[#1702] Check for duplicate names bug
|
||||
|
||||
|
||||
-------------------------------------------------
|
||||
Changes in release mega-20180903 (since mega-20180826)
|
||||
-------------------------------------------------
|
||||
|
||||
Release date: Mon Sep 3 04:01:13 CEST 2018
|
||||
|
||||
TD-er (7):
|
||||
[Pio] Build issues
|
||||
[#1692] Add 2nd Receiver for Email notification
|
||||
Forgot to save before commit
|
||||
[#1549] Add page showing all system variables
|
||||
[sysvar] rename vars with leading zero to %..._0%
|
||||
[#1688] Add dew point computation as standard conversion
|
||||
[Shelly1] Add first test build for Shelly1 nodes
|
||||
|
||||
|
||||
-------------------------------------------------
|
||||
Changes in release mega-20180826 (since mega-20180822)
|
||||
-------------------------------------------------
|
||||
|
||||
+133
-5
@@ -66,17 +66,18 @@ platform = https://github.com/platformio/platform-espressif8266
|
||||
[core_esp32_0_12_0]
|
||||
platform = espressif32@0.12.0
|
||||
|
||||
[core_esp32_1_3_0]
|
||||
platform = espressif32@1.3.0
|
||||
|
||||
[core_esp32_1_2_0]
|
||||
platform = espressif32@1.2.0
|
||||
|
||||
[core_esp32_1_3_0]
|
||||
platform = espressif32@1.3.0
|
||||
|
||||
[core_esp32_stage]
|
||||
platform = https://github.com/platformio/platform-espressif32.git#feature/stage
|
||||
|
||||
[core_esp32]
|
||||
platform = ${core_esp32_0_12_0.platform}
|
||||
build_unflags = -Wall
|
||||
build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"'
|
||||
-lstdc++ -lsupc++
|
||||
lib_ignore = AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, SerialSensors, SDM
|
||||
@@ -84,12 +85,33 @@ lib_deps = ESP32WebServer
|
||||
monitor_speed = 115200
|
||||
|
||||
|
||||
|
||||
; Build Flags:
|
||||
; -DUSE_CONFIG_OVERRIDE
|
||||
; lwIP 1.4 (Default)
|
||||
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
|
||||
; lwIP 2 - Low Memory
|
||||
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
|
||||
; lwIP 2 - Higher Bandwitdh
|
||||
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
|
||||
; VTABLES in Flash (default)
|
||||
; -DVTABLES_IN_FLASH
|
||||
; VTABLES in Heap
|
||||
; -DVTABLES_IN_DRAM
|
||||
; VTABLES in IRAM
|
||||
; -DVTABLES_IN_IRAM
|
||||
|
||||
|
||||
[common]
|
||||
board_build.f_cpu = 80000000L
|
||||
build_unflags = ""
|
||||
build_flags = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"'
|
||||
-D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
|
||||
-D NDEBUG
|
||||
-D VTABLES_IN_FLASH
|
||||
-lstdc++ -lsupc++
|
||||
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
|
||||
-DVTABLES_IN_FLASH
|
||||
|
||||
|
||||
lib_deps = ""
|
||||
lib_ignore = ESP32_ping, ESP32WebServer, IRremoteESP8266
|
||||
lib_ldf_mode = chain
|
||||
@@ -116,36 +138,54 @@ lib_ignore = ESP32_ping, ESP32WebServer
|
||||
|
||||
[esp8266_1M]
|
||||
board_build.flash_mode = dout
|
||||
board_build.f_cpu = ${common.board_build.f_cpu}
|
||||
board_upload.maximum_size = 786432
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.1m128.ld
|
||||
|
||||
[esp8285_1M]
|
||||
board = esp8285
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
build_unflags = ${esp8266_1M.build_unflags}
|
||||
build_flags = ${esp8266_1M.build_flags} -DESP8285
|
||||
|
||||
[Sonoff]
|
||||
board = esp01_1m
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.1m128.ld
|
||||
platform = ${core_2_4_2.platform}
|
||||
|
||||
[Sonoff_8285]
|
||||
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
|
||||
board_build.flash_mode = ${esp8285_1M.board_build.flash_mode}
|
||||
board_build.f_cpu = ${esp8285_1M.board_build.f_cpu}
|
||||
board = ${esp8285_1M.board}
|
||||
build_unflags = ${esp8285_1M.build_unflags}
|
||||
build_flags = ${esp8285_1M.build_flags}
|
||||
platform = ${core_2_4_2.platform}
|
||||
|
||||
[espWroom2M]
|
||||
board_build.flash_mode = dout
|
||||
board_build.f_cpu = ${common.board_build.f_cpu}
|
||||
board = esp_wroom_02
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.2m.ld
|
||||
|
||||
[esp8266_2M]
|
||||
board_build.flash_mode = dio
|
||||
board_build.f_cpu = ${common.board_build.f_cpu}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.2m.ld
|
||||
|
||||
[esp8266_4M]
|
||||
board_build.flash_mode = dio
|
||||
board_build.f_cpu = ${common.board_build.f_cpu}
|
||||
build_unflags = ${common.build_unflags}
|
||||
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.4m1m.ld
|
||||
|
||||
;;; ESP32 pre-alpha test build ; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;;;
|
||||
@@ -156,6 +196,7 @@ build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.4m1m.ld
|
||||
[env:esp32dev]
|
||||
platform = ${core_esp32.platform}
|
||||
board = esp32dev
|
||||
build_unflags = ${core_esp32.build_unflags}
|
||||
build_flags = ${core_esp32.build_flags} -DPLUGIN_SET_GENERIC_ESP32
|
||||
lib_deps = ${core_esp32.lib_deps}
|
||||
lib_ignore = ${core_esp32.lib_ignore}
|
||||
@@ -182,7 +223,9 @@ upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board = ${common.board}
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_1M.build_unflags}
|
||||
build_flags = ${esp8266_1M.build_flags}
|
||||
|
||||
; NORMAL: 1024k for esp8285 ----------------------
|
||||
@@ -197,7 +240,9 @@ upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board = ${esp8285_1M.board}
|
||||
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8285_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8285_1M.board_build.flash_mode}
|
||||
build_unflags = ${esp8285_1M.build_unflags}
|
||||
build_flags = ${esp8285_1M.build_flags}
|
||||
|
||||
; NORMAL: 2048k version --------------------------
|
||||
@@ -211,7 +256,9 @@ framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board = ${espWroom2M.board}
|
||||
board_build.f_cpu = ${espWroom2M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${espWroom2M.board_build.flash_mode}
|
||||
build_unflags = ${espWroom2M.build_unflags}
|
||||
build_flags = ${espWroom2M.build_flags}
|
||||
|
||||
; NORMAL: 4096k version --------------------------
|
||||
@@ -225,7 +272,9 @@ framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board = ${common.board}
|
||||
board_build.f_cpu = ${esp8266_4M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_4M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_4M.build_unflags}
|
||||
build_flags = ${esp8266_4M.build_flags}
|
||||
|
||||
|
||||
@@ -241,7 +290,9 @@ framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board = ${common.board}
|
||||
board_build.f_cpu = ${esp8266_4M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_4M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_4M.build_unflags}
|
||||
build_flags = ${esp8266_4M.build_flags} -DPLUGIN_BUILD_NORMAL_IR
|
||||
|
||||
|
||||
@@ -262,6 +313,8 @@ monitor_speed = ${common.monitor_speed}
|
||||
board = ${common.board}
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
build_unflags = ${esp8266_1M.build_unflags}
|
||||
build_flags = ${esp8266_1M.build_flags} -D PLUGIN_BUILD_TESTING
|
||||
|
||||
; TEST: 1024k for esp8285 ------------------------
|
||||
@@ -275,8 +328,10 @@ framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8285_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8285_1M.board_build.flash_mode}
|
||||
board = ${esp8285_1M.board}
|
||||
build_unflags = ${esp8285_1M.build_unflags}
|
||||
build_flags = ${esp8285_1M.build_flags} -D PLUGIN_BUILD_TESTING
|
||||
|
||||
; TEST: 2048k version ----------------------------
|
||||
@@ -289,8 +344,10 @@ lib_archive = ${common.lib_archive}
|
||||
framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_build.f_cpu = ${espWroom2M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${espWroom2M.board_build.flash_mode}
|
||||
board = ${espWroom2M.board}
|
||||
build_unflags = ${espWroom2M.build_unflags}
|
||||
build_flags = ${espWroom2M.build_flags} -D PLUGIN_BUILD_TESTING
|
||||
|
||||
; TEST: 4096k version ----------------------------
|
||||
@@ -304,7 +361,9 @@ framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_build.f_cpu = ${esp8266_4M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_4M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_4M.build_unflags}
|
||||
build_flags = ${esp8266_4M.build_flags} -D PLUGIN_BUILD_TESTING
|
||||
|
||||
; TEST: 4096k version + FEATURE_ADC_VCC ----------
|
||||
@@ -318,7 +377,9 @@ framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_build.f_cpu = ${esp8266_4M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_4M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_4M.build_unflags}
|
||||
build_flags = ${esp8266_4M.build_flags} -D PLUGIN_BUILD_TESTING -D FEATURE_ADC_VCC=true
|
||||
|
||||
|
||||
@@ -338,8 +399,10 @@ framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
board = ${common.board}
|
||||
build_unflags = ${esp8266_1M.build_unflags}
|
||||
build_flags = ${esp8266_1M.build_flags} -D PLUGIN_BUILD_DEV
|
||||
|
||||
; DEV: 1024k for esp8285 -------------------------
|
||||
@@ -353,8 +416,10 @@ framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8285_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8285_1M.board_build.flash_mode}
|
||||
board = ${esp8285_1M.board}
|
||||
build_unflags = ${esp8285_1M.build_unflags}
|
||||
build_flags = ${esp8285_1M.build_flags} -D PLUGIN_BUILD_DEV
|
||||
|
||||
; DEV: 2048k version -----------------------------
|
||||
@@ -367,8 +432,10 @@ lib_archive = ${common.lib_archive}
|
||||
framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_build.f_cpu = ${espWroom2M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${espWroom2M.board_build.flash_mode}
|
||||
board = ${espWroom2M.board}
|
||||
build_unflags = ${espWroom2M.build_unflags}
|
||||
build_flags = ${espWroom2M.build_flags} -D PLUGIN_BUILD_DEV
|
||||
|
||||
; DEV : 4096k version ----------------------------
|
||||
@@ -382,7 +449,9 @@ framework = ${common.framework}
|
||||
board = ${common.board}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_build.f_cpu = ${esp8266_4M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_4M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_4M.build_unflags}
|
||||
build_flags = ${esp8266_4M.build_flags} -D PLUGIN_BUILD_DEV
|
||||
|
||||
|
||||
@@ -403,7 +472,9 @@ board = ${common.board}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_1M.build_unflags}
|
||||
build_flags = ${esp8266_1M.build_flags} -D PLUGIN_BUILD_DEV -D FLASH_QUIRK_WRITE_0_TO_1
|
||||
|
||||
; DEV+PUYA : 1024k version + FEATURE_ADC_VCC -----
|
||||
@@ -418,7 +489,9 @@ board = ${common.board}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
build_unflags = ${esp8266_1M.build_unflags}
|
||||
build_flags = ${esp8266_1M.build_flags} -D PLUGIN_BUILD_DEV -D FLASH_QUIRK_WRITE_0_TO_1 -D FEATURE_ADC_VCC=true
|
||||
|
||||
|
||||
@@ -440,8 +513,10 @@ build_flags = ${esp8266_1M.build_flags} -D PLUGIN_BUILD_DEV -D FLA
|
||||
;lib_ignore = ${common.lib_ignore}
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
;board = ${Sonoff.board}
|
||||
;build_unflags = ${Sonoff.build_unflags}
|
||||
;build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_BASIC
|
||||
|
||||
; ITEAD / SONOFF TH10 version -------------------
|
||||
@@ -454,8 +529,10 @@ build_flags = ${esp8266_1M.build_flags} -D PLUGIN_BUILD_DEV -D FLA
|
||||
;lib_ignore = ${common.lib_ignore}
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
;board = ${Sonoff.board}
|
||||
;build_unflags = ${Sonoff.build_unflags}
|
||||
;build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_TH10
|
||||
|
||||
; ITEAD / SONOFF TH16 version -------------------
|
||||
@@ -468,8 +545,10 @@ build_flags = ${esp8266_1M.build_flags} -D PLUGIN_BUILD_DEV -D FLA
|
||||
;lib_ignore = ${common.lib_ignore}
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
;board = ${Sonoff.board}
|
||||
;build_unflags = ${Sonoff.build_unflags}
|
||||
;build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_TH16
|
||||
|
||||
; ITEAD / SONOFF POW version --------------------
|
||||
@@ -489,8 +568,10 @@ lib_deps = ${common.lib_deps}
|
||||
lib_ignore = ${common.lib_ignore}
|
||||
lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
lib_archive = ${common.lib_archive}
|
||||
board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
board = ${Sonoff.board}
|
||||
build_unflags = ${Sonoff.build_unflags}
|
||||
build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW
|
||||
|
||||
; Sonoff Pow R2 (ESP8266 - CSE7766)
|
||||
@@ -508,8 +589,10 @@ lib_deps = ${common.lib_deps}
|
||||
lib_ignore = ${common.lib_ignore}
|
||||
lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
lib_archive = ${common.lib_archive}
|
||||
board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
board = ${Sonoff.board}
|
||||
build_unflags = ${Sonoff.build_unflags}
|
||||
build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
|
||||
; ITEAD / SONOFF S20 version --------------------
|
||||
@@ -522,8 +605,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ignore = ${common.lib_ignore}
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
;board = ${Sonoff.board}
|
||||
;build_unflags = ${Sonoff.build_unflags}
|
||||
;build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_S20
|
||||
|
||||
; ITEAD / SONOFF 4CH version --------------------
|
||||
@@ -536,8 +621,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ignore = ${common.lib_ignore}
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
;board = ${Sonoff.board}
|
||||
;build_unflags = ${Sonoff.build_unflags}
|
||||
;build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_4CH
|
||||
|
||||
; ITEAD / SONOFF TOUCH version ------------------
|
||||
@@ -550,10 +637,31 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ignore = ${common.lib_ignore}
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_build.f_cpu = ${Sonoff.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${Sonoff.board_build.flash_mode}
|
||||
;board = ${Sonoff.board}
|
||||
;build_unflags = ${Sonoff.build_unflags}
|
||||
;build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_TOUCH
|
||||
|
||||
; Shelly1 Open Source (ESP8266-2MB)
|
||||
; https://shelly.cloud/shelly1-open-source/
|
||||
; GPIO04 Relay (non inverted)
|
||||
; GPIO05 Button
|
||||
[env:hard_Shelly_1]
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
framework = ${common.framework}
|
||||
platform = ${common.platform}
|
||||
lib_deps = ${common.lib_deps}
|
||||
lib_ignore = ${common.lib_ignore}
|
||||
lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
lib_archive = ${common.lib_archive}
|
||||
board_build.f_cpu = ${esp8266_2M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_2M.board_build.flash_mode}
|
||||
board = ${common.board}
|
||||
build_unflags = ${esp8266_2M.build_unflags}
|
||||
build_flags = ${esp8266_2M.build_flags} -D PLUGIN_SET_SHELLY_1
|
||||
|
||||
|
||||
|
||||
; LED Strips ; ****; ****; ****; ****; ****; ****;
|
||||
@@ -569,8 +677,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_H801
|
||||
|
||||
; MagicHome / Led Controller ---------------------
|
||||
@@ -584,8 +694,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_MAGICHOME
|
||||
|
||||
; MagicHome / Led Controller with IR -------------
|
||||
@@ -599,8 +711,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_MAGICHOME_IR
|
||||
|
||||
|
||||
@@ -621,8 +735,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_TEMP
|
||||
|
||||
|
||||
@@ -637,8 +753,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_CARBON
|
||||
|
||||
;; Easy Nextion ----------------------------------
|
||||
@@ -655,8 +773,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_OLED1
|
||||
|
||||
; Easy OLED Display v2 ---------------------------
|
||||
@@ -670,8 +790,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_OLED2
|
||||
|
||||
; Easy Relay Switch ------------------------------
|
||||
@@ -685,8 +807,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_RELAY
|
||||
|
||||
; Easy Generic (1M) device ----------------------
|
||||
@@ -700,8 +824,10 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
|
||||
;lib_ldf_mode = ${common.lib_ldf_mode}
|
||||
;lib_archive = ${common.lib_archive}
|
||||
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
;board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
;board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
;board = esp01_1m
|
||||
;build_unflags = ${esp8266_1M.build_unflags}
|
||||
;build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_GENERIC_1M
|
||||
|
||||
; Ventus W266 weather station
|
||||
@@ -716,6 +842,8 @@ framework = ${common.framework}
|
||||
upload_speed = ${common.upload_speed}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
|
||||
board_build.f_cpu = ${esp8266_1M.board_build.f_cpu}
|
||||
board_build.flash_mode = ${esp8266_1M.board_build.flash_mode}
|
||||
board = ${common.board}
|
||||
build_unflags = ${esp8266_1M.build_unflags}
|
||||
build_flags = ${esp8266_1M.build_flags} -D PLUGIN_SET_VENTUS_W266
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ String checkTaskSettings(byte taskIndex) {
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < TASKS_MAX; ++i) {
|
||||
if (i != taskIndex) {
|
||||
if (i != taskIndex && Settings.TaskDeviceEnabled[i]) {
|
||||
LoadTaskSettings(i);
|
||||
if (ExtraTaskSettings.TaskDeviceName[0] != 0) {
|
||||
if (strcasecmp(ExtraTaskSettings.TaskDeviceName, deviceName.c_str()) == 0) {
|
||||
|
||||
+61
-22
@@ -513,16 +513,25 @@ void parseSystemVariables(String& s, boolean useURLencode)
|
||||
// valueString is being used by the macro.
|
||||
char valueString[5];
|
||||
#define SMART_REPL_TIME(T,F,V) if (s.indexOf(T) != -1) { sprintf_P(valueString, (F), (V)); repl((T),valueString, s, useURLencode);}
|
||||
SMART_REPL_TIME(F("%syshour%"), PSTR("%02d"), hour())
|
||||
SMART_REPL_TIME(F("%sysmin%"), PSTR("%02d"), minute())
|
||||
SMART_REPL_TIME(F("%syssec%"),PSTR("%02d"), second())
|
||||
SMART_REPL_TIME(F("%sysyear%"), PSTR("%d"), year())
|
||||
SMART_REPL_TIME(F("%sysmonth%"),PSTR("%d"), month())
|
||||
SMART_REPL_TIME(F("%sysday%"), PSTR("%d"), day())
|
||||
SMART_REPL_TIME(F("%syshour%"), PSTR("%d"), hour())
|
||||
SMART_REPL_TIME(F("%sysmin%"), PSTR("%d"), minute())
|
||||
SMART_REPL_TIME(F("%syssec%"),PSTR("%d"), second())
|
||||
SMART_REPL_TIME(F("%syssec_d%"),PSTR("%d"), ((hour()*60) + minute())*60 + second());
|
||||
SMART_REPL_TIME(F("%sysday%"), PSTR("%02d"), day())
|
||||
SMART_REPL_TIME(F("%sysmonth%"),PSTR("%02d"), month())
|
||||
SMART_REPL_TIME(F("%sysyear%"), PSTR("%04d"), year())
|
||||
SMART_REPL_TIME(F("%sysyears%"),PSTR("%02d"), year()%100)
|
||||
SMART_REPL(F("%sysweekday%"), String(weekday()))
|
||||
SMART_REPL(F("%sysweekday_s%"), weekday_str())
|
||||
|
||||
// With leading zero
|
||||
SMART_REPL_TIME(F("%sysyears%"),PSTR("%02d"), year()%100)
|
||||
SMART_REPL_TIME(F("%sysyear_0%"), PSTR("%04d"), year())
|
||||
SMART_REPL_TIME(F("%syshour_0%"), PSTR("%02d"), hour())
|
||||
SMART_REPL_TIME(F("%sysday_0%"), PSTR("%02d"), day())
|
||||
SMART_REPL_TIME(F("%sysmin_0%"), PSTR("%02d"), minute())
|
||||
SMART_REPL_TIME(F("%syssec_0%"),PSTR("%02d"), second())
|
||||
SMART_REPL_TIME(F("%sysmonth_0%"),PSTR("%02d"), month())
|
||||
|
||||
#undef SMART_REPL_TIME
|
||||
}
|
||||
SMART_REPL(F("%lcltime%"), getDateTimeString('-',':',' '))
|
||||
@@ -584,6 +593,33 @@ void parseEventVariables(String& s, struct EventStruct *event, boolean useURLenc
|
||||
#undef SMART_REPL
|
||||
|
||||
bool getConvertArgument(const String& marker, const String& s, float& argument, int& startIndex, int& endIndex) {
|
||||
String argumentString;
|
||||
if (getConvertArgumentString(marker, s, argumentString, startIndex, endIndex)) {
|
||||
if (!isFloat(argumentString)) return false;
|
||||
argument = argumentString.toFloat();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool getConvertArgument2(const String& marker, const String& s, float& arg1, float& arg2, int& startIndex, int& endIndex) {
|
||||
String argumentString;
|
||||
if (getConvertArgumentString(marker, s, argumentString, startIndex, endIndex)) {
|
||||
int pos_comma = argumentString.indexOf(',');
|
||||
if (pos_comma == -1) return false;
|
||||
String arg1_s = argumentString.substring(0, pos_comma);
|
||||
if (!isFloat(arg1_s)) return false;
|
||||
String arg2_s = argumentString.substring(pos_comma+1);
|
||||
if (!isFloat(arg2_s)) return false;
|
||||
arg1 = arg1_s.toFloat();
|
||||
arg2 = arg2_s.toFloat();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool getConvertArgumentString(const String& marker, const String& s, String& argumentString, int& startIndex, int& endIndex) {
|
||||
startIndex = s.indexOf(marker);
|
||||
if (startIndex == -1) return false;
|
||||
|
||||
@@ -595,10 +631,8 @@ bool getConvertArgument(const String& marker, const String& s, float& argument,
|
||||
endIndex = s.indexOf(')', startIndexArgument);
|
||||
if (endIndex == -1) return false;
|
||||
|
||||
String argumentString = s.substring(startIndexArgument, endIndex);
|
||||
if (argumentString.length() == 0 || !isFloat(argumentString)) return false;
|
||||
|
||||
argument = argumentString.toFloat();
|
||||
argumentString = s.substring(startIndexArgument, endIndex);
|
||||
if (argumentString.length() == 0) return false;
|
||||
++endIndex; // Must also strip ')' from the original string.
|
||||
return true;
|
||||
}
|
||||
@@ -609,21 +643,26 @@ void parseStandardConversions(String& s, boolean useURLencode) {
|
||||
if (s.indexOf(F("%c_")) == -1)
|
||||
return; // Nothing to replace
|
||||
|
||||
float arg = 0.0;
|
||||
float arg1 = 0.0;
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
// These replacements should be done in a while loop per marker,
|
||||
// since they also replace the numerical parameter.
|
||||
// The marker may occur more than once per string, but with different parameters.
|
||||
#define SMART_CONV(T,FUN) while (getConvertArgument((T), s, arg, startIndex, endIndex)) { repl(s.substring(startIndex, endIndex), (FUN), s, useURLencode); }
|
||||
SMART_CONV(F("%c_w_dir%"), getBearing(arg))
|
||||
SMART_CONV(F("%c_c2f%"), toString(CelsiusToFahrenheit(arg), 1))
|
||||
SMART_CONV(F("%c_ms2Bft%"), String(m_secToBeaufort(arg)))
|
||||
SMART_CONV(F("%c_cm2imp%"), centimeterToImperialLength(arg))
|
||||
SMART_CONV(F("%c_mm2imp%"), millimeterToImperialLength(arg))
|
||||
SMART_CONV(F("%c_m2day%"), toString(minutesToDay(arg), 2))
|
||||
SMART_CONV(F("%c_m2dh%"), minutesToDayHour(arg))
|
||||
SMART_CONV(F("%c_m2dhm%"), minutesToDayHourMinute(arg))
|
||||
SMART_CONV(F("%c_s2dhms%"), secondsToDayHourMinuteSecond(arg))
|
||||
#define SMART_CONV(T,FUN) while (getConvertArgument((T), s, arg1, startIndex, endIndex)) { repl(s.substring(startIndex, endIndex), (FUN), s, useURLencode); }
|
||||
SMART_CONV(F("%c_w_dir%"), getBearing(arg1))
|
||||
SMART_CONV(F("%c_c2f%"), toString(CelsiusToFahrenheit(arg1), 2))
|
||||
SMART_CONV(F("%c_ms2Bft%"), String(m_secToBeaufort(arg1)))
|
||||
SMART_CONV(F("%c_cm2imp%"), centimeterToImperialLength(arg1))
|
||||
SMART_CONV(F("%c_mm2imp%"), millimeterToImperialLength(arg1))
|
||||
SMART_CONV(F("%c_m2day%"), toString(minutesToDay(arg1), 2))
|
||||
SMART_CONV(F("%c_m2dh%"), minutesToDayHour(arg1))
|
||||
SMART_CONV(F("%c_m2dhm%"), minutesToDayHourMinute(arg1))
|
||||
SMART_CONV(F("%c_s2dhms%"), secondsToDayHourMinuteSecond(arg1))
|
||||
#undef SMART_CONV
|
||||
// Conversions with 2 parameters
|
||||
#define SMART_CONV(T,FUN) while (getConvertArgument2((T), s, arg1, arg2, startIndex, endIndex)) { repl(s.substring(startIndex, endIndex), (FUN), s, useURLencode); }
|
||||
float arg2 = 0.0;
|
||||
SMART_CONV(F("%c_dew_th%"), toString(compute_dew_point_temp(arg1, arg2), 2))
|
||||
#undef SMART_CONV
|
||||
}
|
||||
|
||||
+212
-20
@@ -480,6 +480,7 @@ void WebServerInit()
|
||||
WebServer.on(F("/rules"), handle_rules);
|
||||
WebServer.on(F("/sysinfo"), handle_sysinfo);
|
||||
WebServer.on(F("/pinstates"), handle_pinstates);
|
||||
WebServer.on(F("/sysvars"), handle_sysvars);
|
||||
WebServer.on(F("/favicon.ico"), handle_favicon);
|
||||
|
||||
#if defined(ESP8266)
|
||||
@@ -1432,6 +1433,10 @@ void html_TR_TD() {
|
||||
html_TD();
|
||||
}
|
||||
|
||||
void html_BR() {
|
||||
TXBuffer += F("<BR>");
|
||||
}
|
||||
|
||||
void html_TR_TD_height(int height) {
|
||||
TXBuffer += F("<TR><TD HEIGHT=\"");
|
||||
TXBuffer += height;
|
||||
@@ -1877,6 +1882,7 @@ void handle_devices() {
|
||||
PluginCall(PLUGIN_EXIT, &TempEvent, dummyString);
|
||||
|
||||
taskClear(taskIndex, false); // clear settings, but do not save
|
||||
ClearCustomTaskSettings(taskIndex);
|
||||
|
||||
Settings.TaskDeviceNumber[taskIndex] = taskdevicenumber;
|
||||
if (taskdevicenumber != 0) // set default values if a new device has been selected
|
||||
@@ -1884,8 +1890,9 @@ void handle_devices() {
|
||||
//NOTE: do not enable task by default. allow user to enter sensible valus first and let him enable it when ready.
|
||||
if (ExtraTaskSettings.TaskDeviceValueNames[0][0] == 0) // if field set empty, reload defaults
|
||||
PluginCall(PLUGIN_GET_DEVICEVALUENAMES, &TempEvent, dummyString); //the plugin should populate ExtraTaskSettings with its default values.
|
||||
|
||||
ClearCustomTaskSettings(taskIndex);
|
||||
} else {
|
||||
SaveTaskSettings(taskIndex);
|
||||
SaveSettings();
|
||||
}
|
||||
}
|
||||
else if (taskdevicenumber != 0) //save settings
|
||||
@@ -2312,7 +2319,8 @@ void handle_devices() {
|
||||
|
||||
addFormSeparator(4);
|
||||
|
||||
html_TR_TD(); TXBuffer += F("<TD colspan='3'><a class='button link' href=\"devices?setpage=");
|
||||
html_TR_TD();
|
||||
TXBuffer += F("<TD colspan='3'><a class='button link' href=\"devices?setpage=");
|
||||
TXBuffer += page;
|
||||
TXBuffer += F("\">Close</a>");
|
||||
addSubmitButton();
|
||||
@@ -2759,6 +2767,24 @@ void addCopyButton(const String &value, const String &delimiter, const String &n
|
||||
//********************************************************************************
|
||||
// Add a header
|
||||
//********************************************************************************
|
||||
void addTableSeparator(const String& label, int colspan, int h_size) {
|
||||
addTableSeparator(label, colspan, h_size, "");
|
||||
}
|
||||
|
||||
void addTableSeparator(const String& label, int colspan, int h_size, const String& helpButton) {
|
||||
TXBuffer += F("<TR><TD colspan=");
|
||||
TXBuffer += colspan;
|
||||
TXBuffer += "><H";
|
||||
TXBuffer += h_size;
|
||||
TXBuffer += '>';
|
||||
TXBuffer += label;
|
||||
if (helpButton.length() > 0)
|
||||
addHelpButton(helpButton);
|
||||
TXBuffer += "</H";
|
||||
TXBuffer += h_size;
|
||||
TXBuffer += F("></TD></TR>");
|
||||
}
|
||||
|
||||
void addFormHeader(const String& header1, const String& header2)
|
||||
{
|
||||
TXBuffer += F("<TR><TH>");
|
||||
@@ -2770,9 +2796,7 @@ void addFormHeader(const String& header1, const String& header2)
|
||||
|
||||
void addFormHeader(const String& header)
|
||||
{
|
||||
TXBuffer += F("<TR><TD colspan='2'><h2>");
|
||||
TXBuffer += header;
|
||||
TXBuffer += F("</h2>");
|
||||
addTableSeparator(header, 2, 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -2781,9 +2805,7 @@ void addFormHeader(const String& header)
|
||||
//********************************************************************************
|
||||
void addFormSubHeader(const String& header)
|
||||
{
|
||||
TXBuffer += F("<TR><TD colspan='2'><h3>");
|
||||
TXBuffer += header;
|
||||
TXBuffer += F("</h3>");
|
||||
addTableSeparator(header, 2, 3);
|
||||
}
|
||||
|
||||
|
||||
@@ -3197,6 +3219,11 @@ void handle_tools() {
|
||||
html_TD();
|
||||
TXBuffer += F("Show Pin state buffer");
|
||||
|
||||
html_TR_TD_height(30);
|
||||
addWideButton(F("sysvars"), F("System Variables"), F(""));
|
||||
html_TD();
|
||||
TXBuffer += F("Show all system variables and conversions");
|
||||
|
||||
addFormSubHeader(F("Wifi"));
|
||||
|
||||
html_TR_TD_height(30);
|
||||
@@ -5111,9 +5138,7 @@ void handle_sysinfo() {
|
||||
html_TR_TD(); TXBuffer += F("Reset Reason<TD>");
|
||||
TXBuffer += getResetReasonString();
|
||||
|
||||
TXBuffer += F("<TR><TD colspan=2><H3>Network");
|
||||
addHelpButton(F("Wifi"));
|
||||
TXBuffer += F("</H3></TD></TR>");
|
||||
addTableSeparator(F("Network"), 2, 3, F("Wifi"));
|
||||
|
||||
if (wifiStatus == ESPEASY_WIFI_SERVICES_INITIALIZED)
|
||||
{
|
||||
@@ -5206,7 +5231,7 @@ void handle_sysinfo() {
|
||||
html_TR_TD(); TXBuffer += F("Number reconnects<TD>");
|
||||
TXBuffer += wifi_reconnects;
|
||||
|
||||
TXBuffer += F("<TR><TD colspan=2><H3>Firmware</H3></TD></TR>");
|
||||
addTableSeparator(F("Firmware"), 2, 3);
|
||||
|
||||
TXBuffer += F("<TR><TD id='copyText_1'>Build<TD id='copyText_2'>");
|
||||
TXBuffer += BUILD;
|
||||
@@ -5239,7 +5264,7 @@ void handle_sysinfo() {
|
||||
TXBuffer += F("<TR><TD id='copyText_11'>Binary filename<TD id='copyText_12'>");
|
||||
TXBuffer += String(CRCValues.binaryFilename);
|
||||
|
||||
TXBuffer += F("<TR><TD colspan=2><H3>ESP board</H3></TD></TR>");
|
||||
addTableSeparator(F("ESP board"), 2, 3);
|
||||
|
||||
html_TR_TD(); TXBuffer += F("ESP Chip ID<TD>");
|
||||
#if defined(ESP8266)
|
||||
@@ -5273,8 +5298,7 @@ void handle_sysinfo() {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
TXBuffer += F("<TR><TD colspan=2><H3>Storage</H3></TD></TR>");
|
||||
addTableSeparator(F("Storage"), 2, 3);
|
||||
|
||||
html_TR_TD(); TXBuffer += F("Flash Chip ID<TD>");
|
||||
#if defined(ESP8266)
|
||||
@@ -5331,7 +5355,7 @@ void handle_sysinfo() {
|
||||
#endif
|
||||
|
||||
if (showSettingsFileLayout) {
|
||||
TXBuffer += F("<TR><TD colspan=2><H3>Settings Files</H3></TD></TR>");
|
||||
addTableSeparator(F("Settings Files"), 2, 3);
|
||||
html_TR_TD();
|
||||
TXBuffer += F("Layout Settings File");
|
||||
html_TD();
|
||||
@@ -5350,9 +5374,8 @@ void handle_sysinfo() {
|
||||
}
|
||||
|
||||
#ifdef ESP32
|
||||
TXBuffer += F("<TR><TD colspan=2><H3>Partitions");
|
||||
addHelpButton(F("https://dl.espressif.com/doc/esp-idf/latest/api-guides/partition-tables.html"));
|
||||
TXBuffer += F("</H3></TD></TR>");
|
||||
addTableSeparator(F("Partitions"), 2, 3,
|
||||
F("https://dl.espressif.com/doc/esp-idf/latest/api-guides/partition-tables.html"));
|
||||
|
||||
html_TR_TD(); TXBuffer += F("Data Partition Table<TD>");
|
||||
// TXBuffer += getPartitionTableHeader(F(" - "), F("<BR>"));
|
||||
@@ -5370,6 +5393,175 @@ void handle_sysinfo() {
|
||||
TXBuffer.endStream();
|
||||
}
|
||||
|
||||
void addSysVar_html(const String& input) {
|
||||
html_TR_TD();
|
||||
TXBuffer += F("<pre>"); // Make monospaced (<tt> tag?)
|
||||
TXBuffer += F("<xmp>"); // Make sure HTML code is escaped. Tag depricated??
|
||||
TXBuffer += input;
|
||||
TXBuffer += F("</xmp>");
|
||||
TXBuffer += F("</pre>");
|
||||
html_TD();
|
||||
String replacement(input); // Make deepcopy for replacement
|
||||
parseSystemVariables(replacement, false); // Not URL encoded
|
||||
parseStandardConversions(replacement, false);
|
||||
TXBuffer += replacement;
|
||||
html_TD();
|
||||
replacement = input;
|
||||
parseSystemVariables(replacement, true); // URL encoded
|
||||
parseStandardConversions(replacement, true);
|
||||
TXBuffer += replacement;
|
||||
yield();
|
||||
}
|
||||
|
||||
|
||||
//********************************************************************************
|
||||
// Web Interface sysvars showing all system vars and their value.
|
||||
//********************************************************************************
|
||||
void handle_sysvars() {
|
||||
checkRAM(F("handle_sysvars"));
|
||||
if (!isLoggedIn()) return;
|
||||
TXBuffer.startStream();
|
||||
sendHeadandTail(F("TmplStd"));
|
||||
|
||||
addHeader(true, TXBuffer.buf);
|
||||
|
||||
html_BR();
|
||||
TXBuffer += F("<p>This page may load slow.<BR>Do not load too often, since it may affect performance of the node.</p>");
|
||||
html_BR();
|
||||
|
||||
// the table header
|
||||
TXBuffer += F("<table class='normal'><TR><TH align='left'>System Variables<TH align='left'>Normal<TH align='left'>URL encoded");
|
||||
addHelpButton(F("ESPEasy_System_Variables"));
|
||||
|
||||
addTableSeparator(F("Constants"), 3, 3);
|
||||
addSysVar_html(F("%CR%"));
|
||||
addSysVar_html(F("%LF%"));
|
||||
addSysVar_html(F("%SP%"));
|
||||
addSysVar_html(F("%R%"));
|
||||
addSysVar_html(F("%N%"));
|
||||
|
||||
addTableSeparator(F("Network"), 3, 3);
|
||||
addSysVar_html(F("%mac%"));
|
||||
#if defined(ESP8266)
|
||||
addSysVar_html(F("%mac_int%"));
|
||||
#endif
|
||||
addSysVar_html(F("%ip4%"));
|
||||
addSysVar_html(F("%ip%"));
|
||||
addSysVar_html(F("%rssi%"));
|
||||
addSysVar_html(F("%ssid%"));
|
||||
addSysVar_html(F("%bssid%"));
|
||||
addSysVar_html(F("%wi_ch%"));
|
||||
|
||||
addTableSeparator(F("System"), 3, 3);
|
||||
addSysVar_html(F("%unit%"));
|
||||
addSysVar_html(F("%sysload%"));
|
||||
addSysVar_html(F("%sysheap%"));
|
||||
addSysVar_html(F("%sysname%"));
|
||||
#if FEATURE_ADC_VCC
|
||||
addSysVar_html(F("%vcc%"));
|
||||
#endif
|
||||
|
||||
addTableSeparator(F("Time"), 3, 3);
|
||||
addSysVar_html(F("%lcltime%"));
|
||||
addSysVar_html(F("%lcltime_am%"));
|
||||
addSysVar_html(F("%systm_hm%"));
|
||||
addSysVar_html(F("%systm_hm_am%"));
|
||||
addSysVar_html(F("%systime%"));
|
||||
addSysVar_html(F("%systime_am%"));
|
||||
addTableSeparator(F("System"), 3, 3);
|
||||
addSysVar_html(F("%sysyear% // %sysyear_0%"));
|
||||
addSysVar_html(F("%sysyears%"));
|
||||
addSysVar_html(F("%sysmonth% // %sysmonth_0%"));
|
||||
addSysVar_html(F("%sysday% // %sysday_0%"));
|
||||
addSysVar_html(F("%syshour% // %syshour_0%"));
|
||||
addSysVar_html(F("%sysmin% // %sysmin_0%"));
|
||||
addSysVar_html(F("%syssec% // %syssec_0%"));
|
||||
addSysVar_html(F("%syssec_d%"));
|
||||
addSysVar_html(F("%sysweekday%"));
|
||||
addSysVar_html(F("%sysweekday_s%"));
|
||||
addTableSeparator(F("System"), 3, 3);
|
||||
addSysVar_html(F("%uptime%"));
|
||||
addSysVar_html(F("%unixtime%"));
|
||||
addSysVar_html(F("%sunset%"));
|
||||
addSysVar_html(F("%sunset-1h%"));
|
||||
addSysVar_html(F("%sunrise%"));
|
||||
addSysVar_html(F("%sunrise+10m%"));
|
||||
|
||||
addTableSeparator(F("Special Characters"), 3, 2);
|
||||
addTableSeparator(F("Degree"), 3, 3);
|
||||
addSysVar_html(F("{D}"));
|
||||
addSysVar_html(F("°"));
|
||||
|
||||
addTableSeparator(F("Angle quotes"), 3, 3);
|
||||
addSysVar_html(F("{<<}"));
|
||||
addSysVar_html(F("«"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{>>}"));
|
||||
addSysVar_html(F("»"));
|
||||
addTableSeparator(F("Greek letter Mu"), 3, 3);
|
||||
addSysVar_html(F("{u}"));
|
||||
addSysVar_html(F("µ"));
|
||||
addTableSeparator(F("Currency"), 3, 3);
|
||||
addSysVar_html(F("{E}"));
|
||||
addSysVar_html(F("€"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{Y}"));
|
||||
addSysVar_html(F("¥"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{P}"));
|
||||
addSysVar_html(F("£"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{c}"));
|
||||
addSysVar_html(F("¢"));
|
||||
|
||||
addTableSeparator(F("Math symbols"), 3, 3);
|
||||
addSysVar_html(F("{^1}"));
|
||||
addSysVar_html(F("¹"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{^2}"));
|
||||
addSysVar_html(F("²"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{^3}"));
|
||||
addSysVar_html(F("³"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{1_4}"));
|
||||
addSysVar_html(F("¼"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{1_2}"));
|
||||
addSysVar_html(F("½"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{3_4}"));
|
||||
addSysVar_html(F("¾"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{+-}"));
|
||||
addSysVar_html(F("±"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{x}"));
|
||||
addSysVar_html(F("×"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("{..}"));
|
||||
addSysVar_html(F("÷"));
|
||||
|
||||
addTableSeparator(F("Standard Conversions"), 3, 2);
|
||||
|
||||
addSysVar_html(F("Wind Dir.: %c_w_dir%(123.4)"));
|
||||
addSysVar_html(F("{D}C to {D}F: %c_c2f%(20.4)"));
|
||||
addSysVar_html(F("m/s to Bft: %c_ms2Bft%(5.1)"));
|
||||
addSysVar_html(F("Dew point(T,H): %c_dew_th%(18.6,67)"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("cm to imperial: %c_cm2imp%(190)"));
|
||||
addSysVar_html(F("mm to imperial: %c_mm2imp%(1900)"));
|
||||
addFormSeparator(3);
|
||||
addSysVar_html(F("Mins to days: %c_m2day%(1900)"));
|
||||
addSysVar_html(F("Mins to dh: %c_m2dh%(1900)"));
|
||||
addSysVar_html(F("Mins to dhm: %c_m2dhm%(1900)"));
|
||||
addSysVar_html(F("Secs to dhms: %c_s2dhms%(100000)"));
|
||||
|
||||
TXBuffer += F("</table></form>");
|
||||
sendHeadandTail(F("TmplStd"),true);
|
||||
TXBuffer.endStream();
|
||||
}
|
||||
|
||||
//********************************************************************************
|
||||
// URNEncode char string to string object
|
||||
//********************************************************************************
|
||||
|
||||
@@ -143,6 +143,8 @@ static const char pgDefaultCSS[] PROGMEM = {
|
||||
"h2 {font-size: 12pt; margin: 0 -4px; padding: 6px; background-color: #444; color: #FFF; font-weight: bold; }"
|
||||
"h3 {font-size: 12pt; margin: 16px -4px 0 -4px; padding: 4px; background-color: #EEE; color: #444; font-weight: bold; }"
|
||||
"h6 {font-size: 10pt; color: #07D; }"
|
||||
// monospaced
|
||||
"pre, xmp, code, kbd, samp, tt{ font-family:monospace,monospace; font-size:1em; }"
|
||||
// buttons
|
||||
".button {margin: 4px; padding: 4px 16px; background-color: #07D; color: #FFF; text-decoration: none; border-radius: 4px; border: none;}"
|
||||
".button.link { }"
|
||||
|
||||
+166
-135
@@ -13,170 +13,201 @@
|
||||
|
||||
boolean NPlugin_001(byte function, struct EventStruct *event, String& string)
|
||||
{
|
||||
boolean success = false;
|
||||
boolean success = false;
|
||||
|
||||
switch (function)
|
||||
{
|
||||
case NPLUGIN_PROTOCOL_ADD:
|
||||
{
|
||||
Notification[++notificationCount].Number = NPLUGIN_ID_001;
|
||||
Notification[notificationCount].usesMessaging = true;
|
||||
Notification[notificationCount].usesGPIO=0;
|
||||
break;
|
||||
}
|
||||
switch (function) {
|
||||
case NPLUGIN_PROTOCOL_ADD:
|
||||
{
|
||||
Notification[++notificationCount].Number = NPLUGIN_ID_001;
|
||||
Notification[notificationCount].usesMessaging = true;
|
||||
Notification[notificationCount].usesGPIO = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case NPLUGIN_GET_DEVICENAME:
|
||||
{
|
||||
string = F(NPLUGIN_NAME_001);
|
||||
break;
|
||||
}
|
||||
case NPLUGIN_GET_DEVICENAME:
|
||||
{
|
||||
string = F(NPLUGIN_NAME_001);
|
||||
break;
|
||||
}
|
||||
|
||||
// Edwin: NPLUGIN_WRITE seems to be not implemented/not used yet? Disabled because its confusing now.
|
||||
// case NPLUGIN_WRITE:
|
||||
// {
|
||||
// String log = "";
|
||||
// String command = parseString(string, 1);
|
||||
//
|
||||
// if (command == F("email"))
|
||||
// {
|
||||
// NotificationSettingsStruct NotificationSettings;
|
||||
// LoadNotificationSettings(event->NotificationIndex, (byte*)&NotificationSettings, sizeof(NotificationSettings));
|
||||
// NPlugin_001_send(NotificationSettings.Domain, NotificationSettings.Receiver, NotificationSettings.Sender, NotificationSettings.Subject, NotificationSettings.Body, NotificationSettings.Server, NotificationSettings.Port);
|
||||
// success = true;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// Edwin: NPLUGIN_WRITE seems to be not implemented/not used yet? Disabled because its confusing now.
|
||||
// case NPLUGIN_WRITE:
|
||||
// {
|
||||
// String log = "";
|
||||
// String command = parseString(string, 1);
|
||||
//
|
||||
// if (command == F("email"))
|
||||
// {
|
||||
// NotificationSettingsStruct NotificationSettings;
|
||||
// LoadNotificationSettings(event->NotificationIndex, (byte*)&NotificationSettings, sizeof(NotificationSettings));
|
||||
// NPlugin_001_send(NotificationSettings.Domain, NotificationSettings.Receiver, NotificationSettings.Sender, NotificationSettings.Subject, NotificationSettings.Body, NotificationSettings.Server, NotificationSettings.Port);
|
||||
// success = true;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
|
||||
case NPLUGIN_NOTIFY:
|
||||
{
|
||||
NotificationSettingsStruct NotificationSettings;
|
||||
LoadNotificationSettings(event->NotificationIndex, (byte*)&NotificationSettings, sizeof(NotificationSettings));
|
||||
String subject = NotificationSettings.Subject;
|
||||
String body = "";
|
||||
if (event->String1.length() >0)
|
||||
body = event->String1;
|
||||
else
|
||||
body = NotificationSettings.Body;
|
||||
subject = parseTemplate(subject, subject.length());
|
||||
body = parseTemplate(body, body.length());
|
||||
NPlugin_001_send(NotificationSettings, subject, body);
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return success;
|
||||
case NPLUGIN_NOTIFY:
|
||||
{
|
||||
NotificationSettingsStruct NotificationSettings;
|
||||
LoadNotificationSettings(event->NotificationIndex, (byte*)&NotificationSettings, sizeof(NotificationSettings));
|
||||
String subject = NotificationSettings.Subject;
|
||||
String body = "";
|
||||
if (event->String1.length() > 0)
|
||||
body = event->String1;
|
||||
else
|
||||
body = NotificationSettings.Body;
|
||||
subject = parseTemplate(subject, subject.length());
|
||||
body = parseTemplate(body, body.length());
|
||||
NPlugin_001_send(NotificationSettings, subject, body);
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
boolean NPlugin_001_send(const NotificationSettingsStruct& notificationsettings, const String& aSub, String& aMesg) {
|
||||
boolean NPlugin_001_send(const NotificationSettingsStruct& notificationsettings, const String& aSub, String& aMesg)
|
||||
{
|
||||
// String& aDomain , String aTo, String aFrom, String aSub, String aMesg, String aHost, int aPort)
|
||||
boolean myStatus = false;
|
||||
boolean myStatus = false;
|
||||
|
||||
// Use WiFiClient class to create TCP connections
|
||||
WiFiClient client;
|
||||
String aHost = notificationsettings.Server;
|
||||
addLog(LOG_LEVEL_DEBUG, String(F("EMAIL: Connecting to "))+aHost + notificationsettings.Port);
|
||||
if (client.connect(aHost.c_str(), notificationsettings.Port) != 1) {
|
||||
addLog(LOG_LEVEL_ERROR, String(F("EMAIL: Error connecting to "))+aHost + notificationsettings.Port);
|
||||
myStatus = false;
|
||||
}
|
||||
else {
|
||||
String mailheader = F(
|
||||
"From: $nodename <$emailfrom>\r\n"
|
||||
"To: $ato\r\n"
|
||||
"Subject: $subject\r\n"
|
||||
"Reply-To: $nodename <$emailfrom>\r\n"
|
||||
"MIME-VERSION: 1.0\r\n"
|
||||
"Content-type: text/html; charset=UTF-8\r\n"
|
||||
"X-Mailer: EspEasy v$espeasyversion\r\n\r\n"
|
||||
);
|
||||
// Use WiFiClient class to create TCP connections
|
||||
WiFiClient client;
|
||||
String aHost = notificationsettings.Server;
|
||||
addLog(LOG_LEVEL_DEBUG, String(F("EMAIL: Connecting to ")) + aHost + notificationsettings.Port);
|
||||
if (client.connect(aHost.c_str(), notificationsettings.Port) != 1) {
|
||||
addLog(LOG_LEVEL_ERROR, String(F("EMAIL: Error connecting to ")) + aHost + notificationsettings.Port);
|
||||
myStatus = false;
|
||||
}else {
|
||||
String mailheader = F(
|
||||
"From: $nodename <$emailfrom>\r\n"
|
||||
"To: $ato\r\n"
|
||||
"Subject: $subject\r\n"
|
||||
"Reply-To: $nodename <$emailfrom>\r\n"
|
||||
"MIME-VERSION: 1.0\r\n"
|
||||
"Content-type: text/html; charset=UTF-8\r\n"
|
||||
"X-Mailer: EspEasy v$espeasyversion\r\n\r\n"
|
||||
);
|
||||
|
||||
mailheader.replace(String(F("$nodename")), Settings.Name);
|
||||
mailheader.replace(String(F("$emailfrom")), notificationsettings.Sender);
|
||||
mailheader.replace(String(F("$ato")), notificationsettings.Receiver);
|
||||
mailheader.replace(String(F("$subject")), aSub);
|
||||
mailheader.replace(String(F("$espeasyversion")), String(BUILD));
|
||||
aMesg.replace(F("\r"), F("<br/>")); // re-write line breaks for Content-type: text/html
|
||||
mailheader.replace(String(F("$nodename")), Settings.Name);
|
||||
mailheader.replace(String(F("$emailfrom")), notificationsettings.Sender);
|
||||
mailheader.replace(String(F("$ato")), notificationsettings.Receiver);
|
||||
mailheader.replace(String(F("$subject")), aSub);
|
||||
mailheader.replace(String(F("$espeasyversion")), String(BUILD));
|
||||
aMesg.replace(F("\r"), F("<br/>")); // re-write line breaks for Content-type: text/html
|
||||
|
||||
// Wait for Client to Start Sending
|
||||
// The MTA Exchange
|
||||
while (true) {
|
||||
// Wait for Client to Start Sending
|
||||
// The MTA Exchange
|
||||
while (true) {
|
||||
if (!NPlugin_001_MTA(client, "", F("220 "))) break;
|
||||
if (!NPlugin_001_MTA(client, String(F("EHLO ")) + notificationsettings.Domain, F("250 "))) break;
|
||||
if (!NPlugin_001_Auth(client, notificationsettings.User, notificationsettings.Pass)) break;
|
||||
if (!NPlugin_001_MTA(client, String(F("MAIL FROM:<")) + notificationsettings.Sender + ">", F("250 "))) break;
|
||||
|
||||
if (!NPlugin_001_MTA(client, "", F("220 "))) break;
|
||||
if (!NPlugin_001_MTA(client, String(F("EHLO ")) + notificationsettings.Domain, F("250 "))) break;
|
||||
if (!NPlugin_001_Auth(client, notificationsettings.User, notificationsettings.Pass)) break;
|
||||
if (!NPlugin_001_MTA(client, String(F("MAIL FROM:<")) + notificationsettings.Sender + ">", F("250 "))) break;
|
||||
if (!NPlugin_001_MTA(client, String(F("RCPT TO:<")) + notificationsettings.Receiver + ">", F("250 "))) break;
|
||||
if (!NPlugin_001_MTA(client, F("DATA"), F("354 "))) break;
|
||||
if (!NPlugin_001_MTA(client, mailheader + aMesg + String(F("\r\n.\r\n")), F("250 "))) break;
|
||||
bool nextAddressAvailable = true;
|
||||
int i = 0;
|
||||
String emailTo = "";
|
||||
if (!getNextMailAddress(notificationsettings.Receiver, emailTo, i)) {
|
||||
addLog(LOG_LEVEL_ERROR, F("Email: No recipient given"));
|
||||
break;
|
||||
}
|
||||
while (nextAddressAvailable) {
|
||||
String mailFound = F("Email: To ");
|
||||
mailFound += emailTo;
|
||||
addLog(LOG_LEVEL_INFO, mailFound);
|
||||
if (!NPlugin_001_MTA(client, String(F("RCPT TO:<")) + emailTo + ">", F("250 "))) break;
|
||||
++i;
|
||||
nextAddressAvailable = getNextMailAddress(notificationsettings.Receiver, emailTo, i);
|
||||
}
|
||||
|
||||
myStatus = true;
|
||||
break;
|
||||
if (!NPlugin_001_MTA(client, F("DATA"), F("354 "))) break;
|
||||
if (!NPlugin_001_MTA(client, mailheader + aMesg + String(F("\r\n.\r\n")), F("250 "))) break;
|
||||
|
||||
}
|
||||
myStatus = true;
|
||||
break;
|
||||
}
|
||||
|
||||
client.flush();
|
||||
client.stop();
|
||||
client.flush();
|
||||
client.stop();
|
||||
|
||||
if (myStatus == true) {
|
||||
addLog(LOG_LEVEL_INFO, F("EMAIL: Connection Closed Successfully"));
|
||||
}
|
||||
else {
|
||||
String log = F("EMAIL: Connection Closed With Error. Used header: ");
|
||||
log += mailheader;
|
||||
addLog(LOG_LEVEL_ERROR, log);
|
||||
}
|
||||
}
|
||||
return myStatus;
|
||||
if (myStatus == true) {
|
||||
addLog(LOG_LEVEL_INFO, F("EMAIL: Connection Closed Successfully"));
|
||||
}else {
|
||||
String log = F("EMAIL: Connection Closed With Error. Used header: ");
|
||||
log += mailheader;
|
||||
addLog(LOG_LEVEL_ERROR, log);
|
||||
}
|
||||
}
|
||||
return myStatus;
|
||||
}
|
||||
|
||||
boolean NPlugin_001_Auth(WiFiClient& client, String user, String pass) {
|
||||
if (user.length() == 0 || pass.length() == 0) {
|
||||
// No user/password given.
|
||||
return true;
|
||||
}
|
||||
if (!NPlugin_001_MTA(client, String(F("AUTH LOGIN")), F("334 "))) return false;
|
||||
base64 encoder;
|
||||
String auth;
|
||||
auth = encoder.encode(user);
|
||||
if (!NPlugin_001_MTA(client, auth, F("334 "))) return false;
|
||||
auth = encoder.encode(pass);
|
||||
if (!NPlugin_001_MTA(client, auth, F("235 "))) return false;
|
||||
boolean NPlugin_001_Auth(WiFiClient& client, String user, String pass)
|
||||
{
|
||||
if (user.length() == 0 || pass.length() == 0) {
|
||||
// No user/password given.
|
||||
return true;
|
||||
}
|
||||
if (!NPlugin_001_MTA(client, String(F("AUTH LOGIN")), F("334 "))) return false;
|
||||
base64 encoder;
|
||||
String auth;
|
||||
auth = encoder.encode(user);
|
||||
if (!NPlugin_001_MTA(client, auth, F("334 "))) return false;
|
||||
auth = encoder.encode(pass);
|
||||
if (!NPlugin_001_MTA(client, auth, F("235 "))) return false;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean NPlugin_001_MTA(WiFiClient& client, String aStr, const String &aWaitForPattern)
|
||||
{
|
||||
addLog(LOG_LEVEL_DEBUG, aStr);
|
||||
addLog(LOG_LEVEL_DEBUG, aStr);
|
||||
|
||||
if (aStr.length() ) client.println(aStr);
|
||||
if (aStr.length()) client.println(aStr);
|
||||
|
||||
yield();
|
||||
// Wait For Response
|
||||
unsigned long timer = millis() + NPLUGIN_001_TIMEOUT;
|
||||
backgroundtasks();
|
||||
while (true) {
|
||||
if (timeOutReached(timer)) {
|
||||
String log = F("Plugin_001_MTA: timeout. ");
|
||||
log += aStr;
|
||||
addLog(LOG_LEVEL_ERROR, log);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Wait For Response
|
||||
unsigned long timer = millis() + NPLUGIN_001_TIMEOUT;
|
||||
while (true) {
|
||||
if (timeOutReached(timer)) {
|
||||
String log = F("Plugin_001_MTA: timeout. ");
|
||||
log += aStr;
|
||||
addLog(LOG_LEVEL_ERROR, log);
|
||||
return false;
|
||||
}
|
||||
yield();
|
||||
|
||||
yield();
|
||||
// String line = client.readStringUntil('\n');
|
||||
String line;
|
||||
safeReadStringUntil(client, line, '\n');
|
||||
|
||||
// String line = client.readStringUntil('\n');
|
||||
String line;
|
||||
safeReadStringUntil(client, line, '\n');
|
||||
addLog(LOG_LEVEL_DEBUG, line);
|
||||
|
||||
addLog(LOG_LEVEL_DEBUG, line);
|
||||
if (line.indexOf(aWaitForPattern) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (line.indexOf(aWaitForPattern) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
bool getNextMailAddress(const String& data, String& address, int index)
|
||||
{
|
||||
int found = 0;
|
||||
int strIndex[] = { 0, -1 };
|
||||
const int maxIndex = data.length() - 1;
|
||||
|
||||
for (int i = 0; i <= maxIndex && found <= index; i++) {
|
||||
if (data.charAt(i) == ',' || i == maxIndex) {
|
||||
found++;
|
||||
strIndex[0] = strIndex[1] + 1;
|
||||
strIndex[1] = (i == maxIndex) ? i + 1 : i;
|
||||
}
|
||||
}
|
||||
if (found > index) {
|
||||
address = data.substring(strIndex[0], strIndex[1]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
+11
-11
@@ -46,7 +46,7 @@ decode_results results;
|
||||
// than normal buffer so we can handle Air Conditioner remote codes.
|
||||
#define CAPTURE_BUFFER_SIZE 1024
|
||||
|
||||
// TIMEOUT is the Nr. of milli-Seconds of no-more-data before we consider a
|
||||
// P016_TIMEOUT is the Nr. of milli-Seconds of no-more-data before we consider a
|
||||
// message ended.
|
||||
// This parameter is an interesting trade-off. The longer the timeout, the more
|
||||
// complex a message it can capture. e.g. Some device protocols will send
|
||||
@@ -58,21 +58,21 @@ decode_results results;
|
||||
// them is often also around 20+ms. This can result in the raw data be 2-3+
|
||||
// times larger than needed as it has captured 2-3+ messages in a single
|
||||
// capture. Setting a low timeout value can resolve this.
|
||||
// So, choosing the best TIMEOUT value for your use particular case is
|
||||
// So, choosing the best P016_TIMEOUT value for your use particular case is
|
||||
// quite nuanced. Good luck and happy hunting.
|
||||
// NOTE: Don't exceed MAX_TIMEOUT_MS. Typically 130ms.
|
||||
// NOTE: Don't exceed MAX_P016_TIMEOUT_MS. Typically 130ms.
|
||||
#if DECODE_AC
|
||||
#define TIMEOUT 50U // Some A/C units have gaps in their protocols of ~40ms.
|
||||
#define P016_TIMEOUT 50U // Some A/C units have gaps in their protocols of ~40ms.
|
||||
// e.g. Kelvinator
|
||||
// A value this large may swallow repeats of some protocols
|
||||
#else // DECODE_AC
|
||||
#define TIMEOUT 15U // Suits most messages, while not swallowing many repeats.
|
||||
#define P016_TIMEOUT 15U // Suits most messages, while not swallowing many repeats.
|
||||
#endif // DECODE_AC
|
||||
// Alternatives:
|
||||
// #define TIMEOUT 90U // Suits messages with big gaps like XMP-1 & some aircon
|
||||
// #define P016_TIMEOUT 90U // Suits messages with big gaps like XMP-1 & some aircon
|
||||
// units, but can accidentally swallow repeated messages
|
||||
// in the rawData[] output.
|
||||
// #define TIMEOUT MAX_TIMEOUT_MS // This will set it to our currently allowed
|
||||
// #define P016_TIMEOUT MAX_P016_TIMEOUT_MS // This will set it to our currently allowed
|
||||
// maximum. Values this high are problematic
|
||||
// because it is roughly the typical boundary
|
||||
// where most messages repeat.
|
||||
@@ -84,7 +84,7 @@ decode_results results;
|
||||
// Set the smallest sized "UNKNOWN" message packets we actually care about.
|
||||
// This value helps reduce the false-positive detection rate of IR background
|
||||
// noise as real messages. The chances of background IR noise getting detected
|
||||
// as a message increases with the length of the TIMEOUT value. (See above)
|
||||
// as a message increases with the length of the P016_TIMEOUT value. (See above)
|
||||
// The downside of setting this message too large is you can miss some valid
|
||||
// short messages for protocols that this library doesn't yet decode.
|
||||
//
|
||||
@@ -136,7 +136,7 @@ boolean Plugin_016(byte function, struct EventStruct *event, String& string)
|
||||
if (irReceiver == 0 && irPin != -1)
|
||||
{
|
||||
Serial.println(F("IR Init"));
|
||||
irReceiver = new IRrecv(irPin, CAPTURE_BUFFER_SIZE, TIMEOUT, true);
|
||||
irReceiver = new IRrecv(irPin, CAPTURE_BUFFER_SIZE, P016_TIMEOUT, true);
|
||||
irReceiver->setUnknownThreshold(MIN_UNKNOWN_SIZE); // Ignore messages with less than minimum on or off pulses.
|
||||
irReceiver->enableIRIn(); // Start the receiver
|
||||
}
|
||||
@@ -216,7 +216,7 @@ boolean Plugin_016(byte function, struct EventStruct *event, String& string)
|
||||
#endif // DECODE_HAIER_AC
|
||||
// If we got a human-readable description of the message, display it.
|
||||
if (log != "") addLog(LOG_LEVEL_INFO, log);
|
||||
|
||||
|
||||
// Output RAW timing info of the result.
|
||||
//log += resultToTimingInfo(&results); //not showing up nicely in the web log... Maybe send them to serial?
|
||||
// Output the results as source code
|
||||
@@ -230,4 +230,4 @@ boolean Plugin_016(byte function, struct EventStruct *event, String& string)
|
||||
return success;
|
||||
}
|
||||
|
||||
#endif // USES_P016
|
||||
#endif // USES_P016
|
||||
|
||||
@@ -136,6 +136,18 @@ To create/register a plugin, you have to :
|
||||
#define PLUGIN_SET_ONLY_SWITCH
|
||||
#endif
|
||||
|
||||
// Shelly ----------------------------
|
||||
#ifdef PLUGIN_SET_SHELLY_1
|
||||
#define PLUGIN_SET_ONLY_SWITCH
|
||||
#define CONTROLLER_SET_STABLE
|
||||
#define NOTIFIER_SET_STABLE
|
||||
|
||||
#undef DEFAULT_PIN_I2C_SDA
|
||||
#undef DEFAULT_PIN_I2C_SCL
|
||||
#define DEFAULT_PIN_I2C_SDA 6 // GPIO4 conflicts with relay control.
|
||||
#define DEFAULT_PIN_I2C_SCL 7 // GPIO5 conflicts with SW input
|
||||
#endif
|
||||
|
||||
// Easy ----------------------------
|
||||
#ifdef PLUGIN_SET_EASY_TEMP
|
||||
#define PLUGIN_SET_ONLY_TEMP_HUM
|
||||
|
||||
Reference in New Issue
Block a user