From e8626e9cca73188ba4b07d9f910b2c71fb9fab98 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 26 Dec 2019 12:26:06 +0100 Subject: [PATCH] Fix command processing Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322) --- RELEASENOTES.md | 14 ++------------ tasmota/CHANGELOG.md | 2 ++ tasmota/support.ino | 7 +++++++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 578d145b9..e2a87362a 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -52,16 +52,6 @@ The following binary downloads have been compiled with ESP8266/Arduino library c ## Changelog -### Version 8.1.0 Doris +### Version 8.1.0.1 -- Change Settings text handling allowing variable length text within a total text pool of 699 characters -- Change Smoother ``Fade`` using 100Hz instead of 20Hz animation (#7179) -- Change number of rule ``Var``s and ``Mem``s from 5 to 16 (#4933) -- Change number of ``FriendlyName``s from 4 to 8 -- Add commands ``WebButton1`` until ``WebButton16`` to support user defined GUI button text (#7166) -- Add support for max 150 characters in most command parameter strings (#3686, #4754) -- Add support for GPS as NTP server by Christian Baars and Adrian Scillato -- Add support for ``AdcParam`` parameters to control ADC0 Moisture formula by Federico Leoni (#7309) -- Add Zigbee coalesce sensor attributes into a single message -- Add Zigbee better support for Xiaomi Double Switch and Xiaomi Vibration sensor -- Add Deepsleep start delay based on Teleperiod if ``Teleperiod`` differs from 10 or 300 +- Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 80c6b480b..c208e88b8 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -2,6 +2,8 @@ ### 8.1.0.1 20191225 +- Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322) + ## Released ### 8.1.0 20191225 diff --git a/tasmota/support.ino b/tasmota/support.ino index 4b2bc49fb..9b66fbc2a 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -731,6 +731,13 @@ bool DecodeCommand(const char* haystack, void (* const MyCommand[])(void)) { GetTextIndexed(XdrvMailbox.command, CMDSZ, 0, haystack); // Get prefix if available int prefix_length = strlen(XdrvMailbox.command); + if (prefix_length) { + char prefix[prefix_length +1]; + snprintf_P(prefix, sizeof(prefix), XdrvMailbox.topic); // Copy prefix part only + if (strcasecmp(prefix, XdrvMailbox.command)) { + return false; // Prefix not in command + } + } int command_code = GetCommandCode(XdrvMailbox.command + prefix_length, CMDSZ, XdrvMailbox.topic + prefix_length, haystack); if (command_code > 0) { // Skip prefix XdrvMailbox.command_code = command_code -1;