Skip to content

Commit

Permalink
Revert "Modbus: don't render rtu: false for Modbus TCP (evcc-io#9915)" (
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Sep 24, 2023
1 parent d58706e commit c920893
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions charger/phoenix-em-eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions util/templates/modbus.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit c920893

Please sign in to comment.