Standardize log tag

This commit is contained in:
Edward Firmo
2025-08-05 08:54:45 +02:00
parent 6d16d7d645
commit 1d8b4fee1a
6 changed files with 115 additions and 93 deletions

View File

@@ -291,12 +291,14 @@ script:
- id: !extend dump_config
then:
- lambda: |-
static const char *TAG = "script.dump_config.core.hw.touch";
// Touch panel's state
if (sw_touch_panel_power->state)
ESP_LOGCONFIG("core_hw_touch", "Touch panel - Power: On");
ESP_LOGCONFIG(TAG, "Touch panel - Power: On");
else
ESP_LOGW("core_hw_touch", "Touch panel - Power: OFF");
ESP_LOGCONFIG("core_hw_touch", "Touch event duration: %.0fms", nr_touch_duration->state);
ESP_LOGW(TAG, "Touch panel - Power: OFF");
ESP_LOGCONFIG(TAG, "Touch event duration: %.0fms", nr_touch_duration->state);
- id: !extend dump_config_list_packages
then:
@@ -378,11 +380,13 @@ tx_ultimate_easy:
on_long_touch_release:
- lambda: |-
static const char *TAG = "tx_ultimate_easy.on_long_touch_release.core.hw.touch";
const uint8_t touch_position = static_cast<uint8_t>(touch.x);
if (touch_position > ${TOUCH_POSITION_MAX_VALUE}) { // Check for valid range
ESP_LOGE("core_hw_touch", "Invalid long-touch position: %" PRIu8, touch_position);
ESP_LOGE(TAG, "Invalid long-touch position: %" PRIu8, touch_position);
} else {
ESP_LOGI("core_hw_touch", "Long-touch released at position %" PRIu8, touch_position);
ESP_LOGI(TAG, "Long-touch released at position %" PRIu8, touch_position);
}
on_multi_touch_release:
@@ -397,23 +401,29 @@ tx_ultimate_easy:
action: release
position: !lambda return std::to_string(touch.x);
- lambda: |-
ESP_LOGI("core_hw_touch", "Multi-touch released");
static const char *TAG = "tx_ultimate_easy.on_multi_touch_release.core.hw.touch";
ESP_LOGI(TAG, "Multi-touch released");
touch_on_multi_touch_release->execute();
on_press:
then:
- lambda: |-
static const char *TAG = "tx_ultimate_easy.on_press.core.hw.touch";
const uint8_t position = static_cast<uint8_t>(touch.x);
if (position > ${TOUCH_POSITION_MAX_VALUE}) { // Check for valid range
ESP_LOGE("core_hw_touch", "Invalid touch position: %" PRIu8, position);
ESP_LOGE(TAG, "Invalid touch position: %" PRIu8, position);
} else {
ESP_LOGI("core_hw_touch", "Pressed at position %" PRIu8, position);
ESP_LOGI(TAG, "Pressed at position %" PRIu8, position);
touch_on_press->execute(static_cast<uint8_t>(touch.button), position);
}
on_release:
then:
- lambda: ESP_LOGI("core_hw_touch", "Released");
- lambda: |-
static const char *TAG = "tx_ultimate_easy.on_release.core.hw.touch";
ESP_LOGI(TAG, "Released");
- script.execute: touch_on_release
on_swipe_left:
@@ -437,8 +447,8 @@ tx_ultimate_easy:
return "down";
position: !lambda return std::to_string(touch.x);
- lambda: |-
ESP_LOGI("core_hw_touch", "Swipe %s",
(sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down");
static const char *TAG = "tx_ultimate_easy.on_swipe_left.core.hw.touch";
ESP_LOGI(TAG, "Swipe %s", (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down");
touch_swipe_left->execute();
on_swipe_right:
@@ -462,15 +472,16 @@ tx_ultimate_easy:
return "up";
position: !lambda return std::to_string(touch.x);
- lambda: |-
ESP_LOGI("core_hw_touch", "Swipe %s",
(sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up");
static const char *TAG = "tx_ultimate_easy.on_swipe_right.core.hw.touch";
ESP_LOGI(TAG, "Swipe %s", (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up");
touch_swipe_right->execute();
on_touch_event:
- lambda: |-
ESP_LOGD("core_hw_touch", "Touch event:");
ESP_LOGD("core_hw_touch", " State: %i (%s)", touch.state, touch.state_str.c_str());
ESP_LOGD("core_hw_touch", " Position: %i", touch.x);
static const char *TAG = "tx_ultimate_easy.on_touch_event.core.hw.touch";
ESP_LOGD(TAG, "Touch event:");
ESP_LOGD(TAG, " State: %i (%s)", touch.state, touch.state_str.c_str());
ESP_LOGD(TAG, " Position: %i", touch.x);
uart:
- id: uart_touch