- platform: emby_upcoming_media
api_key: !secret apikey
user_id: !secret userid
host: !secret host
port: !secret port
ssl: false
max: 5
use_backdrop: false
include:
- Film
- Serie TV
Describe the bug
The component is working, but the "data" attribute is a string and not an object so it's not usable with jinjia in HA.
Please could you make the "data" attribute an object?
thanks
{{ states.sensor.emby_latest_film.attributes.data is string }} gives true
{{ state_attr('sensor.emby_latest_film', 'data') is string }} gives true
the above code is not working because the data attribute is a string:
{% set data = state_attr('sensor.emby_latest_film', 'data') %}
{{ data[1].title }}
{%- if data[1].release is none -%} ({{ data[1].aired.split('-')[0] }})
{% else %} ({{ data[1].release }}) {% endif %}
Version of the custom_component
Emby Latest Media 0.3.4
Configuration
Describe the bug
The component is working, but the "data" attribute is a string and not an object so it's not usable with jinjia in HA. Please could you make the "data" attribute an object? thanks
the above code is not working because the data attribute is a string:
I see that people using the component Plex Recently Added Component (https://github.com/custom-components/sensor.plex_recently_added) that gives a similar "data" attribute can use Jinjia templates with HA.
THE SOLUTION SEEMS TO BE: replace attributes["data"] = json.dumps(card_json)
with attributes['data'] = card_json in sensor.py
Debug log