Messaging: resolve pointer values

This commit is contained in:
andig 2025-10-24 15:01:28 +02:00
parent 9c429abc8d
commit e087276beb

View file

@ -2,6 +2,7 @@ package push
import (
"fmt"
"reflect"
"strings"
"text/template"
@ -72,7 +73,14 @@ func (h *Hub) apply(ev Event, tmpl string) (string, error) {
// get all values from cache
for _, p := range h.cache.All() {
if p.Loadpoint == nil || ev.Loadpoint == p.Loadpoint {
attr[p.Key] = p.Val
val := p.Val
// resolve pointers (https://github.com/evcc-io/evcc/issues/24688)
if rv := reflect.ValueOf(p.Val); rv.Kind() == reflect.Pointer && !rv.IsNil() {
val = rv.Elem().Interface()
}
attr[p.Key] = val
}
}