- Only add SMA HEMS Setup, if required values exist (e.g. machine-id). Also asks the user if this should be added - New templates: Alfen, PC Electric Garo, go-e V3 (moved into separate template), Tasmota meter, Huawei inverter with Sdongle - Updated templates: SolarEdge Inverter, Sunspec - New capabilities can be assigned: 1p3p, RFID - Added group information instead of `generic` flag. Used e.g. for marking power plugs or generic devices - Requirement description text can now be markdown text (required for documentation page) - Replaced `description` with product list, separating brand from description (required for documentation page) - Generate newly structured documentation yaml files - Fix https://github.com/evcc-io/evcc/issues/2385
107 lines
2.7 KiB
Smarty
107 lines
2.7 KiB
Smarty
product:
|
|
{{- if .ProductBrand }}
|
|
brand: {{ .ProductBrand }}
|
|
{{- end }}
|
|
{{- if .ProductDescription }}
|
|
description: {{ .ProductDescription }}
|
|
{{- end }}
|
|
{{- if .ProductGroup }}
|
|
group: {{ .ProductGroup }}
|
|
{{- end }}
|
|
{{- if .Capabilities }}
|
|
capabilities: [{{ range .Capabilities -}}"{{ . }}"{{- end }}]
|
|
{{- end }}
|
|
{{- if .Requirements }}
|
|
requirements: [{{ range .Requirements -}}"{{ . }}"{{- end }}]
|
|
{{- end }}
|
|
{{- if .RequirementDescription }}
|
|
description: |
|
|
{{ .RequirementDescription | indent 2 }}
|
|
{{- end }}
|
|
|
|
render:
|
|
{{ if .Usages }}{{ range .Usages -}}
|
|
- usage: {{ . }}
|
|
default: |
|
|
type: template
|
|
template: {{ $.Template }}
|
|
usage: {{ . }}
|
|
{{- range $.Params }}
|
|
{{- if eq .Name "modbus" }}
|
|
# Modbus Start
|
|
{{ $.Modbus | indent 4 -}}
|
|
# Modbus End
|
|
{{- else if ne .Advanced true }}
|
|
{{ .Name }}:
|
|
{{- if len .Value }} {{ .Value }} {{ end }}
|
|
{{- if ne (len .Values) 0 }}
|
|
{{ range .Values }}
|
|
- {{ . }}
|
|
{{ end }}
|
|
{{- end }}
|
|
{{- if .Help.DE }} # {{ .Help.DE }} {{ end }}{{ if ne .Required true }} # Optional {{ end -}}
|
|
{{- end -}}
|
|
{{ end }}
|
|
{{- if $.AdvancedParams }}
|
|
advanced: |
|
|
type: template
|
|
template: {{ $.Template }}
|
|
usage: {{ . }}
|
|
{{- range $.Params }}
|
|
{{- if eq .Name "modbus" }}
|
|
# Modbus Start
|
|
{{ $.Modbus | indent 4 -}}
|
|
# Modbus End
|
|
{{- else }}
|
|
{{ .Name }}:
|
|
{{- if len .Value }} {{ .Value }} {{ end }}
|
|
{{- if ne (len .Values) 0 }}
|
|
{{ range .Values }}
|
|
- {{ . }}
|
|
{{ end }}
|
|
{{- end }}
|
|
{{- if .Help.DE }} # {{ .Help.DE }} {{ end }}{{ if ne .Required true }} # Optional {{ end -}}
|
|
{{- end -}}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}{{ else -}}
|
|
- default: |
|
|
type: template
|
|
template: {{ $.Template }}
|
|
{{- range $.Params }}
|
|
{{- if eq .Name "modbus" }}
|
|
# Modbus Start
|
|
{{ $.Modbus | indent 4 -}}
|
|
# Modbus End
|
|
{{- else if ne .Advanced true }}
|
|
{{ .Name }}:
|
|
{{- if len .Value }} {{ .Value }} {{ end }}
|
|
{{- if ne (len .Values) 0 }}
|
|
{{ range .Values }}
|
|
- {{ . }}
|
|
{{ end }}
|
|
{{- end }}
|
|
{{- if .Help.DE }} # {{ .Help.DE }} {{ end }}{{ if ne .Required true }} # Optional {{ end -}}
|
|
{{- end -}}
|
|
{{ end }}
|
|
{{- if $.AdvancedParams }}
|
|
advanced: |
|
|
type: template
|
|
template: {{ $.Template }}
|
|
{{- range $.Params }}
|
|
{{- if eq .Name "modbus" }}
|
|
# Modbus Start
|
|
{{ $.Modbus | indent 4 -}}
|
|
# Modbus End
|
|
{{- else }}
|
|
{{ .Name }}:
|
|
{{- if len .Value }} {{ .Value }} {{ end }}
|
|
{{- if ne (len .Values) 0 }}
|
|
{{ range .Values }}
|
|
- {{ . }}
|
|
{{ end }}
|
|
{{- end }}
|
|
{{- if .Help.DE }} # {{ .Help.DE }} {{ end }}{{ if ne .Required true }} # Optional {{ end -}}
|
|
{{- end -}}
|
|
{{ end }}
|
|
{{ end }}{{ end }}
|