Modbus Proxy: fix yaml serialisation (#19279)

This commit is contained in:
andig 2025-03-01 11:31:35 +01:00 • committed by GitHub
parent ab774f10d9
commit 1cafc24627
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -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)

View file

@ -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