hass.tibber_prices/scripts/develop
Julian Pawlowski e163a47d57 chore(style): normalize indentation and line continuations in shell scripts
Apply consistent 4-space indentation and trailing-operator style for line
continuations (&&, |) across all development and release scripts. No logic
changes.

Release-Notes: skip
2026-04-12 14:15:17 +00:00

53 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
# script/develop: Start Home Assistant in development mode
#
# Starts Home Assistant with debug logging enabled, using the config/ directory
# for configuration. Automatically cleans up accidental package installations and
# sets PYTHONPATH to load the integration from custom_components/.
#
# Usage:
# ./scripts/develop
#
# Examples:
# ./scripts/develop
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR/.."
# shellcheck source=scripts/.lib/output.sh
source "$SCRIPT_DIR/.lib/output.sh"
if [[ -z ${VIRTUAL_ENV:-} ]]; then
# shellcheck source=/dev/null
source "$HOME/.venv/bin/activate"
fi
# Clean up critical issues (accidental package installations)
# Uses minimal mode to avoid deleting useful caches
"$SCRIPT_DIR/clean" --minimal
# Create config dir if not present
if [[ ! -d ${PWD}/config ]]; then
mkdir -p "${PWD}/config"
hass --config "${PWD}/config" --script ensure_config
fi
"$SCRIPT_DIR/setup/sync-hacs"
# Set the path to custom_components
## This let's us have the structure we want <root>/custom_components/tibber_prices
## while at the same time have Home Assistant configuration inside <root>/config
## without resulting to symlinks.
export PYTHONPATH="${PYTHONPATH:-}:${PWD}/custom_components"
log_header "Starting Home Assistant in development mode"
log_info "Config directory: ${PWD}/config"
log_info "Debug logging: enabled"
log_separator
echo ""
# Start Home Assistant
hass --config "${PWD}/config" --debug