More improvements and fixes for configure (#2010)
- Fixes Modbus setup not working, actually the test not using the user input - Make sure Modbus input items use localized text and help - Mask sponsorship token input
This commit is contained in:
parent
94e2a28839
commit
e7623fa8cf
3 changed files with 12 additions and 7 deletions
|
|
@ -124,6 +124,7 @@ func (c *CmdConfigure) processDeviceRequirements(templateItem templates.Template
|
|||
}
|
||||
sponsortoken := c.askValue(question{
|
||||
label: c.localizedString("Requirements_Sponsorship_Token_Input", nil),
|
||||
mask: true,
|
||||
required: true})
|
||||
c.configuration.config.SponsorToken = sponsortoken
|
||||
sponsor.Subject = sponsortoken
|
||||
|
|
@ -346,24 +347,26 @@ func (c *CmdConfigure) processModbusConfig(param templates.Param, deviceCategory
|
|||
index, _ = c.askChoice(c.localizedString("Config_ModbusInterface", nil), choices)
|
||||
}
|
||||
selectedModbusKey = choiceKeys[index]
|
||||
additionalConfig[templates.ParamModbus] = selectedModbusKey
|
||||
|
||||
switch selectedModbusKey {
|
||||
case templates.ModbusKeyRS485Serial:
|
||||
device := c.askValue(question{
|
||||
label: "Device",
|
||||
help: "USB-RS485 Adapter Adresse",
|
||||
label: c.localizedString("UserFriendly_Baudrate_Name", nil),
|
||||
help: c.localizedString("UserFriendly_Device_Help", nil),
|
||||
exampleValue: templates.ModbusParamValueDevice,
|
||||
required: true})
|
||||
additionalConfig[templates.ModbusParamNameDevice] = device
|
||||
|
||||
baudrate := c.askValue(question{
|
||||
label: "Baudrate",
|
||||
label: c.localizedString("UserFriendly_Baudrate_Name", nil),
|
||||
defaultValue: deviceDefaultBaudrate,
|
||||
valueType: templates.ParamValueTypeNumber,
|
||||
required: true})
|
||||
additionalConfig[templates.ModbusParamNameBaudrate] = baudrate
|
||||
|
||||
comset := c.askValue(question{
|
||||
label: "ComSet",
|
||||
label: c.localizedString("UserFriendly_ComSet_Name", nil),
|
||||
defaultValue: deviceDefaultComset,
|
||||
required: true})
|
||||
additionalConfig[templates.ModbusParamNameComset] = comset
|
||||
|
|
@ -373,13 +376,13 @@ func (c *CmdConfigure) processModbusConfig(param templates.Param, deviceCategory
|
|||
additionalConfig[templates.ModbusParamNameRTU] = "true"
|
||||
}
|
||||
host := c.askValue(question{
|
||||
label: "Host",
|
||||
label: c.localizedString("UserFriendly_Host_Name", nil),
|
||||
exampleValue: templates.ModbusParamValueHost,
|
||||
required: true})
|
||||
additionalConfig[templates.ModbusParamNameHost] = host
|
||||
|
||||
port := c.askValue(question{
|
||||
label: "Port",
|
||||
label: c.localizedString("UserFriendly_Port_Name", nil),
|
||||
defaultValue: templates.ModbusParamValuePort,
|
||||
valueType: templates.ParamValueTypeNumber,
|
||||
required: true})
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Intro = "Die nächsten Schritte führen durch die Einrichtung einer Konfiguratio
|
|||
|
||||
Flow_Type = "Was möchtest du machen?"
|
||||
Flow_Type_NewConfiguration = "Eine neue evcc Konfigurationsdatei erstellen"
|
||||
Flow_Type_SingleDevice = "Ein einzelnes Gerät Konfigurieren"
|
||||
Flow_Type_SingleDevice = "Ein einzelnes Gerät konfigurieren"
|
||||
|
||||
Flow_NewConfiguration_Setup = "- Hausinstallation einrichten"
|
||||
Flow_NewConfiguration_Select = "Wähle eines der folgenden PV Komplettsysteme aus, oder '{{ .ItemNotPresent }}' falls keines dieser Geräte vorhanden ist"
|
||||
|
|
@ -35,6 +35,7 @@ Choose = "Wähle"
|
|||
UserFriendly_Title_Name = "Titel"
|
||||
UserFriendly_Title_Help = "Wird in der Benutzeroberfläche angezeigt"
|
||||
UserFriendly_Device_Name = "Geräteadresse"
|
||||
UserFriendly_Device_Help = "USB-RS485 Adapter Adresse"
|
||||
UserFriendly_Baudrate_Name = "Baudrate"
|
||||
UserFriendly_ComSet_Name = "ComSet"
|
||||
UserFriendly_Host_Name = "IP-Adresse oder Hostname"
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ Choose = "Choose"
|
|||
UserFriendly_Title_Name = "Title"
|
||||
UserFriendly_Title_Help = "Will be displayed in the user interface"
|
||||
UserFriendly_Device_Name = "Device address"
|
||||
UserFriendly_Device_Help = "USB-RS485 Adapter address"
|
||||
UserFriendly_Baudrate_Name = "Baudrate"
|
||||
UserFriendly_ComSet_Name = "ComSet"
|
||||
UserFriendly_Host_Name = "IP-Address or Hostname"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue