Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates: rename number param type to int #17651

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions assets/js/components/Config/Modbus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PropertyField
id="modbusId"
property="id"
type="Number"
type="Int"
class="me-2"
required
:model-value="id || defaultId || 1"
Expand All @@ -59,7 +59,7 @@
<PropertyField
id="modbusPort"
property="port"
type="Number"
type="Int"
class="me-2 w-50"
required
:model-value="port || defaultPort || 502"
Expand Down Expand Up @@ -116,7 +116,7 @@
<PropertyField
id="modbusBaudrate"
property="baudrate"
type="Number"
type="Int"
class="me-2 w-50"
:valid-values="baudrateOptions"
required
Expand Down
6 changes: 3 additions & 3 deletions assets/js/components/Config/PropertyField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default {
if (this.masked) {
return "password";
}
if (["Number", "Float", "Duration"].includes(this.type)) {
if (["Int", "Float", "Duration"].includes(this.type)) {
return "number";
}
return "text";
Expand All @@ -132,13 +132,13 @@ export default {
if (this.size) {
return this.size;
}
if (["Number", "Float", "Duration"].includes(this.type)) {
if (["Int", "Float", "Duration"].includes(this.type)) {
return "w-50 w-min-200";
}
return "";
},
endAlign() {
return ["Number", "Float", "Duration"].includes(this.type);
return ["Int", "Float", "Duration"].includes(this.type);
},
step() {
if (this.type === "Float" || this.type === "Duration") {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/Config/VehicleModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
<PropertyField
id="vehicleParamPriority"
v-model="values.priority"
type="Number"
type="Int"
size="w-100"
class="me-2"
:valid-values="priorityOptions"
Expand Down
6 changes: 3 additions & 3 deletions cmd/configure/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,15 @@ func (c *CmdConfigure) configureLoadpoints() {
fmt.Println()
minAmperage := c.askValue(question{
label: c.localizedString("Loadpoint_WallboxMinAmperage"),
valueType: templates.TypeNumber,
valueType: templates.TypeInt,
minNumberValue: int64(minValue),
maxNumberValue: 32,
required: true,
})
loadpoint.MinCurrent, _ = strconv.Atoi(minAmperage)
maxAmperage := c.askValue(question{
label: c.localizedString("Loadpoint_WallboxMaxAmperage"),
valueType: templates.TypeNumber,
valueType: templates.TypeInt,
minNumberValue: 6,
maxNumberValue: 32,
required: true,
Expand Down Expand Up @@ -408,7 +408,7 @@ func (c *CmdConfigure) configureLoadpoints() {
case 3:
amperage := c.askValue(question{
label: c.localizedString("Loadpoint_WallboxMaxAmperage"),
valueType: templates.TypeNumber,
valueType: templates.TypeInt,
minNumberValue: int64(minValue),
maxNumberValue: 32,
required: true,
Expand Down
2 changes: 1 addition & 1 deletion cmd/configure/survey.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (c *CmdConfigure) askValue(q question) string {
}
}

if q.valueType == templates.TypeNumber {
if q.valueType == templates.TypeInt {
intValue, err := strconv.ParseInt(value, 10, 64)
if err != nil {
return errors.New(c.localizedString("ValueError_Number"))
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/charger/demo-charger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ params:
description:
de: Leistung
en: Power
type: number
type: int
default: 0
- name: enabled
description:
Expand All @@ -33,7 +33,7 @@ params:
en: Maximum amperage (A)
help:
example: 16
type: number
type: int
advanced: true

render: |
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/charger/homematic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ params:
mask: true
- name: meterchannel
default: 6
type: number
type: int
required: true
advanced: true
description:
Expand All @@ -37,7 +37,7 @@ params:
de: Kanalnummer des Messwertkanals, wie im CCU Webfrontend angezeigt.
- name: switchchannel
default: 3
type: number
type: int
required: true
advanced: true
description:
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/alpha-ess-smile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ params:
advanced: true
- name: minsoc
default: 20
type: number
type: int
advanced: true
- name: maxsoc
default: 95
type: number
type: int
advanced: true
render: |
type: custom
Expand Down
12 changes: 6 additions & 6 deletions templates/definition/meter/demo-battery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ params:
description:
de: Leistung (W)
en: Power (W)
type: number
type: int
- name: soc
description:
de: Ladestand (%)
en: Charge (%)
type: number
type: int
- name: controllable
description:
de: Steuerbar
Expand All @@ -33,25 +33,25 @@ params:
description:
de: Zählerstand (kWh)
en: Meter reading (kWh)
type: number
type: int
advanced: true
- name: currentL1
description:
de: L1 Stromstärke (A)
en: L1 current (A)
type: number
type: int
advanced: true
- name: currentL2
description:
de: L2 Stromstärke (A)
en: L2 current (A)
type: number
type: int
advanced: true
- name: currentL3
description:
de: L3 Stromstärke (A)
en: L3 current (A)
type: number
type: int
advanced: true

render: |
Expand Down
10 changes: 5 additions & 5 deletions templates/definition/meter/demo-meter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ params:
description:
de: Leistung (W)
en: Power (W)
type: number
type: int
- name: energy
description:
de: Zählerstand (kWh)
en: Meter reading (kWh)
type: number
type: int
advanced: true
- name: currentL1
description:
de: L1 Stromstärke (A)
en: L1 current (A)
type: number
type: int
advanced: true
- name: currentL2
description:
de: L2 Stromstärke (A)
en: L2 current (A)
type: number
type: int
advanced: true
- name: currentL3
description:
de: L3 Stromstärke (A)
en: L3 current (A)
type: number
type: int
advanced: true

render: |
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/deye-hybrid-3p.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ params:
- name: capacity
advanced: true
- name: minsoc
type: number
type: int
default: 20
advanced: true
- name: maxsoc
type: number
type: int
default: 95
advanced: true
render: |
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/deye-hybrid-hp3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ params:
- name: capacity
advanced: true
- name: minsoc
type: number
type: int
default: 20
advanced: true
- name: maxsoc
type: number
type: int
default: 95
advanced: true
render: |
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/meter/e3dc-rscp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ params:
help:
de: Limitiert die Entladeleistung im 'Halten' Batteriemodus
en: Limits discharge power in 'Hold' battery mode
type: number
type: int
advanced: true
- name: capacity
advanced: true
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/fox-ess-h3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ params:
advanced: true
# battery control
- name: minsoc
type: number
type: int
advanced: true
- name: maxsoc
type: number
type: int
advanced: true
render: |
type: custom
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/meter/homematic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ params:
mask: true
- name: meterchannel
default: 6
type: number
type: int
required: true
advanced: true
description:
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/meter/hoymiles-ahoydtu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ params:
choice: ["pv"]
- name: host
- name: id
type: number
type: int
description:
de: Wechselrichter ID (falls mehrere vorhanden)
en: Inverter ID (if multiple exist)
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/meter/huawei-smartlogger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ params:
choice: ["grid", "pv", "battery"]
allinone: true
- name: storageunit
type: number
type: int
default: 1
advanced: true
- name: modbus
Expand Down
2 changes: 1 addition & 1 deletion templates/definition/meter/huawei-sun2000.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ params:
- name: timeout
default: 15s
- name: storageunit
type: number
type: int
default: 1
advanced: true
- name: capacity
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/kostal-plenticore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ params:
- name: maxacpower
# battery control
- name: minsoc
type: number
type: int
advanced: true
- name: maxsoc
type: number
type: int
advanced: true
- name: watchdog
type: duration
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/saj-h2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ params:
default: 2
advanced: true
- name: minsoc
type: number
type: int
default: 20
advanced: true
- name: maxsoc
type: number
type: int
default: 95
advanced: true
render: |
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/sofarsolar-g3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ params:
advanced: true
# battery control
- name: minsoc
type: number
type: int
advanced: true
deprecated: true
- name: maxsoc
type: number
type: int
advanced: true
deprecated: true
render: |
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
Expand Up @@ -14,10 +14,10 @@ params:
advanced: true
# battery control (model 802)
- name: minsoc
type: number
type: int
advanced: true
- name: maxsoc
type: number
type: int
advanced: true
render: |
{{- if eq .usage "battery" }}
Expand Down
4 changes: 2 additions & 2 deletions templates/definition/meter/tesla-powerwall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ params:
en: optional product identifier of the energy site, use to override autodectction
de: optionale Product ID dieser Energy Site, zum Übersteuern der automatischen Erkennung
- name: minsoc
type: number
type: int
advanced: true
help:
en: the battery reserve percentage to reset to when switching the Battery back to normal operations
de: die Energyreserve auf die zurückgesetzt wird, wenn die Entladung wieder freigegeben wird
- name: maxsoc
type: number
type: int
advanced: true
help:
en: the battery reserve percentage to set to when switching the Battery to charge mode
Expand Down
Loading
Loading