73 lines
2.8 KiB
YAML
73 lines
2.8 KiB
YAML
####################################################################################################
|
|
##### TX Ultimate Easy for ESPHome #####
|
|
##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy #####
|
|
####################################################################################################
|
|
##### Purpose: ESPHome - Add-on - Media player #####
|
|
####################################################################################################
|
|
##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo #####
|
|
####################################################################################################
|
|
##### NOTE: #####
|
|
##### - Make changes ONLY if absolutely necessary and you have the required knowledge. #####
|
|
##### - For normal system use, modifications to this file are NOT required. #####
|
|
####################################################################################################
|
|
---
|
|
packages:
|
|
standard_hw_speaker: !include TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml
|
|
|
|
esphome:
|
|
platformio_options:
|
|
build_flags:
|
|
- -D TX_ULTIMATE_EASY_ADDON_MEDIA_PLAYER
|
|
|
|
media_player:
|
|
- id: mp_media_player
|
|
name: Media Player
|
|
internal: false
|
|
platform: speaker
|
|
announcement_pipeline:
|
|
speaker: announcement_spk_resampling_input
|
|
media_pipeline:
|
|
speaker: media_spk_resampling_input
|
|
|
|
script:
|
|
- id: !extend dump_config_list_packages
|
|
then:
|
|
- script.wait: dump_config
|
|
- lambda: |-
|
|
// Check for requirements
|
|
#if !defined(TX_ULTIMATE_EASY_CORE)
|
|
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
|
#endif
|
|
#if !defined(TX_ULTIMATE_EASY_STANDARD_HW_SPEAKER)
|
|
#error "The package TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml is required."
|
|
#endif
|
|
|
|
// Identify itself
|
|
ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - Media Player");
|
|
|
|
speaker:
|
|
- platform: mixer
|
|
id: mixer_speaker_embedded
|
|
output_speaker: speaker_embedded
|
|
source_speakers:
|
|
- id: announcement_speaker_embedded
|
|
- id: media_speaker_embedded
|
|
- platform: resampler
|
|
id: announcement_spk_resampling_input
|
|
output_speaker: announcement_speaker_embedded
|
|
- platform: resampler
|
|
id: media_spk_resampling_input
|
|
output_speaker: media_speaker_embedded
|
|
|
|
switch:
|
|
- id: sw_speaker_amplifier
|
|
name: Speaker - Amplifier
|
|
platform: gpio
|
|
pin:
|
|
number: GPIO26
|
|
inverted: true
|
|
restore_mode: RESTORE_DEFAULT_ON
|
|
internal: true
|
|
entity_category: config
|
|
...
|