This commit is contained in:
parent
d58706e8a5
commit
c920893bf6
2 changed files with 7 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue