Config: show vehicle asleep state instead of value errors (#31859)

This commit is contained in:
Michael Geers 2026-07-17 14:38:59 +02:00 • committed by GitHub
parent 0cf708a40d
commit eed3aece14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 83 additions and 7 deletions

View file

@ -7,6 +7,7 @@ import (
)
type errorPlugin struct {
*getter
err error
}
@ -32,10 +33,19 @@ func NewErrorFromConfig(other map[string]any) (Plugin, error) {
o := &errorPlugin{
err: err,
}
o.getter = defaultGetters(o, 1)
return o, nil
}
var _ StringGetter = (*errorPlugin)(nil)
func (o *errorPlugin) StringGetter() (func() (string, error), error) {
return func() (string, error) {
return "", o.err
}, nil
}
var _ IntSetter = (*errorPlugin)(nil)
func (o *errorPlugin) IntSetter(param string) (func(int64) error, error) {