mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 12:54:04 +02:00
birdnet-pipy: remove TZ option — timezone auto-derived from station location
The app derives its timezone from station lat/lng via timezonefinder (Settings → Location in the Web UI), so a separate addon-level TZ only ever created mismatch with the UI-derived zone. All app-facing timestamps (dashboard, API, DB) and Python service stdout (api/main/birdnet) already honor the UI zone via logging_config.py's formatter, and the frontend log viewer re-converts Icecast timestamps on read. Net effect in the HA addon log pane: Python services still show the correct local time; only Icecast's raw stdout now prints in UTC (accepted trade for a single source of truth). Deletes rootfs/etc/cont-init.d/02-timezone.sh added in 0.5.6-2. Also cleans up the options YAML in DOCS.md/README.md: drops RECORDING_MODE and RTSP_URL (never wired — app reads them from user_settings.json), drops http_stream from the modes list, and moves STREAM_BITRATE under an env_vars: example since it's honored by start-icecast.sh but not a schema option. Bumped to 0.6.3-2 (addon-only, no upstream app change).
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -euo pipefail
|
||||
|
||||
# Use timezone defined in add-on options
|
||||
bashio::log.info "Setting timezone..."
|
||||
TZ_VALUE="$(bashio::config 'TZ' || true)"
|
||||
TZ_VALUE="${TZ_VALUE:-Europe/Paris}"
|
||||
|
||||
if [ ! -f "/usr/share/zoneinfo/${TZ_VALUE}" ]; then
|
||||
bashio::log.warning "Invalid timezone '${TZ_VALUE}'. Falling back to Europe/Paris."
|
||||
bashio::log.warning "See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for valid values."
|
||||
TZ_VALUE="Europe/Paris"
|
||||
fi
|
||||
|
||||
# Apply timezone to the container
|
||||
ln -sf "/usr/share/zoneinfo/${TZ_VALUE}" /etc/localtime
|
||||
echo "${TZ_VALUE}" > /etc/timezone
|
||||
export TZ="${TZ_VALUE}"
|
||||
sed -i "1a TZ=\"${TZ_VALUE}\"" /etc/services.d/*
|
||||
|
||||
# Update s6 container environment so child processes inherit the timezone
|
||||
if [ -d /var/run/s6/container_environment ]; then
|
||||
echo "${TZ_VALUE}" > /var/run/s6/container_environment/TZ
|
||||
fi
|
||||
|
||||
bashio::log.notice "Timezone set to: ${TZ_VALUE}"
|
||||
Reference in New Issue
Block a user