diff --git a/cmd/configure/helper.go b/cmd/configure/helper.go index 8e80a44cb..da19c083d 100644 --- a/cmd/configure/helper.go +++ b/cmd/configure/helper.go @@ -425,44 +425,6 @@ func (c *CmdConfigure) processParams(templateItem *templates.Template, deviceCat additionalConfig := make(map[string]interface{}) for _, param := range templateItem.Params { - if param.Dependencies != nil { - valid := true - for _, dep := range param.Dependencies { - i, valueParam := templateItem.ParamByName(dep.Name) - if i == -1 { - break - } - - value := valueParam.Value - switch dep.Check { - case templates.DependencyCheckEmpty: - if additionalConfig[dep.Name] != nil { - valid = additionalConfig[dep.Name] == "" - } else { - valid = value == "" - } - case templates.DependencyCheckNotEmpty: - if additionalConfig[dep.Name] != nil { - valid = additionalConfig[dep.Name] != "" - } else { - valid = value != "" - } - case templates.DependencyCheckEqual: - if additionalConfig[dep.Name] != nil { - valid = additionalConfig[dep.Name] == dep.Value - } else { - valid = value == dep.Value - } - } - if !valid { - break - } - } - if !valid { - continue - } - } - switch param.Name { case templates.ParamModbus: additionalConfig[param.Name] = param.Value diff --git a/util/templates/template.go b/util/templates/template.go index 729bd9a99..1c1177929 100644 --- a/util/templates/template.go +++ b/util/templates/template.go @@ -78,12 +78,6 @@ func (t *Template) Validate() error { if p.ValueType != "" && !slices.Contains(ValidParamValueTypes, p.ValueType) { return fmt.Errorf("invalid value type '%s' in template %s", p.ValueType, t.Template) } - - for _, d := range p.Dependencies { - if !slices.Contains(ValidDependencies, d.Check) { - return fmt.Errorf("invalid dependency check '%s' in template %s", d.Check, t.Template) - } - } } return nil diff --git a/util/templates/template_types.go b/util/templates/template_types.go index cfb34010f..81c7f2d22 100644 --- a/util/templates/template_types.go +++ b/util/templates/template_types.go @@ -173,12 +173,6 @@ type LinkedTemplate struct { ExcludeTemplate string // only consider this if no device of the named linked template was added } -type Dependency struct { - Name string // the Param name value this depends on - Check string // the check to perform, valid values see const DependencyCheck... - Value string // the string value to check against -} - // Param is a proxy template parameter // Params can be defined: // 1. in the template: uses entries in 4. for default properties and values, can be overwritten here @@ -196,7 +190,6 @@ type Param struct { Preset string // Reference a predefined se of params Name string // Param name which is used for assigning defaults properties and referencing in render Description TextLanguage // language specific titles (presented in UI instead of Name) - Dependencies []Dependency // List of dependencies, when this param should be presented Required bool // cli if the user has to provide a non empty value Mask bool // cli if the value should be masked, e.g. for passwords Advanced bool // cli if the user does not need to be asked. Requires a "Default" to be defined.