Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Aircast config out of Home Assistant config folder #192

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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