Simplifies tags

It should be limited to 15ish chars
This commit is contained in:
Edward Firmo
2025-08-05 11:36:09 +02:00
parent 243a18bdf2
commit 250b22562d
9 changed files with 141 additions and 158 deletions

View File

@@ -11,6 +11,9 @@
##### - For normal system use, modifications to this file are NOT required. #####
####################################################################################################
---
substitutions:
TAG_STD_MEDIA_PLAYER: "std.media-player"
packages:
standard_hw_speaker: !include TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml
@@ -50,13 +53,12 @@ media_player:
on_state:
then:
- lambda: |-
static const char *TAG = "media_player.on_state.standard.hw.media_player";
// Check if volume has changed and update number entity
id(persistent_media_player_volume) = static_cast<uint8_t>(mp_media_player->volume * 100.0f);
if (id(persistent_media_player_volume) != id(last_media_player_volume)) {
id(last_media_player_volume) = id(persistent_media_player_volume);
ESP_LOGD(TAG, "Media player volume changed to %" PRIu8 "%%, updating number entity", id(persistent_media_player_volume));
ESP_LOGD("${TAG_STD_MEDIA_PLAYER}", "Media player volume changed to %" PRIu8 "%%, updating number entity",
id(persistent_media_player_volume));
}
script:
@@ -67,12 +69,11 @@ script:
- id: !extend dump_config
then:
- lambda: |-
static const char *TAG = "script.boot_sequence.standard.hw.media_player";
// Volume sync configuration
ESP_LOGCONFIG(TAG, "Media Player Volume Sync:");
ESP_LOGCONFIG(TAG, " Persistent volume: %" PRIu8 "%", id(persistent_media_player_volume));
ESP_LOGCONFIG(TAG, " Current volume: %.1f%%", mp_media_player->volume * 100.0f);
ESP_LOGCONFIG("${TAG_STD_MEDIA_PLAYER}", "Media Player Volume Sync:");
ESP_LOGCONFIG("${TAG_STD_MEDIA_PLAYER}", " Persistent volume: %" PRIu8 "%",
id(persistent_media_player_volume));
ESP_LOGCONFIG("${TAG_STD_MEDIA_PLAYER}", " Current volume: %.1f%%", mp_media_player->volume * 100.0f);
- id: !extend dump_config_list_packages
then:
@@ -97,10 +98,9 @@ script:
id: mp_media_player
volume: !lambda return id(persistent_media_player_volume) / 100.0f;
- lambda: |-
static const char *TAG = "script.sync_initial_volume.standard.hw.media_player";
id(last_media_player_volume) = id(persistent_media_player_volume);
ESP_LOGI(TAG, "Initial volume sync: %.1f%% (restored from persistence)", id(persistent_media_player_volume));
ESP_LOGI("${TAG_STD_MEDIA_PLAYER}", "Initial volume sync: %.1f%% (restored from persistence)",
id(persistent_media_player_volume));
speaker:
- platform: mixer