-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: modbusproxy unmarshaling #26819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Thats the wrong place. It should be in the unmarshaler. |
This reverts commit 1acb43d.
|
That's quite difficult, because unmarshaling is done by calling |
|
I guess the whole problem is this: type ModbusProxy struct {
Port int `json:"port"`
ReadOnly string `yaml:",omitempty" json:"readonly,omitempty"`
modbus.Settings `mapstructure:",squash" yaml:",inline,omitempty" json:"settings,omitempty"`
}ReadOnly should be this: package modbus
// go:generate go tool enumer -type ReadOnlyMode -trimprefix ReadOnly -transform=lower
type `ReadOnlyMode` int
const (
ReadOnlyFalse ReadOnlyMode = iota
ReadOnlyDeny // return modbus error
ReadOnlyTrue // silently ignore writes
)If we add a |
|
Made a quick test, that seems to work. Now we need to:
|
|
For me, this works for |
|
The problem ist that boolean (not string) yaml |
|
Hope this works |
|
Still not working? |
|
Haven't had time yet. Just tested it:
Is this mix of numbers and strings intentional? If yes, I'll fix the UI. |
|
No :( |
Fix #26610
\cc @andig