Skip to content

Commit

Permalink
add services documentation (#4)
Browse files Browse the repository at this point in the history
add services documentation enabling ui support
  • Loading branch information
lukasjakobi authored Dec 2, 2023
1 parent 9b796f6 commit 589f51d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ A- Navigate to the "Automations" section.
- Enter `https://github.com/lukasjakobi/ha-sync-announcement` into the "Repository" field.
- Choose `Python Script` as the category and click "Add."
- The repository will appear in you automations overview, click on the repository and install it via the button on the bottom right
- Run the service `python_script.reload` or reload your Home Assistant instance
- Run the service `python_script.reload` or restart your Home Assistant instance

### Manual Installation

- Download the `sync_announcements.py` file.
- Copy the file into the `homeassistant/python_scripts` folder in your Home Assistant installation.
- Run the service `python_script.reload` or reload your Home Assistant instance
- Run the service `python_script.reload` or restart your Home Assistant instance

### Enabling UI support

- Download the `services.yaml` file.
- Add the file content into the `homeassistant/python_scripts/services.yaml` file, create the file if it is not present.
- Run the service `python_script.reload` or restart your Home Assistant instance

## Running the Script
- Create a service call within Home Assistant to execute the script.
Expand Down
45 changes: 45 additions & 0 deletions python_scripts/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
sync_announcement:
name: Sync Announcement
description: Sync text-to-speech (TTS) messages across multiple media player entities
fields:
media_players:
name: Media Players
description: The media player entities to sync TTS messages to
selector:
entity:
multiple: true
filter:
domain: media_player
message:
name: Message
description: The TTS message to sync to the media players
selector:
text:
volume:
name: Volume
description: The volume to set the media player to when playing the TTS message
selector:
number:
min: 0
max: 1
step: 0.01
mode: slider
unit_of_measurement: "%"
language:
name: Language
description: The language to use when playing the TTS message (e.g en-US, en-GB, fr-FR, de-DE etc.)
selector:
text:
default: en-US
volume_reset:
name: Volume Reset
description: Whether to reset the volume to its previous value after playing the TTS message
selector:
boolean:
default: false
cache:
name: Cache
description: Whether to cache the TTS message
selector:
boolean:
default: true

0 comments on commit 589f51d

Please sign in to comment.