Modbus Proxy: fix yaml serialisation (#19279)
This commit is contained in:
parent
ab774f10d9
commit
1cafc24627
2 changed files with 8 additions and 8 deletions
|
|
@ -54,8 +54,8 @@ type Go struct {
|
|||
|
||||
type ModbusProxy struct {
|
||||
Port int
|
||||
ReadOnly string
|
||||
modbus.Settings `mapstructure:",squash"`
|
||||
ReadOnly string `yaml:",omitempty" json:",omitempty"`
|
||||
modbus.Settings `mapstructure:",squash" yaml:",inline,omitempty" json:",omitempty"`
|
||||
}
|
||||
|
||||
var _ api.Redactor = (*Hems)(nil)
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ type TcpSettings struct {
|
|||
|
||||
// Settings contains the ModBus settings
|
||||
type Settings struct {
|
||||
ID uint8
|
||||
SubDevice int
|
||||
URI, Device, Comset string
|
||||
Baudrate int
|
||||
UDP bool
|
||||
RTU *bool // indicates RTU over TCP if true
|
||||
ID uint8 `json:",omitempty" yaml:",omitempty"`
|
||||
SubDevice int `json:",omitempty" yaml:",omitempty"`
|
||||
URI, Device, Comset string `json:",omitempty" yaml:",omitempty"`
|
||||
Baudrate int `json:",omitempty" yaml:",omitempty"`
|
||||
UDP bool `json:",omitempty" yaml:",omitempty"`
|
||||
RTU *bool `json:",omitempty" yaml:",omitempty"`
|
||||
}
|
||||
|
||||
// Protocol identifies the wire format from the RTU setting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue