Revert "Modbus: don't render rtu: false for Modbus TCP (#9915)" (#10046)

This commit is contained in:
andig 2023-09-24 16:25:50 +02:00 • committed by GitHub
parent d58706e8a5
commit c920893bf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -37,14 +37,15 @@ func init() {
// NewPhoenixEMEthFromConfig creates a Phoenix charger from generic config
func NewPhoenixEMEthFromConfig(other map[string]interface{}) (api.Charger, error) {
cc := struct {
URI string
ID uint8
Meter struct {
modbus.TcpSettings `mapstructure:",squash"`
Meter struct {
Power, Energy, Currents bool
}
}{
URI: "192.168.0.8:502", // default
ID: 180, // default
TcpSettings: modbus.TcpSettings{
URI: "192.168.0.8:502", // default
ID: 180, // default
},
}
if err := util.DecodeOther(other, &cc); err != nil {

View file

@ -12,6 +12,7 @@ rtu: true
{{- else if or (eq .modbus "tcpip") .tcpip }}
# Modbus TCP
uri: {{ .host }}:{{ .port }}
rtu: false
{{- else }}
# configuration error - should not happen
modbusConnectionTypeNotDefined: {{ .modbus }}