mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-07 17:34:42 +00:00
Implement available pds with folder integration
This commit is contained in:
@@ -6,6 +6,8 @@ homeassistant:
|
||||
unit_system: metric
|
||||
time_zone: Europe/Sofia
|
||||
packages: !include_dir_named packages
|
||||
whitelist_external_dirs:
|
||||
- /config/www/audio/youtube/pds
|
||||
|
||||
#
|
||||
# ─── HOME ASSISTANT COMPONENTS ENABLED ──────────────────────────────────────────
|
||||
|
||||
@@ -40,7 +40,7 @@ cards:
|
||||
- type: custom:config-template-card
|
||||
entities:
|
||||
- sensor.philip_defranco
|
||||
- sensor.available_pds
|
||||
- sensor.pds
|
||||
card:
|
||||
type: vertical-stack
|
||||
cards:
|
||||
@@ -58,4 +58,4 @@ cards:
|
||||
- type: custom:text-element
|
||||
text: "Available:"
|
||||
- type: custom:text-element
|
||||
text: "${states['sensor.available_pds'].state.split(',')}"
|
||||
text: "${states['sensor.pds'].attributes.file_list.join('<br />')}"
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
sensor:
|
||||
- platform: youtube
|
||||
channel_id: UClFSU9_bUb4Rc6OYfTt5SPw
|
||||
- platform: command_line
|
||||
name: Available PDS
|
||||
command: ls -1 /config/www/audio/youtube/pds | grep mp3 | paste -sd "," -
|
||||
scan_interval: 30
|
||||
- platform: command_line
|
||||
name: Available Youtube clips
|
||||
command: ls -1 /config/www/audio/youtube | grep mp3 | paste -sd "," -
|
||||
scan_interval: 30
|
||||
- platform: folder
|
||||
folder: /config/www/audio/youtube/pds
|
||||
|
||||
input_text:
|
||||
youtube_download_url:
|
||||
@@ -31,7 +25,11 @@ script:
|
||||
- service: media_player.play_media
|
||||
data_template:
|
||||
entity_id: media_player.master_bedroom
|
||||
media_content_id: "{{ states('sensor.sarah_url') }}/local/audio/youtube/pds/{{ states('sensor.available_pds').split(',') | last }}"
|
||||
media_content_id: >
|
||||
|
||||
{% set last_pds = state_attr('sensor.pds', 'file_list') | sort | last %}
|
||||
{{ states('sensor.sarah_url') }}/local/audio/youtube/pds/{{ last_pds.split('/') | last }}
|
||||
|
||||
media_content_type: "music"
|
||||
|
||||
youtube_download_selected:
|
||||
|
||||
Reference in New Issue
Block a user