Skip to content

Commit

Permalink
Config UI: move generic meters to top (#12281)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Feb 15, 2024
1 parent 0101778 commit 6f9c338
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
16 changes: 15 additions & 1 deletion assets/js/components/Config/MeterModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
:disabled="!isNew"
class="form-select w-100"
>
<option
v-for="option in genericOptions"
:key="option.name"
:value="option.template"
>
{{ option.name }}
</option>
<option v-if="genericOptions.length" disabled>
──────────
</option>
<option
v-for="option in templateOptions"
:key="option.name"
Expand All @@ -52,6 +62,7 @@
{{ option.name }}
</option>
</select>
{{ templateName }}
</FormRow>
<p v-if="loadingTemplate">Loading ...</p>
<Modbus
Expand Down Expand Up @@ -198,7 +209,10 @@ export default {
return this.type || this.selectedType;
},
templateOptions() {
return this.products;
return this.products.filter((p) => p.group !== "generic");
},
genericOptions() {
return this.products.filter((p) => p.group === "generic");
},
templateParams() {
const params = this.template?.Params || [];
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/sunspec-battery-control.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
template: sunspec-battery-control
products:
- description:
de: Sunspec Batterie (Model 802)
en: Sunspec Battery (Model 802)
de: SunSpec Batterie (Model 802)
en: SunSpec Battery (Model 802)
capabilities: ["battery-control"]
group: generic
params:
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/sunspec-hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ template: sunspec-hybrid
covers: ["sunspec-hybrid-inverter"]
products:
- description:
de: Hybridwechselrichter
en: Hybrid Inverter
de: SunSpec Hybridwechselrichter
en: SunSpec Hybrid Inverter
group: generic
params:
- name: usage
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/sunspec-inverter-control.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
template: sunspec-inverter-control
products:
- description:
de: Sunspec Batterie (Model 124)
en: Sunspec Battery (Model 124)
de: SunSpec Batterie (Model 124)
en: SunSpec Battery (Model 124)
capabilities: ["battery-control"]
group: generic
params:
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/sunspec-inverter.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
template: sunspec-inverter
products:
- description:
de: Wechselrichter
en: Inverter
de: SunSpec Wechselrichter
en: SunSpec Inverter
group: generic
params:
- name: usage
Expand Down

0 comments on commit 6f9c338

Please sign in to comment.