piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Using a template in navigation_path in any mushroom-card wont navigate and will break the UI Editor

cmd-sam opened this issue · comments

Current Behavior

Adding a template to navigation_path, the navigation action wont work and the ui editor will become unusable after clicking on the card until refreshing the page.

type: custom:mushroom-template-card
primary: 'Go Home'
secondary: ''
icon: mdi:home
tap_action:
  action: navigate
  navigation_path: >
    {% if user == 'Tablet' %}
    /dashboard-tablet/0
    {% else %} 
    /lovelace/0
    {% endif %}

using the following code without using templates is working.

tap_action:
  action: navigate
  navigation_path: >
    /lovelace/0

Expected Behavior

navigate to the right navigation_path followed by the rules of the "if-else" statement.

Steps To Reproduce

  1. use the ui editor to create a card
  2. add the given code from Current Behavior to a Manual Card
  3. save and click on the card
  4. click three dots in the upper right
  5. click on edit
  6. try to edit any of your lovelace cards

Environment

Home Assistant Core 2022.5.5
Home Assistant Supervisor 2022.05.2
Home Assistant OS 7.6
Mushroom v1.8.8

Anything else?

No response

Template are not supported in actions and will not be because of the complexity of the action object.

@piitaya Bummer. Any chance you'd reconsider if it was added as a feature request?

Nope, there is no chance.
Actions are standard home assistant object. I do not prefer to override this with template because it will be to complicated to maintain.