Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity and config.entity not working as expected #132

Open
luixal opened this issue May 5, 2023 · 0 comments
Open

Entity and config.entity not working as expected #132

luixal opened this issue May 5, 2023 · 0 comments

Comments

@luixal
Copy link

luixal commented May 5, 2023

The problem

When using jinja templates and according to the docs, entity variable should be used rather than config.entity. As seen in the Jinja Templates section in the docs:

entity - the entity_id from the current entity row configuration. **This must be used instead of config.entity for the template to automatically update**.

This actually works, but doesn't update on attribute's changes:

  - type: custom:paper-buttons-row
    buttons:
      - entity: light.main_room
        layout: icon_name
        name: "{{ state_attr(config.entity, 'duration') }}: "
        state: "{{ states(config.entity) | title }}"

but this doesn't (entity's name is shown):

  - type: custom:paper-buttons-row
    buttons:
      - entity: light.main_room
        layout: icon_name
        name: "{{ state_attr(entity, 'duration') }}: "
        state: "{{ states(config.entity) | title }}"

BTW: It would be great to be able to use javascript templates :)

What version of Paper Buttons Row has the issue?

2.1.3

What version of Home Assistant are you running?

Home Assistant 2023.04.1

What version of the Frontend are you running?

20230411.1 - latest

Example YAML snippet

See above.

Anything in the logs that might be useful for us?

I don't think so.

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant