Add custom sentences.
This commit is contained in:
parent
a6d2b4a86a
commit
15dca517f8
4 changed files with 23 additions and 1 deletions
|
@ -8,7 +8,11 @@ data:
|
|||
init.py: |
|
||||
import pathlib
|
||||
# Symlink some paths to move them outside the config volume.
|
||||
paths = {"/config/.storage": "/media/storage", "/config/configuration.yaml": "/media/configuration/configuration.yaml"}
|
||||
paths = {
|
||||
"/config/.storage": "/media/storage",
|
||||
"/config/configuration.yaml": "/media/configuration/configuration.yaml",
|
||||
"/config/custom-sentences": "/media/custom-sentences",
|
||||
}
|
||||
for from_p, to in paths.items():
|
||||
try:
|
||||
from_path = pathlib.Path(from_p)
|
||||
|
|
|
@ -28,3 +28,15 @@ data:
|
|||
"{{ $key }}": |
|
||||
{{- $value | toYaml | nindent 4 }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "homeassistant.fullname" . }}-custom-sentences
|
||||
labels:
|
||||
{{- include "homeassistant.labels" . | nindent 4 }}
|
||||
data:
|
||||
{{- range $key, $value := fromYaml .Values.config.customSentences }}
|
||||
"{{ $key }}": |
|
||||
{{- $value | toYaml | nindent 4 }}
|
||||
{{- end }}
|
||||
|
|
|
@ -76,6 +76,8 @@ spec:
|
|||
mountPath: /media/configuration
|
||||
- name: packages-configmap
|
||||
mountPath: /media/packages
|
||||
- name: custom-sentences-configmap
|
||||
mountPath: /media/custom-sentences/en
|
||||
securityContext:
|
||||
privileged: true
|
||||
initContainers:
|
||||
|
@ -138,3 +140,6 @@ spec:
|
|||
- name: packages-configmap
|
||||
configMap:
|
||||
name: {{ include "homeassistant.fullname" . }}-packages
|
||||
- name: custom-sentences-configmap
|
||||
configMap:
|
||||
name: {{ include "homeassistant.fullname" . }}-custom-sentences
|
||||
|
|
|
@ -72,6 +72,7 @@ mainConfig:
|
|||
db_url: sqlite:////media/database/hass-db.sqlite
|
||||
config:
|
||||
packages: ""
|
||||
customSentences: ""
|
||||
|
||||
cert:
|
||||
dnsNames: []
|
||||
|
|
Loading…
Reference in a new issue