#!/bin/bash set -e set -x cd "$(dirname "$0")/.." pwd # Create config dir if not present if [[ ! -d "${PWD}/config" ]]; then mkdir -p "${PWD}/config" # Add defaults configuration hass --config "${PWD}/config" --script ensure_config fi # Overwrite configuration.yaml if provided if [ -f ${PWD}/.devcontainer/configuration.yaml ]; then rm -f ${PWD}/config/configuration.yaml ln -s ${PWD}/.devcontainer/configuration.yaml ${PWD}/config/configuration.yaml fi # Set the path to custom_components ## This let's us have the structure we want /custom_components/integration_blueprint ## while at the same time have Home Assistant configuration inside /config ## without resulting to symlinks. export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components" ## Link custom_components into config # rm -f ${PWD}/config/custom_components # ln -s ${PWD}/custom_components ${PWD}/config/ # Start Home Assistant hass --config "${PWD}/config" --debug