Skip to content

Commit

Permalink
Merge branch 'master' into feat/pulsar-5
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Oct 6, 2024
2 parents fdf4bb6 + 8cc3b0f commit 59955a4
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 21 deletions.
3 changes: 2 additions & 1 deletion charger/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ var acceptable = []string{
"loadpoint 1 is not configured", // openWB
"recv timeout",
"(Client.Timeout exceeded while awaiting headers)",
"can only have either uri or device", // modbus
"can only have either uri or device", // modbus
"connection already registered with different protocol: localhost:502", // modbus
"sponsorship required, see https://github.com/evcc-io/evcc#sponsorship",
"eebus not configured",
"context deadline exceeded",
Expand Down
13 changes: 7 additions & 6 deletions meter/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ var acceptable = []string{
"i/o timeout",
"'sma': missing uri or serial", // SMA
"[1ESY1161052714 1ESY1161229249 1EMH0008842285 1ESY1161978584 1EMH0004864048 1ESY1161979033 7ELS8135823805]", // Discovergy
"can only have either uri or device", // modbus
"(Client.Timeout exceeded while awaiting headers)", // http
"context deadline exceeded", // LG ESS
"no ping response for 192.0.2.2", // SMA
"no such network interface", // SMA
"missing config values: username, password, key", // E3DC
"can only have either uri or device", // modbus
"connection already registered with different protocol: localhost:502", // modbus
"(Client.Timeout exceeded while awaiting headers)", // http
"context deadline exceeded", // LG ESS
"no ping response for 192.0.2.2", // SMA
"no such network interface", // SMA
"missing config values: username, password, key", // E3DC
}

func TestTemplates(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/charger/ocpp-abb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
description:
generic: TerraAC
requirements:
evcc: ["sponsorship"]
evcc: ["sponsorship", "skiptest"]
params:
- preset: ocpp
render: |
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/charger/ocpp-elvi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
description:
generic: Elvi
requirements:
evcc: ["sponsorship"]
evcc: ["sponsorship", "skiptest"]
params:
- preset: ocpp
- name: meter
Expand Down
2 changes: 2 additions & 0 deletions templates/definition/charger/ocpp-fronius-wattpilot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ products:
- brand: Fronius
description:
generic: Wattpilot (OCPP)
requirements:
evcc: ["sponsorship", "skiptest"]
params:
- preset: ocpp
render: |
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/charger/ocpp-homecharge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ requirements:
The charger must be equipped with a built-in meter (models HC11L/HC22L Energy or Profi).
For the OCPP configuration, you need to access the EFR-SECC charge controller at http://host/secc.
For login credentials, ask your dealer or the vendor EFR (www.efr.de).
evcc: ["sponsorship"]
evcc: ["sponsorship", "skiptest"]
params:
- preset: ocpp
render: |
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/charger/ocpp-orbis-viaris.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
description:
generic: Viaris
requirements:
evcc: ["sponsorship"]
evcc: ["sponsorship", "skiptest"]
params:
- preset: ocpp
render: |
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/charger/ocpp-pulsarplus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ requirements:
* URL: ws://[evcc-adresse]:8887/ (local network connection)
* Charge Point Identity: Custom value (e.g. serial number of charger) which is reused in configuration as *stationid*
* Password: leave empty
evcc: ["sponsorship"]
evcc: ["sponsorship", "skiptest"]
params:
- preset: ocpp
render: |
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/charger/ocpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ requirements:
* Local network connection
The specific configuration and the actual usable functionality depend on the charger model and its software.
evcc: ["sponsorship"]
evcc: ["sponsorship", "skiptest"]
params:
- preset: ocpp
- name: autostart
Expand Down
1 change: 1 addition & 0 deletions templates/definition/charger/tinkerforge-warp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ requirements:
description:
en: WARP Firmware v2 required. Automatic phase switching requires the additional WARP Energy Manager.
de: WARP Firmware v2 erforderlich. Für automatische Phasenumschaltung wird zusätzlich der WARP Energy Manager benötigt.
evcc: ["skiptest"]
params:
- preset: mqtt
- name: topic
Expand Down
1 change: 1 addition & 0 deletions templates/definition/charger/tinkerforge-warp3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ requirements:
description:
de: Die automatische Phasenumschaltung bei 1p Fahrzeugen muss deaktiviert sein. Siehe https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3.
en: The automatic phase switching for 1p vehicles must be deactivated. Siehe https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3.
evcc: ["skiptest"]
params:
- preset: mqtt
- name: topic
Expand Down
2 changes: 2 additions & 0 deletions templates/definition/meter/solaranzeige-mqtt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ products:
- brand: Solaranzeige
description:
generic: Solaranzeige
requirements:
evcc: ["skiptest"]
params:
- name: usage
choice: ["grid", "pv"]
Expand Down
2 changes: 2 additions & 0 deletions templates/definition/meter/tibber-pulse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ products:
- brand: Tibber
description:
generic: Pulse
requirements:
evcc: ["skiptest"]
params:
- name: usage
choice: ["grid"]
Expand Down
2 changes: 2 additions & 0 deletions templates/definition/meter/volkszaehler-ws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ products:
- brand: Volkszähler
description:
generic: WebSocket API
requirements:
evcc: ["skiptest"]
group: generic
params:
- name: usage
Expand Down
1 change: 1 addition & 0 deletions templates/definition/tariff/electricitymaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ requirements:
description:
de: "CO₂-Daten für viele Länder von https://electricitymaps.com/. Der 'Free Personal Tier' beinhaltet leider keine Prognosedaten. Dafür benötigst du einen kommerziellen Account von https://api-portal.electricitymaps.com/. Kostenloser Testmonat verfügbar."
en: "CO₂ data for many countries from https://electricitymaps.com/. The 'Free Personal Tier' unfortunately does not include forecast data. You'll need a commercial account from https://api-portal.electricitymaps.com/. Free trial available."
evcc: ["skiptest"]
group: co2
params:
- name: uri
Expand Down
1 change: 1 addition & 0 deletions templates/definition/tariff/groupe-e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ requirements:
description:
de: "Nur für die Schweiz verfügbar."
en: "Only available for Switzerland."
evcc: ["skiptest"]
group: price
params:
- preset: tariff-base
Expand Down
1 change: 1 addition & 0 deletions templates/definition/tariff/gruenstromindex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ requirements:
description:
de: "Regionale Emissionsdaten von https://gruenstromindex.de. Nur für Deutschland verfügbar."
en: "Regional emission data from https://gruenstromindex.de. Only available for Germany."
evcc: ["skiptest"]
group: co2
params:
- name: zip
Expand Down
1 change: 1 addition & 0 deletions templates/definition/tariff/tibber.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ requirements:
description:
en: "Get your API token from the Tibber developer portal: https://developer.tibber.com/"
de: "Hol dir deinen API-Token aus dem Tibber-Entwicklerportal: https://developer.tibber.com/"
evcc: ["skiptest"]
group: price
params:
- name: token
Expand Down
2 changes: 1 addition & 1 deletion util/sponsor/pulsares.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func readSerial() (string, error) {
return "", nil
}

if _, err := f.Write([]byte{0x0E, 0x00, 0xD0, 0x05}); err != nil {
if _, err := f.Write([]byte{0x0E, 0x00, 0x61, 0x7C, 0xD2, 0x71}); err != nil {
return "", err
}

Expand Down
9 changes: 5 additions & 4 deletions util/templates/render_testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package templates

import (
"maps"
"os"
"slices"
"testing"

Expand All @@ -27,10 +26,12 @@ func test(t *testing.T, tmpl Template, values map[string]interface{}, cb func(va
return
}

// actually run the instance if not on CI
if os.Getenv("CI") == "" {
cb(values)
// don't execute if skip test is set
if slices.Contains(tmpl.Requirements.EVCC, RequirementSkipTest) {
return
}

cb(values)
}

func TestClass(t *testing.T, class Class, instantiate func(t *testing.T, values map[string]interface{})) {
Expand Down
3 changes: 2 additions & 1 deletion util/templates/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ const (
RequirementEEBUS = "eebus" // EEBUS Setup is required
RequirementMQTT = "mqtt" // MQTT Setup is required
RequirementSponsorship = "sponsorship" // Sponsorship is required
RequirementSkipTest = "skiptest" // Template should be rendered but not tested
)

var ValidRequirements = []string{RequirementEEBUS, RequirementMQTT, RequirementSponsorship}
var ValidRequirements = []string{RequirementEEBUS, RequirementMQTT, RequirementSponsorship, RequirementSkipTest}

var predefinedTemplateProperties = []string{
"type", "template", "name",
Expand Down
4 changes: 2 additions & 2 deletions vehicle/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ var acceptable = []string{
"missing credentials", // Tesla
"missing credentials id", // Tronity
"missing access and/or refresh token, use `evcc token` to create", // Tesla
"login failed: code not found", //Polestar
"login failed: code not found", // Polestar
"empty instance type- check for missing usage", // Merces
"invalid vehicle type: tesla", //Tesla
"invalid vehicle type: tesla", // Tesla
}

func TestTemplates(t *testing.T) {
Expand Down

0 comments on commit 59955a4

Please sign in to comment.