schedule conditions chack numbers and strings, fix custom commands

This commit is contained in:
MichaelDvP
2024-06-18 18:23:08 +02:00
parent f76c5f6afe
commit bae5a11264
8 changed files with 297 additions and 168 deletions

View File

@@ -437,6 +437,19 @@ Command::CmdFunction * Command::find_command(const uint8_t device_type, const ui
return nullptr; // command not found
}
void Command::erase_device_commands(const uint8_t device_type) {
if (cmdfunctions_.empty()) {
return;
}
auto it = cmdfunctions_.end();
do {
int i = it - cmdfunctions_.begin();
if (cmdfunctions_[i].device_type_==device_type) {
cmdfunctions_.erase(it);
}
} while (it-- > cmdfunctions_.begin());
}
void Command::erase_command(const uint8_t device_type, const char * cmd, uint8_t flag) {
if ((cmd == nullptr) || (strlen(cmd) == 0) || (cmdfunctions_.empty())) {
return;