diff --git a/charts/stable/home-assistant/Chart.yaml b/charts/stable/home-assistant/Chart.yaml index 5cd21e57a9b..211aeb4723a 100644 --- a/charts/stable/home-assistant/Chart.yaml +++ b/charts/stable/home-assistant/Chart.yaml @@ -29,4 +29,4 @@ sources: - https://github.com/home-assistant/home-assistant - https://github.com/cdr/code-server type: application -version: 8.1.4 +version: 8.2.0 diff --git a/charts/stable/home-assistant/SCALE/ix_values.yaml b/charts/stable/home-assistant/SCALE/ix_values.yaml index 579111bc315..8abbcce689c 100644 --- a/charts/stable/home-assistant/SCALE/ix_values.yaml +++ b/charts/stable/home-assistant/SCALE/ix_values.yaml @@ -10,8 +10,8 @@ image: tag: v2021.10.4@sha256:6f5892e307edd0b135f4ccab1ecee70518e0418b26e6264c23c67d1982eece86 initContainers: - init-db: - image: "{{ .Values.alpineImage.repository }}:{{ .Values.alpineImage.tag }}" + init: + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" command: ["/config/init/init.sh"] volumeMounts: - name: init diff --git a/charts/stable/home-assistant/templates/_configmap.tpl b/charts/stable/home-assistant/templates/_configmap.tpl index cb63a080a9e..99f1f57cdf8 100644 --- a/charts/stable/home-assistant/templates/_configmap.tpl +++ b/charts/stable/home-assistant/templates/_configmap.tpl @@ -26,6 +26,32 @@ data: cat /config/init/recorder.default >> /config/configuration.yaml cat /config/init/http.default >> /config/configuration.yaml fi + + cd "/config" || echo "Could not change path to /config" + echo "Creating custom_components directory..." + mkdir "/config/custom_components" || echo "custom_components directory already exists" + + echo "Changing to the custom_components directory..." + cd "/config/custom_components" || echo "Could not change path to /config/custom_components" + + echo "Downloading HACS" + wget "https://github.com/hacs/integration/releases/latest/download/hacs.zip" || exit 0 + + if [ -d "/config/custom_components/hacs" ]; then + echo "HACS directory already exist, cleaning up..." + rm -R "/config/custom_components/hacs" + fi + + echo "Creating HACS directory..." + mkdir "/config/custom_components/hacs" + + echo "Unpacking HACS..." + unzip "/config/custom_components/hacs.zip" -d "/config/custom_components/hacs" >/dev/null 2>&1 + + echo "Removing HACS zip file..." + rm "/config/custom_components/hacs.zip" + echo "Installation complete." + configuration.yaml.default: |- # Configure a default setup of Home Assistant (frontend, api, etc) default_config: diff --git a/charts/stable/home-assistant/values.yaml b/charts/stable/home-assistant/values.yaml index d437adb1125..40482f0a92a 100644 --- a/charts/stable/home-assistant/values.yaml +++ b/charts/stable/home-assistant/values.yaml @@ -23,8 +23,8 @@ service: port: 8123 initContainers: - init-db: - image: "{{ .Values.alpineImage.repository }}:{{ .Values.alpineImage.tag }}" + init: + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" command: ["/config/init/init.sh"] volumeMounts: - name: init