Config: show vehicle asleep state instead of value errors (#31859)
This commit is contained in:
parent
0cf708a40d
commit
eed3aece14
8 changed files with 83 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue