From 8d527229412c35c296a01a7d97800f4b460496aa Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 24 Aug 2022 17:24:31 +0200 Subject: [PATCH] Prep v12.1.1 --- CHANGELOG.md | 10 ++++++++ RELEASENOTES.md | 6 ++++- tasmota/include/tasmota_version.h | 2 +- tasmota/tasmota_support/support_button.ino | 19 +-------------- tasmota/tasmota_support/support_wifi.ino | 23 ++++++++++++++----- .../xdrv_01_9_webserver.ino | 2 +- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fb4c39b0..968faedbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. ## [Released] +## [12.1.1] 20220825 +- Release Patricia + +## [12.1.0.1] 20220825 +### Fixed +- RTC not detected when lights are present (#16242) +- DNS lookup for .local domains (#16273) +- Button response delay regression from v12.0.2.4 (#16319) +- Lost module name in GUI regression from v12.0.2.4 - 20220803 (#16324) + ## [12.1.0] 20220818 - Release Patricia diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 461e9d5d8..1ab3e42ac 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -107,7 +107,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v12.1.0 Patricia +## Changelog v12.1.1 Patricia ### Added - Command ``SetOption45 1..250`` to change default bistable latching relay pulse length of 40 milliseconds - Command ``SetOption144 1`` includes a timestamp in zigbee `ZbReceived` messages @@ -137,6 +137,10 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo ### Fixed - Restore EnergyToday after using command ``restart 2`` and power cycle [#16118](https://github.com/arendst/Tasmota/issues/16118) - ESP32 SendMail not working over ethernet [#15794](https://github.com/arendst/Tasmota/issues/15794) +- RTC not detected when lights are present [#16242](https://github.com/arendst/Tasmota/issues/16242) +- DNS lookup for .local domains [#16273](https://github.com/arendst/Tasmota/issues/16273) +- Button response delay regression from v12.0.2.4 [#16319](https://github.com/arendst/Tasmota/issues/16319) +- Lost module name in GUI regression from v12.0.2.4 - 20220803 [#16324](https://github.com/arendst/Tasmota/issues/16324) ### Removed - Arduino IDE support diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index 001ed2176..80ae75f16 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -20,6 +20,6 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x0C010000; // 12.1.0.0 +const uint32_t VERSION = 0x0C010100; // 12.1.1.0 #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/tasmota_support/support_button.ino b/tasmota/tasmota_support/support_button.ino index 0a1beafe8..783ad475d 100644 --- a/tasmota/tasmota_support/support_button.ino +++ b/tasmota/tasmota_support/support_button.ino @@ -43,9 +43,7 @@ struct BUTTON { uint16_t hold_timer[MAX_KEYS] = { 0 }; // Timer for button hold uint16_t dual_code = 0; // Sonoff dual received code - uint8_t debounce_phase = 0; // 0 = regular iteration; 1 = read data for debouncing only uint8_t last_state[MAX_KEYS]; // Last button states - uint8_t last_state_between[MAX_KEYS]; // Last button states at the half time read uint8_t window_timer[MAX_KEYS] = { 0 }; // Max time between button presses to record press count uint8_t press_counter[MAX_KEYS] = { 0 }; // Number of button presses within Button.window_timer @@ -93,7 +91,6 @@ void ButtonInit(void) { #endif // ESP8266 for (uint32_t i = 0; i < MAX_KEYS; i++) { Button.last_state[i] = NOT_PRESSED; - Button.last_state_between[i] = NOT_PRESSED; if (PinUsed(GPIO_KEY1, i)) { Button.present++; #ifdef ESP8266 @@ -207,18 +204,6 @@ void ButtonHandler(void) { button = AdcGetButton(Pin(GPIO_ADC_BUTTON_INV, button_index)); } #endif // USE_ADC - if (Button.debounce_phase == 1) { - // adjust values - Button.last_state_between[button_index] = button; - - continue; - } - - if (button != Button.last_state_between[button_index]) { - // no clean signal, just keep the previous one - button = Button.last_state[button_index]; - } - if (button_present) { XdrvMailbox.index = button_index; XdrvMailbox.payload = button; @@ -389,8 +374,6 @@ void ButtonHandler(void) { } Button.last_state[button_index] = button; } - - Button.debounce_phase = (Button.debounce_phase + 1) & 1; } /* @@ -426,7 +409,7 @@ void MqttButtonTopic(uint32_t button_id, uint32_t action, uint32_t hold) { void ButtonLoop(void) { if (Button.present) { if (TimeReached(Button.debounce)) { - SetNextTimeInterval(Button.debounce, Settings->button_debounce / 2); + SetNextTimeInterval(Button.debounce, Settings->button_debounce); // ButtonDebounce (50) ButtonHandler(); } } diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index 495fe71b8..d1c056b75 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -807,14 +807,25 @@ void wifiKeepAlive(void) { #endif // ESP8266 bool WifiHostByName(const char* aHostname, IPAddress& aResult) { + // DnsClient can't do one-shot mDNS queries so use WiFi.hostByName() for *.local + size_t hostname_len = strlen(aHostname); + if (strstr_P(aHostname, PSTR(".local")) == &aHostname[hostname_len] - 6) { + if (WiFi.hostByName(aHostname, aResult)) { + // Host name resolved + if (0xFFFFFFFF != (uint32_t)aResult) { + return true; + } + } + } else { // Use this instead of WiFi.hostByName or connect(host_name,.. to block less if DNS server is not found - uint32_t dns_address = (!TasmotaGlobal.global_state.eth_down) ? Settings->eth_ipv4_address[3] : Settings->ipv4_address[3]; - DnsClient.begin((IPAddress)dns_address); - if (DnsClient.getHostByName(aHostname, aResult) != 1) { - AddLog(LOG_LEVEL_DEBUG, PSTR("DNS: Unable to resolve '%s'"), aHostname); - return false; + uint32_t dns_address = (!TasmotaGlobal.global_state.eth_down) ? Settings->eth_ipv4_address[3] : Settings->ipv4_address[3]; + DnsClient.begin((IPAddress)dns_address); + if (1 == DnsClient.getHostByName(aHostname, aResult)) { + return true; + } } - return true; + AddLog(LOG_LEVEL_DEBUG, PSTR("DNS: Unable to resolve '%s'"), aHostname); + return false; } bool WifiDnsPresent(const char* aHostname) { diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino index b169af2a4..c3eff8f5d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino @@ -602,7 +602,7 @@ void StartWebserver(int type, IPAddress ipweb) #endif // Not FIRMWARE_MINIMAL if (!Web.initial_config) { - Web.initial_config = !strlen(SettingsText(SET_STASSID1)) || !strlen(SettingsText(SET_STASSID2)); + Web.initial_config = (!strlen(SettingsText(SET_STASSID1)) && !strlen(SettingsText(SET_STASSID2))); if (Web.initial_config) { AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP "Blank Device - Initial Configuration")); } } }