Skip to content

Commit

Permalink
Add support character # to be replaced by space-character
Browse files Browse the repository at this point in the history
Add support character `#` to be replaced by `space`-character in command ``Publish`` topic (#10258)
  • Loading branch information
arendst committed Dec 26, 2020
1 parent e6d8afb commit d75beb9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 130 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
- Support for GPIO option selection
- Gpio ``Option_a1`` enabling PWM2 high impedance if powered off as used by Wyze bulbs (#10196)
- Support for FTC532 8-button touch controller by Peter Franck (#10222)
- Support character `#` to be replaced by `space`-character in command ``Publish`` topic (#10258)

### Changed
- Logging from fixed global memory buffer to stack buffer freeing 700 bytes RAM
Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Support for GPIO option selection
- Gpio ``Option_a1`` enabling PWM2 high impedance if powered off as used by Wyze bulbs [#10196](https://github.com/arendst/Tasmota/issues/10196)
- Support for FTC532 8-button touch controller by Peter Franck [#10222](https://github.com/arendst/Tasmota/issues/10222)
- Support character `#` to be replaced by `space`-character in command ``Publish`` topic [#10258](https://github.com/arendst/Tasmota/issues/10258)

### Changed
- Logging from fixed global memory buffer to stack buffer freeing 700 bytes RAM
Expand Down
11 changes: 7 additions & 4 deletions tasmota/support.ino
Original file line number Diff line number Diff line change
Expand Up @@ -388,22 +388,25 @@ char* RemoveControlCharacter(char* p) {
return p;
}

char* ReplaceCommaWithDot(char* p) {
// Replace character ',' with '.'
char* ReplaceChar(char* p, char find, char replace) {
char* write = (char*)p;
char* read = (char*)p;
char ch = '.';

while (ch != '\0') {
ch = *read++;
if (ch == ',') {
ch = '.';
if (ch == find) {
ch = replace;
}
*write++ = ch;
}
return p;
}

char* ReplaceCommaWithDot(char* p) {
return ReplaceChar(p, ',', '.');
}

char* LowerCase(char* dest, const char* source)
{
char* write = dest;
Expand Down
Loading

0 comments on commit d75beb9

Please sign in to comment.