Config UI: use modbus defaults when testing/creating device (#13815)

This commit is contained in:
Michael Geers 2024-05-08 20:08:46 +02:00 • committed by GitHub
parent 20d0320137
commit 86b3207045
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 0 deletions

View file

@ -235,9 +235,19 @@ export default {
modbusCapabilities() {
return this.modbus?.Choice || [];
},
modbusDefaults() {
const { ID, Comset, Baudrate, Port } = this.modbus || {};
return {
id: ID,
comset: Comset,
baudrate: Baudrate,
port: Port,
};
},
apiData() {
return {
template: this.templateName,
...this.modbusDefaults,
...this.values,
usage: this.meterType,
};

View file

@ -72,6 +72,16 @@ template = "Hersteller"
titleChoice = "Was möchtest du hinzufügen?"
validateSave = "Überprüfen & speichern"
[config.options]
[config.options.endianness]
big = "big-endian"
little = "little-endian"
[config.options.schema]
http = "HTTP (unverschlüsselt)"
https = "HTTPS (verschlüsselt)"
[config.pv]
titleAdd = "Zähler (PV) hinzufügen"
titleEdit = "Zähler (PV) bearbeiten"

View file

@ -72,6 +72,16 @@ template = "Manufacturer"
titleChoice = "What Do You Want To Add?"
validateSave = "Validate & save"
[config.options]
[config.options.endianness]
big = "big-endian"
little = "little-endian"
[config.options.schema]
http = "HTTP (unencrypted)"
https = "HTTPS (encrypted)"
[config.pv]
titleAdd = "Add Solar Meter"
titleEdit = "Edit Solar Meter"