diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index 7e4a8266c..5ca6ee4e9 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Stuur" #define D_TRUE "Waar" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "opgradeer" #define D_UPLOAD "Laai op" #define D_UPTIME "Uptyd" diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index b88b41a1d..d7848b3a8 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Предаване" #define D_TRUE "Вярно" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "Обновяване" #define D_UPLOAD "Качването е" #define D_UPTIME "Време на работа" diff --git a/tasmota/language/ca_AD.h b/tasmota/language/ca_AD.h index 9236ad1d4..7da0c2146 100644 --- a/tasmota/language/ca_AD.h +++ b/tasmota/language/ca_AD.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Transmet" #define D_TRUE "Cert" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "actualitza" #define D_UPLOAD "Envia" #define D_UPTIME "Temps engegat" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index 29be007fe..11ad00c90 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Odešli" #define D_TRUE "Pravda" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "aktualizace" #define D_UPLOAD "Nahrání..." #define D_UPTIME "Uptime" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 0dd1b5e4f..46e3561bd 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Übertragen" #define D_TRUE "wahr" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "astronomisch" +#define D_TWILIGHT_CIVIL "zivil" +#define D_TWILIGHT_NAUTICAL "nautisch" #define D_UPGRADE "update" #define D_UPLOAD "Upload" #define D_UPTIME "Laufzeit" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index d28d321c7..dbff83df3 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Μετάδοση" #define D_TRUE "Αληθές" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "αναβάθμιση" #define D_UPLOAD "Ανέβασμα" #define D_UPTIME "Χρόνος λειτουργίας" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index f98f11e5f..92aa33b39 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Transmit" #define D_TRUE "True" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "upgrade" #define D_UPLOAD "Upload" #define D_UPTIME "Uptime" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 0faf11db5..8c0d1fa3b 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Transmitir" #define D_TRUE "Verdadero" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "Actualización" #define D_UPLOAD "Carga" #define D_UPTIME "Tiempo Encendido" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index a2d25a85f..da9fc7ea0 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Transmettre" #define D_TRUE "Vrai" #define D_TVOC "TVOC" // not used ??? +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "la mise à jour" // "Lancer la mise à jour" #define D_UPLOAD "Upload" // Not better in french #define D_UPTIME "Durée d'activité" diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index 8881749bd..19305a24c 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Stjoere" #define D_TRUE "Wier" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "upgrade" #define D_UPLOAD "Stjoere" #define D_UPTIME "Betjenstiid" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index 545c44ba3..84dbb6562 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "עבר" #define D_TRUE "נכון" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "שדרוג" #define D_UPLOAD "העלאה" #define D_UPTIME "זמן עליה" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 4154a31f1..d067c5665 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Továbbít" #define D_TRUE "Igaz" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "Frissítés" #define D_UPLOAD "Feltöltés" #define D_UPTIME "Üzemidő" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index a250ffbc7..c661b5552 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Trasmessi" #define D_TRUE "Vero" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "astronomical" +#define D_TWILIGHT_CIVIL "civil" +#define D_TWILIGHT_NAUTICAL "nautical" #define D_UPGRADE "aggiornamento" #define D_UPLOAD "Caricamento" #define D_UPTIME "Tempo accensione" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index f04d95756..6d72f296c 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "전송" #define D_TRUE "참" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "업그레이드" #define D_UPLOAD "업로드" #define D_UPTIME "가동시간" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index 87a38d82e..5a7893293 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Verzend" #define D_TRUE "Waar" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "opwaarderen" #define D_UPLOAD "Verzenden" #define D_UPTIME "Bedrijfstijd" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index 1da04b14b..291fbcd46 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Wyślij" #define D_TRUE "Prawda" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "aktualizacji" #define D_UPLOAD "Wgraj" #define D_UPTIME "Czas pracy" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index 6b0136112..a315ce557 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Transmitir" #define D_TRUE "Verdadeiro" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "atualização" #define D_UPLOAD "Enviar" #define D_UPTIME "Tempo de atividade" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index eeb3dd2d9..14b1d80d6 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Transmitir" #define D_TRUE "Verdadeiro" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "Atualizar" #define D_UPLOAD "Enviar" #define D_UPTIME "Tempo de Atividade" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index 995490a7d..7444d914d 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Transmitere" #define D_TRUE "Adevărat" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "actualizare" #define D_UPLOAD "Încărcăre" #define D_UPTIME "Folosință" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 0b2d556a9..34cbec772 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -189,6 +189,9 @@ #define D_TRANSMIT "Передать" #define D_TRUE "Истина" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "обновление" #define D_UPLOAD "Загрузить" #define D_UPTIME "Аптайм" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 15a3ae00c..2037c0c16 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Odošli" #define D_TRUE "Pravda" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "aktualizáciu" #define D_UPLOAD "Nahrávanie..." #define D_UPTIME "Uptime" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index 1bbb4ddd9..b9c856950 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Sänd" #define D_TRUE "Sant" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "uppgradera" #define D_UPLOAD "Ladda upp" #define D_UPTIME "Upptid" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index 32b6864ab..41ddd0f18 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "İletim" #define D_TRUE "True" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "yükseltme" #define D_UPLOAD "Yükleme" #define D_UPTIME "Açık Kalma Süresi" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 6271fe952..7db07e448 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Передати" #define D_TRUE "Так" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "оновлення" #define D_UPLOAD "Завантажити" #define D_UPTIME "Час роботи" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index 63e522ba1..c2a617929 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "Truyền" #define D_TRUE "Đúng" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "nâng cấp" #define D_UPLOAD "Tải lên" #define D_UPTIME "Thời gian chạy" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index d47f56813..84a52281f 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "发送" #define D_TRUE "True" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "升级" #define D_UPLOAD "上传" #define D_UPTIME "运行时间" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index d6e7b5f7a..2a767d3a6 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -188,6 +188,9 @@ #define D_TRANSMIT "發送" #define D_TRUE "真" #define D_TVOC "TVOC" +#define D_TWILIGHT_ASTRONOMICAL "Astronomical" +#define D_TWILIGHT_CIVIL "Civil" +#define D_TWILIGHT_NAUTICAL "Nautical" #define D_UPGRADE "升級" #define D_UPLOAD "上傳" #define D_UPTIME "啟動時間" diff --git a/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino b/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino index 8575cf685..c2d41d98f 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_09_timers.ino @@ -64,6 +64,8 @@ int8_t timer_window[MAX_TIMERS] = { 0 }; * Rewrite for Arduino by 'jurs' for German Arduino forum \*********************************************************************************************/ +const char kTwilight[] PROGMEM = "| " D_TWILIGHT_CIVIL "| " D_TWILIGHT_NAUTICAL "| " D_TWILIGHT_ASTRONOMICAL; + const float pi2 = TWO_PI; const float pi = PI; const float RAD = DEG_TO_RAD; @@ -74,9 +76,9 @@ uint32_t JulianDate(const struct TIME_T &now) { // https://en.wikipedia.org/wiki/Julian_day uint32_t Year = now.year; // Year ex:2020 - uint32_t Month = now.month; // 1..12 - uint32_t Day = now.day_of_month; // 1..31 - uint32_t Julian; // Julian day number + uint32_t Month = now.month; // 1..12 + uint32_t Day = now.day_of_month; // 1..31 + uint32_t Julian; // Julian day number if (Month <= 2) { Month += 12; @@ -845,8 +847,8 @@ const char HTTP_FORM_TIMER2[] PROGMEM = const char HTTP_FORM_TIMER3[] PROGMEM = "
" "
" - "
" - "
" + "
" + "
" "
" "

" "" @@ -904,7 +906,10 @@ void HandleTimerConfiguration(void) } WSContentSend_P(HTTP_FORM_TIMER2); #ifdef USE_SUNRISE - WSContentSend_P(HTTP_FORM_TIMER3, 100 + (strlen(D_SUNSET) *12), GetSun(0).c_str(), GetSun(1).c_str()); + char twilight[30]; + GetTextIndexed(twilight, sizeof(twilight), Settings->mbflag2.sunrise_dawn_angle, kTwilight); + uint32_t slen = 100 + (max(strlen(D_SUNRISE), strlen(D_SUNSET)) *11) + (strlen(twilight) *9); // Trial and error to keep it on one line while keeping it as centered as possible + WSContentSend_P(HTTP_FORM_TIMER3, slen, twilight, GetSun(0).c_str(), twilight, GetSun(1).c_str()); #else WSContentSend_P(HTTP_FORM_TIMER3); #endif // USE_SUNRISE