Skip to content
Open
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: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ WEEWX_WEEK_START=0
# Options: 'us' (Fahrenheit, inches, etc.), 'metric' (Celsius, mm, etc.), 'metricwx' (meteorological metric)
WEEWX_UNIT_SYSTEM=metric

# Custom unit for pressure group - defaults for metric mbar
# Options: inHg, mbar, hPa, kPa
WEEWX_PRESSURE_UNIT = mbar

# Language and Localization
# Language code for WeeWX interface (en, de, fr, es, it, etc.)
WEEWX_LANGUAGE=en
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
context: .
dockerfile: Dockerfile.init
volumes:
- weewx_data:/data
- /opt/weewx:/data
environment:
- PATH=/opt/venv/bin:/usr/local/bin:/usr/bin:/bin
- PIP_TARGET=/data/lib/python/site-packages
Expand All @@ -25,6 +25,7 @@ services:
- WEEWX_RAIN_YEAR_START=${WEEWX_RAIN_YEAR_START:-1}
- WEEWX_WEEK_START=${WEEWX_WEEK_START:-0}
- WEEWX_UNIT_SYSTEM=${WEEWX_UNIT_SYSTEM:-metric}
- WEEWX_PRESSURE_UNIT=${WEEWX_PRESSURE_UNIT:-mbar}
- WEEWX_LANGUAGE=${WEEWX_LANGUAGE:-en}
- WEEWX_TIMEZONE=${WEEWX_TIMEZONE:-}
# Extension configuration
Expand All @@ -48,7 +49,7 @@ services:
weewx-init:
condition: service_completed_successfully
volumes:
- weewx_data:/data
- /opt/weewx:/data
environment:
- GW1000_IP=${GW1000_IP:-192.168.1.10}
restart: unless-stopped
Expand All @@ -62,7 +63,7 @@ services:
ports:
- "${NGINX_PORT:-8080}:80"
volumes:
- weewx_data:/data:ro
- /opt/weewx:/data:ro
command: >
sh -c "
cp /data/nginx/nginx.conf /etc/nginx/nginx.conf &&
Expand Down
12 changes: 12 additions & 0 deletions init/configure-weewx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ if [ -n "$WEEWX_LANGUAGE" ] && [ "$WEEWX_LANGUAGE" != "en" ]; then
/init/weewx_config_api.py set-value "[StdReport][Defaults]" "lang" "$WEEWX_LANGUAGE"
fi

# If env variable for custom pressure unit set - apply config
if [ -n "$WEEWX_PRESSURE_UNIT" ]; then

echo "Removing [StdReport][Defaults][Units][Groups]"
/init/weewx_config_api.py remove-section "[StdReport][Defaults][Units][Groups]"
echo "Recreating clean [StdReport][Defaults][Units][Groups]"
/init/weewx_config_api.py create-section "[StdReport][Defaults][Units][Groups]"
echo "Applying custom pressure unit: $WEEWX_PRESSURE_UNIT"
/init/weewx_config_api.py set-value "[StdReport][Defaults][Units][Groups]" "unused" "unused"
/init/weewx_config_api.py set-value "[StdReport][Defaults][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT"
fi

# Handle station_url (ConfigObj handles both commented and uncommented cases)
if [ -n "$WEEWX_STATION_URL" ]; then
echo "Setting station URL: $WEEWX_STATION_URL"
Expand Down
3 changes: 2 additions & 1 deletion init/extensions.d/belchertown/2_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ configure_belchertown_options() {
/init/weewx_config_api.py remove-section "[StdReport][Belchertown][Extras]"
fi
/init/weewx_config_api.py create-section "[StdReport][Belchertown][Extras]"



# Set Belchertown Extras options (for manifest and site title)
/init/weewx_config_api.py set-multiple-values "[StdReport][Belchertown][Extras]" \
"site_title=$WEEWX_LOCATION" \
Expand Down