Vehicles: collect common properties in includeable template (#14245)
This commit is contained in:
parent
86f2502c19
commit
62a1e223b6
10 changed files with 29 additions and 60 deletions
|
|
@ -36,13 +36,9 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: citroen
|
||||
title: {{ .title }}
|
||||
icon: {{ .icon }}
|
||||
{{ include "vehicle-common" . }}
|
||||
user: {{ .user }}
|
||||
tokens:
|
||||
access: {{ .accessToken }}
|
||||
refresh: {{ .refreshToken }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
vin: {{ .vin }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
|
|
|
|||
|
|
@ -36,13 +36,9 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: ds
|
||||
title: {{ .title }}
|
||||
icon: {{ .icon }}
|
||||
{{ include "vehicle-common" . }}
|
||||
user: {{ .user }}
|
||||
tokens:
|
||||
access: {{ .accessToken }}
|
||||
refresh: {{ .refreshToken }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
vin: {{ .vin }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
|
|
|
|||
|
|
@ -41,13 +41,11 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: ford-connect
|
||||
{{ include "vehicle-common" . }}
|
||||
credentials:
|
||||
id: {{ .clientid }}
|
||||
secret: {{ .clientsecret }}
|
||||
tokens:
|
||||
access: {{ .accessToken }}
|
||||
refresh: {{ .refreshToken }}
|
||||
vin: {{ .vin }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
|
|
|
|||
|
|
@ -38,13 +38,9 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: mercedes
|
||||
title: {{ .title }}
|
||||
icon: {{ .icon }}
|
||||
{{ include "vehicle-common" . }}
|
||||
user: {{ .user }}
|
||||
tokens:
|
||||
access: {{ .accessToken }}
|
||||
refresh: {{ .refreshToken }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
vin: {{ .vin }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
|
|
|
|||
|
|
@ -36,13 +36,9 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: opel
|
||||
title: {{ .title }}
|
||||
icon: {{ .icon }}
|
||||
{{ include "vehicle-common" . }}
|
||||
user: {{ .user }}
|
||||
tokens:
|
||||
access: {{ .accessToken }}
|
||||
refresh: {{ .refreshToken }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
vin: {{ .vin }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
|
|
|
|||
|
|
@ -36,13 +36,9 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: peugeot
|
||||
title: {{ .title }}
|
||||
icon: {{ .icon }}
|
||||
{{ include "vehicle-common" . }}
|
||||
user: {{ .user }}
|
||||
tokens:
|
||||
access: {{ .accessToken }}
|
||||
refresh: {{ .refreshToken }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
vin: {{ .vin }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
|
|
|
|||
|
|
@ -40,13 +40,9 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: tesla
|
||||
title: {{ .title }}
|
||||
icon: {{ .icon }}
|
||||
{{ include "vehicle-common" . }}
|
||||
tokens:
|
||||
access: {{ .accessToken }}
|
||||
refresh: {{ .refreshToken }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
vin: {{ .vin }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
features: ["coarsecurrent"]
|
||||
|
|
|
|||
|
|
@ -33,16 +33,8 @@ params:
|
|||
- preset: vehicle-identify
|
||||
render: |
|
||||
type: tronity
|
||||
{{- if .title }}
|
||||
title: {{ .title }}
|
||||
{{- end }}
|
||||
{{- if .icon }}
|
||||
icon: {{ .icon }}
|
||||
{{- end }}
|
||||
{{ include "vehicle-common" . }}
|
||||
credentials:
|
||||
id: {{ .clientid }}
|
||||
secret: {{ .clientsecret }}
|
||||
vin: {{ .vin }}
|
||||
capacity: {{ .capacity }}
|
||||
phases: {{ .phases }}
|
||||
{{ include "vehicle-identify" . }}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,5 @@
|
|||
{{ define "vehicle-base" }}
|
||||
{{- if .title }}
|
||||
title: {{ .title }}
|
||||
{{- end }}
|
||||
{{- if .icon }}
|
||||
icon: {{ .icon }}
|
||||
{{- end }}
|
||||
user: {{ .user }}
|
||||
password: {{ .password }}
|
||||
{{- if .capacity }}
|
||||
capacity: {{ .capacity }}
|
||||
{{- end }}
|
||||
{{- if .vin }}
|
||||
vin: {{ .vin }}
|
||||
{{- end }}
|
||||
{{- if .phases }}
|
||||
phases: {{ .phases }}
|
||||
{{- end }}
|
||||
{{- if .cache }}
|
||||
cache: {{ .cache }}
|
||||
{{- end }}
|
||||
{{ template "vehicle-common" . }}
|
||||
{{- end }}
|
||||
|
|
|
|||
20
util/templates/includes/vehicle-common.tpl
Normal file
20
util/templates/includes/vehicle-common.tpl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{ define "vehicle-common" }}
|
||||
{{- if .title }}
|
||||
title: {{ .title }}
|
||||
{{- end }}
|
||||
{{- if .icon }}
|
||||
icon: {{ .icon }}
|
||||
{{- end }}
|
||||
{{- if .capacity }}
|
||||
capacity: {{ .capacity }}
|
||||
{{- end }}
|
||||
{{- if .vin }}
|
||||
vin: {{ .vin }}
|
||||
{{- end }}
|
||||
{{- if .phases }}
|
||||
phases: {{ .phases }}
|
||||
{{- end }}
|
||||
{{- if .cache }}
|
||||
cache: {{ .cache }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue