diff --git a/templates/definition/charger/elli-wallbox-2.yaml b/templates/definition/charger/elli-2.yaml similarity index 98% rename from templates/definition/charger/elli-wallbox-2.yaml rename to templates/definition/charger/elli-2.yaml index f7d882868..5c1149ba1 100644 --- a/templates/definition/charger/elli-wallbox-2.yaml +++ b/templates/definition/charger/elli-2.yaml @@ -1,4 +1,4 @@ -template: eebus +template: elli-2 products: - brand: Elli description: diff --git a/templates/definition/charger/ghost.yaml b/templates/definition/charger/ghost.yaml index 402f4bd98..856585093 100644 --- a/templates/definition/charger/ghost.yaml +++ b/templates/definition/charger/ghost.yaml @@ -1,4 +1,4 @@ -template: eebus +template: ghost products: - brand: eSystems description: diff --git a/templates/definition/charger/porsche-wallbox.yaml b/templates/definition/charger/porsche-wallbox.yaml index 6fa00ae2a..1c24d16e0 100644 --- a/templates/definition/charger/porsche-wallbox.yaml +++ b/templates/definition/charger/porsche-wallbox.yaml @@ -1,4 +1,4 @@ -template: eebus +template: porsche-wallbox products: - brand: Porsche description: diff --git a/util/templates/init.go b/util/templates/init.go index 143c6c614..d34675835 100644 --- a/util/templates/init.go +++ b/util/templates/init.go @@ -84,6 +84,10 @@ func load(class Class) (res []Template) { return fmt.Errorf("processing template '%s' failed: %w", filepath, err) } + if slices.ContainsFunc(res, func(t Template) bool { return t.Template == tmpl.Template }) { + return fmt.Errorf("duplicate template name '%s' found in file '%s'", tmpl.Template, filepath) + } + res = append(res, tmpl) return nil