From 0c2355036ce85340f14db076a5cc7a76269e9180 Mon Sep 17 00:00:00 2001 From: Andreas Linde <42185+DerAndereAndi@users.noreply.github.com> Date: Sun, 16 Jan 2022 13:17:13 +0100 Subject: [PATCH] Vehicle template udpates (#2264) - Add Smart EQ template - Fix EVNotify template --- templates/definition/vehicle/evnotify.yaml | 2 +- templates/definition/vehicle/smart.yaml | 12 ++++++++++++ templates/docs/vehicle/smart.yaml | 7 +++++++ vehicle/template_test.go | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 templates/definition/vehicle/smart.yaml create mode 100644 templates/docs/vehicle/smart.yaml diff --git a/templates/definition/vehicle/evnotify.yaml b/templates/definition/vehicle/evnotify.yaml index cea1b6fb7..290f143af 100644 --- a/templates/definition/vehicle/evnotify.yaml +++ b/templates/definition/vehicle/evnotify.yaml @@ -18,7 +18,7 @@ render: | title: {{ .title }} {{- end }} capacity: {{ .capacity }} - charge: + soc: type: http uri: https://app.evnotify.de/soc?akey={{ .akey }}&token={{ .token }} # evNotify Server + AKEY method: GET diff --git a/templates/definition/vehicle/smart.yaml b/templates/definition/vehicle/smart.yaml new file mode 100644 index 000000000..a98f2dab1 --- /dev/null +++ b/templates/definition/vehicle/smart.yaml @@ -0,0 +1,12 @@ +template: smart +description: + generic: Smart EQ +params: +- base: vehiclebase +- base: vehicleidentify +- name: capacity + default: 17.6 +render: | + type: smart + {{include "vehicle-base" .}} + {{include "vehicle-identify" .}} diff --git a/templates/docs/vehicle/smart.yaml b/templates/docs/vehicle/smart.yaml new file mode 100644 index 000000000..a69215cb3 --- /dev/null +++ b/templates/docs/vehicle/smart.yaml @@ -0,0 +1,7 @@ +type: template +template: smart +description: Smart EQ +user: +password: +vin: W... +capacity: 17.6 \ No newline at end of file diff --git a/vehicle/template_test.go b/vehicle/template_test.go index 474e8c5f8..aaa2d37ef 100644 --- a/vehicle/template_test.go +++ b/vehicle/template_test.go @@ -29,6 +29,7 @@ var acceptable = []string{ "missing access and/or refresh token, use `evcc token` to create", // Tesla "login failed: Unauthorized: Authentication Failed", // Nissan "login failed: no auth code", // Porsche + "login failed: unexpected status: 400", // Smart "invalid_client:Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)", // BMW, Mini "login failed: oauth2: cannot fetch token: 400 Bad Request Response: {\"error\":\"invalid_request\",\"error_description\":\"Missing parameter, 'username'\"}", // Opel, DS, Citroen, PSA "401: Unauthorized: Invalid credentials", // Volvo