mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 19:56:30 +00:00
Merge pull request #6872 from s-hadinger/color_preserve_CW
Add Keep last channels values when Color command end with '='
This commit is contained in:
commit
6f2123e8ba
@ -4,6 +4,7 @@
|
||||
* Change supported PCF8574 I2C address range to 0x20 - 0x26 allowing other I2C devices with address 0x27 to be used at the same time
|
||||
* Change supported PCF8574A I2C address range to 0x39 - 0x3F allowing other I2C devices with address 0x38 to be used at the same time
|
||||
* Change supported MCP230xx I2C address range to 0x20 - 0x26 allowing other I2C devices with address 0x27 to be used at the same time
|
||||
* Add Keep last channels values when Color command end with '=' #6799
|
||||
*
|
||||
* 7.0.0.3 20191103
|
||||
* Initial support for I2C driver runtime control using command I2CDriver and document I2CDEVICES.md
|
||||
|
@ -1910,6 +1910,11 @@ bool LightColorEntry(char *buffer, uint32_t buffer_length)
|
||||
}
|
||||
|
||||
memset(&Light.entry_color, 0x00, sizeof(Light.entry_color));
|
||||
// erase all channels except if the last character is '=', #6799
|
||||
while ((buffer_length > 0) && ('=' == buffer[buffer_length - 1])) {
|
||||
buffer_length--; // remove all trailing '='
|
||||
memcpy(&Light.entry_color, &Light.current_color, sizeof(Light.entry_color));
|
||||
}
|
||||
if (strstr(buffer, ",") != nullptr) { // Decimal entry
|
||||
int8_t i = 0;
|
||||
for (str = strtok_r(buffer, ",", &p); str && i < 6; str = strtok_r(nullptr, ",", &p)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user