Skip to content

Commit

Permalink
Migrate Aircast config out of Home Assistant config folder
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Nov 10, 2023
1 parent b5e4a01 commit ef99fc7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aircast/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ lack of audio. Note that `latency_rtp` does not delay playback start.

## Tweaking Aircast

Aircast creates a configuration file called `aircast.xml` in your Home
Assistant configuration directory. This file allows you to tweak each device
Aircast creates a configuration file called `aircast.xml` in the add-on
configuration directory. This file allows you to tweak each device
separately. Every time it finds a new device, it will be added to that file.

> **NOTE**: It is HIGHLY recommended to stop the addon before making changes
Expand Down
3 changes: 2 additions & 1 deletion aircast/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ arch:
hassio_api: true
host_network: true
map:
- config:rw
- addon_config:rw
- homeassistant_config:rw
options:
latency_rtp: 0
latency_http: 0
Expand Down
8 changes: 8 additions & 0 deletions aircast/rootfs/etc/s6-overlay/s6-rc.d/init-aircast/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
# ==============================================================================
declare latency

# Migrate add-on data from the Home Assistant config folder,
# to the add-on configuration folder.
if ! bashio::fs.directory_exists '/config/aircast.xml' \
&& bashio::fs.file_exists '/homeassistant/aircast.xml'; then
mv /homeassistant/aircast.xml /config/aircast.xml \
|| bashio::exit.nok "Failed to migrate Aircast configuration"
fi

# Create a configuration file, if it does not exist yet
if ! bashio::fs.file_exists '/config/aircast.xml'; then
cp /etc/aircast.xml /config/aircast.xml
Expand Down

0 comments on commit ef99fc7

Please sign in to comment.