Messaging: add more vehicle properties (#13229)
This commit is contained in:
parent
18436a1d68
commit
a11b9d04bc
1 changed files with 4 additions and 0 deletions
|
|
@ -79,6 +79,10 @@ func (h *Hub) apply(ev Event, tmpl string) (string, error) {
|
|||
// add missing attributes
|
||||
if name, ok := attr["vehicleName"].(string); ok {
|
||||
if v, err := h.vehicles.ByName(name); err == nil {
|
||||
attr["vehicleLimitSoc"] = v.GetLimitSoc()
|
||||
attr["vehicleMinSoc"] = v.GetMinSoc()
|
||||
attr["vehiclePlanTime"], attr["vehiclePlanSoc"] = v.GetPlanSoc()
|
||||
|
||||
instance := v.Instance()
|
||||
attr["vehicleTitle"] = instance.Title()
|
||||
attr["vehicleIcon"] = instance.Icon()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue