From 27f0a1471e2338a6b858327df60e4e976dca945b Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 5 May 2023 19:34:28 +0200 Subject: [PATCH] Templates: add vehicle-identify for Tronity, EVNotify (#7831) --- templates/definition/vehicle/evnotify.yaml | 5 +++-- templates/definition/vehicle/niu-e-scooter.yaml | 3 ++- templates/definition/vehicle/offline.yaml | 4 ++-- templates/definition/vehicle/ovms.yaml | 4 ++-- templates/definition/vehicle/tesla.yaml | 4 ++-- templates/definition/vehicle/tronity.yaml | 5 +++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/templates/definition/vehicle/evnotify.yaml b/templates/definition/vehicle/evnotify.yaml index edc3b087fb..da90f54a36 100644 --- a/templates/definition/vehicle/evnotify.yaml +++ b/templates/definition/vehicle/evnotify.yaml @@ -19,11 +19,11 @@ params: - preset: vehicle-identify render: | type: custom - {{- if ne .title "" }} + {{- if .title }} title: {{ .title }} {{- end }} capacity: {{ .capacity }} - {{- if ne .phases "" }} + {{- if .phases }} phases: {{ .phases }} {{- end }} soc: @@ -31,3 +31,4 @@ render: | uri: https://app.evnotify.de/soc?akey={{ .akey }}&token={{ .token }} # evNotify Server + AKEY method: GET jq: .soc_display + {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/niu-e-scooter.yaml b/templates/definition/vehicle/niu-e-scooter.yaml index 8955256e3e..30bdaf18c7 100644 --- a/templates/definition/vehicle/niu-e-scooter.yaml +++ b/templates/definition/vehicle/niu-e-scooter.yaml @@ -23,7 +23,7 @@ params: - preset: vehicle-identify render: | type: niu - {{- if ne .title "" }} + {{- if .title }} title: {{ .title }} {{- end }} {{- if ne .icon "" }} @@ -33,3 +33,4 @@ render: | password: {{ .password }} # NIU app password serial: {{ .serial }} # NIU E-Scooter serial number like shown in app capacity: {{ .capacity }} + {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/offline.yaml b/templates/definition/vehicle/offline.yaml index 2ed541f59f..700f395e2e 100644 --- a/templates/definition/vehicle/offline.yaml +++ b/templates/definition/vehicle/offline.yaml @@ -23,14 +23,14 @@ params: render: | type: custom features: ["offline"] - {{- if ne .title "" }} + {{- if .title }} title: {{ .title }} {{- end }} {{- if ne .icon "" }} icon: {{ .icon }} {{- end }} capacity: {{ .capacity }} # kWh - {{- if ne .phases "" }} + {{- if .phases }} phases: {{ .phases }} {{- end }} soc: # fixed - no Soc available diff --git a/templates/definition/vehicle/ovms.yaml b/templates/definition/vehicle/ovms.yaml index 088a9cc358..2370217926 100644 --- a/templates/definition/vehicle/ovms.yaml +++ b/templates/definition/vehicle/ovms.yaml @@ -26,7 +26,7 @@ params: - preset: vehicle-identify render: | type: ovms - {{- if ne .title "" }} + {{- if .title }} title: {{ .title }} {{- end }} {{- if ne .icon "" }} @@ -36,7 +36,7 @@ render: | password: {{ .password }} vehicleid: {{ .vehicleid }} # vehicle id capacity: {{ .capacity }} - {{- if ne .phases "" }} + {{- if .phases }} phases: {{ .phases }} {{- end }} server: dexters-web.de # used ovms server [dexters-web.de or api.openvehicles.com] diff --git a/templates/definition/vehicle/tesla.yaml b/templates/definition/vehicle/tesla.yaml index e14e5367ee..438a00e2bf 100644 --- a/templates/definition/vehicle/tesla.yaml +++ b/templates/definition/vehicle/tesla.yaml @@ -40,7 +40,7 @@ params: - preset: vehicle-identify render: | type: tesla - {{- if ne .title "" }} + {{- if .title }} title: {{ .title }} {{- end }} {{- if ne .icon "" }} @@ -50,7 +50,7 @@ render: | access: {{ .accessToken }} refresh: {{ .refreshToken }} capacity: {{ .capacity }} - {{- if ne .phases "" }} + {{- if .phases }} phases: {{ .phases }} {{- end }} {{- if ne .vin "" }} diff --git a/templates/definition/vehicle/tronity.yaml b/templates/definition/vehicle/tronity.yaml index 1a4fc1b7a2..37e53202c3 100644 --- a/templates/definition/vehicle/tronity.yaml +++ b/templates/definition/vehicle/tronity.yaml @@ -23,7 +23,7 @@ params: - preset: vehicle-identify render: | type: tronity - {{- if ne .title "" }} + {{- if .title }} title: {{ .title }} {{- end }} {{- if ne .icon "" }} @@ -33,9 +33,10 @@ render: | id: {{ .user }} secret: {{ .password }} capacity: {{ .capacity }} - {{- if ne .phases "" }} + {{- if .phases }} phases: {{ .phases }} {{- end }} {{- if ne .vin "" }} vin: {{ .vin }} {{- end }} + {{ include "vehicle-identify" . }}