added logs for outgoing commands

This commit is contained in:
Robin Thoni 2024-06-24 08:26:58 +00:00 committed by GitHub
parent 1e05bcaa61
commit b3ca1023e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,6 +84,7 @@ uint8_t DfrobotSen0395Component::find_prompt_() {
uint8_t DfrobotSen0395Component::send_cmd_(const char *cmd, uint32_t duration) {
// The interval between two commands must be larger than the specified duration (in ms).
if (millis() - ts_last_cmd_sent_ > duration) {
ESP_LOGV(TAG, "Command: %s", cmd);
this->write_str(cmd);
ts_last_cmd_sent_ = millis();
return 1; // Command sent