Fix command processing

Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322)
This commit is contained in:
Theo Arends 2019-12-26 12:26:06 +01:00
parent 14ee8583c6
commit e8626e9cca
3 changed files with 11 additions and 12 deletions

View File

@ -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)

View File

@ -2,6 +2,8 @@
### 8.1.0.1 20191225
- Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322)
## Released
### 8.1.0 20191225

View File

@ -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;