eebus: fix duplicate template names (#16484)
This commit is contained in:
parent
921837c3e7
commit
6395307a53
4 changed files with 7 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
template: eebus
|
||||
template: elli-2
|
||||
products:
|
||||
- brand: Elli
|
||||
description:
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
template: eebus
|
||||
template: ghost
|
||||
products:
|
||||
- brand: eSystems
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
template: eebus
|
||||
template: porsche-wallbox
|
||||
products:
|
||||
- brand: Porsche
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue