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
|
unit_system: metric
|
||||||
time_zone: Europe/Sofia
|
time_zone: Europe/Sofia
|
||||||
packages: !include_dir_named packages
|
packages: !include_dir_named packages
|
||||||
|
whitelist_external_dirs:
|
||||||
|
- /config/www/audio/youtube/pds
|
||||||
|
|
||||||
#
|
#
|
||||||
# ─── HOME ASSISTANT COMPONENTS ENABLED ──────────────────────────────────────────
|
# ─── HOME ASSISTANT COMPONENTS ENABLED ──────────────────────────────────────────
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ cards:
|
|||||||
- type: custom:config-template-card
|
- type: custom:config-template-card
|
||||||
entities:
|
entities:
|
||||||
- sensor.philip_defranco
|
- sensor.philip_defranco
|
||||||
- sensor.available_pds
|
- sensor.pds
|
||||||
card:
|
card:
|
||||||
type: vertical-stack
|
type: vertical-stack
|
||||||
cards:
|
cards:
|
||||||
@@ -58,4 +58,4 @@ cards:
|
|||||||
- type: custom:text-element
|
- type: custom:text-element
|
||||||
text: "Available:"
|
text: "Available:"
|
||||||
- type: custom:text-element
|
- 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:
|
sensor:
|
||||||
- platform: youtube
|
- platform: youtube
|
||||||
channel_id: UClFSU9_bUb4Rc6OYfTt5SPw
|
channel_id: UClFSU9_bUb4Rc6OYfTt5SPw
|
||||||
- platform: command_line
|
- platform: folder
|
||||||
name: Available PDS
|
folder: /config/www/audio/youtube/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
|
|
||||||
|
|
||||||
input_text:
|
input_text:
|
||||||
youtube_download_url:
|
youtube_download_url:
|
||||||
@@ -31,7 +25,11 @@ script:
|
|||||||
- service: media_player.play_media
|
- service: media_player.play_media
|
||||||
data_template:
|
data_template:
|
||||||
entity_id: media_player.master_bedroom
|
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"
|
media_content_type: "music"
|
||||||
|
|
||||||
youtube_download_selected:
|
youtube_download_selected:
|
||||||
|
|||||||
Reference in New Issue
Block a user