Simplifies tags
It should be limited to 15ish chars
This commit is contained in:
@@ -29,6 +29,8 @@ substitutions:
|
||||
|
||||
DUMP_CONFIG_CALLER_DELAY: 10s # Delay to dump config after requested
|
||||
|
||||
TAG_CORE_COMMON: core.common
|
||||
|
||||
api:
|
||||
id: api_server
|
||||
on_client_connected:
|
||||
@@ -47,12 +49,10 @@ binary_sensor:
|
||||
on_state:
|
||||
then:
|
||||
- lambda: |-
|
||||
static const char *TAG = "binary_sensor.bs_pending_restart.core.common";
|
||||
|
||||
if (x)
|
||||
ESP_LOGW(TAG, "Pending restart: YES");
|
||||
ESP_LOGW("${TAG_CORE_COMMON}", "Pending restart: YES");
|
||||
else
|
||||
ESP_LOGD(TAG, "Pending restart: No");
|
||||
ESP_LOGD("${TAG_CORE_COMMON}", "Pending restart: No");
|
||||
- script.execute: dump_config_caller
|
||||
|
||||
button:
|
||||
@@ -152,12 +152,10 @@ script:
|
||||
- lambda: return sl_tx_model_format->active_index().has_value();
|
||||
- lambda: return sl_tx_model_gang->active_index().has_value();
|
||||
- lambda: |-
|
||||
static const char *TAG = "script.boot_initialize.core.common";
|
||||
|
||||
id(is_us_model) = (sl_tx_model_format->state == "${TX_MODEL_FORMAT_US_TEXT}");
|
||||
id(gang_count) = sl_tx_model_gang->active_index().value() + 1;
|
||||
if (id(gang_count) < 1 || id(gang_count) > 4) {
|
||||
ESP_LOGE(TAG, "Invalid number of gangs: %" PRIu8, id(gang_count));
|
||||
ESP_LOGE("${TAG_CORE_COMMON}", "Invalid number of gangs: %" PRIu8, id(gang_count));
|
||||
}
|
||||
|
||||
- id: boot_sequence
|
||||
@@ -173,40 +171,38 @@ script:
|
||||
then:
|
||||
# Extended by all modules
|
||||
- lambda: |-
|
||||
static const char *TAG = "script.dump_config.core.common";
|
||||
|
||||
// Device identification
|
||||
ESP_LOGCONFIG(TAG, "Device friendly name: ${friendly_name}");
|
||||
ESP_LOGCONFIG(TAG, "Device name: ${name}");
|
||||
ESP_LOGCONFIG(TAG, "Device name (HA): %s", tx_device_name->state.c_str());
|
||||
ESP_LOGCONFIG(TAG, "Device hostname: %s", App.get_name().c_str());
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Device friendly name: ${friendly_name}");
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Device name: ${name}");
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Device name (HA): %s", tx_device_name->state.c_str());
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Device hostname: %s", App.get_name().c_str());
|
||||
|
||||
dump_config_versions->execute();
|
||||
|
||||
// Framework detection
|
||||
#ifdef USE_ARDUINO
|
||||
ESP_LOGCONFIG(TAG, "Framework: Arduino");
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Framework: Arduino");
|
||||
#elif defined(USE_ESP_IDF)
|
||||
ESP_LOGCONFIG(TAG, "Framework: ESP-IDF");
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Framework: ESP-IDF");
|
||||
#else
|
||||
ESP_LOGW(TAG, "Framework: UNKNOWN");
|
||||
ESP_LOGW("${TAG_CORE_COMMON}", "Framework: UNKNOWN");
|
||||
#endif
|
||||
|
||||
// Model configuration
|
||||
ESP_LOGCONFIG(TAG, "Model format (selected): %s",
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Model format (selected): %s",
|
||||
sl_tx_model_format->state.c_str());
|
||||
ESP_LOGCONFIG(TAG, "Model format (detected): %s",
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Model format (detected): %s",
|
||||
id(is_us_model) ? "US" : "EU");
|
||||
ESP_LOGCONFIG(TAG, "Gangs (selected): %s",
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Gangs (selected): %s",
|
||||
sl_tx_model_gang->state.c_str());
|
||||
ESP_LOGCONFIG(TAG, "Gangs (detected): %" PRIu8 "-Gang%s",
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Gangs (detected): %" PRIu8 "-Gang%s",
|
||||
id(gang_count), id(gang_count) > 1 ? "s" : "");
|
||||
|
||||
// System state
|
||||
if (bs_pending_restart->state)
|
||||
ESP_LOGW(TAG, "Pending restart: YES");
|
||||
ESP_LOGW("${TAG_CORE_COMMON}", "Pending restart: YES");
|
||||
else
|
||||
ESP_LOGCONFIG(TAG, "Pending restart: No");
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "Pending restart: No");
|
||||
|
||||
- id: dump_config_caller
|
||||
mode: restart
|
||||
@@ -231,10 +227,10 @@ script:
|
||||
then:
|
||||
- lambda: |-
|
||||
// Version information
|
||||
ESP_LOGCONFIG("core", "TX Ultimate firmware version: ${version}");
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "TX Ultimate firmware version: ${version}");
|
||||
// ESPHome builder information
|
||||
ESP_LOGCONFIG("core", "ESPHome builder: " ESPHOME_VERSION);
|
||||
ESP_LOGCONFIG("core", "ESPHome build timestamp: %s", App.get_compilation_time().c_str());
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "ESPHome builder: " ESPHOME_VERSION);
|
||||
ESP_LOGCONFIG("${TAG_CORE_COMMON}", "ESPHome build timestamp: %s", App.get_compilation_time().c_str());
|
||||
|
||||
- id: publish_device_info
|
||||
mode: restart
|
||||
|
||||
Reference in New Issue
Block a user