gadgetchnnel / lovelace-home-feed-card

A custom Lovelace card for displaying a combination of persistent notifications, calendar events, and entities in the style of a feed.
275 stars 24 forks source link

Entities set via services display undefined for triggering entity #60

Open amaximus opened 3 years ago

amaximus commented 3 years ago

You may reproduce the issue with the following steps:

alias: "test bug"
initial_state: "on"
trigger:
:
action:
  - service: input_text.set_value
    data:
      entity_id: input_text.test_bug
      value: 'test text'

Result: triggering entity displayed as undefined (pls see attached screenshot).

Expected behaviour: in such cases either suppress 'undefined@' part or have something like 'hass@' or 'system@' instead.

feed-card

amaximus commented 3 years ago

I guess line 881 [1] should be changed to something like:

var contentText = `${n.display_name} @ ${n.state}`;
if ( typeof `${n.display_name} == "undefined" ) {
   contentText = `hass @ ${n.state}`;
}

[1] https://github.com/gadgetchnnel/lovelace-home-feed-card/blob/5e381394613597f90b001baeaa427fd574ea134f/src/main.js#L881