UI-Lovelace-Minimalist/UI

ulm_translation_off renders 'undefined'

Opened this issue · 0 comments

Describe the bug
I use card_fan and it renders 'undefined' when the fan is off, successfully showing percentage when fan is on.

Full card:

- type: "custom:button-card"
  entity: fan.recuperator_master_bedroom
  template: card_fan
  variables:
    ulm_card_fan_enable_slider: true

To Reproduce
Just use this code with any dimmable fan i guess.

Expected behavior
For the card to show 'Off'

Screenshots
image
image

Additional context
I've found that card uses 'ulm_translation_off' from 'custom_components\ui_lovelace_minimalist\lovelace\translations\default.yaml', so it should use default off state for any language. I tried a couple of popular languages, and my primary is English, so I guess there's an error with expression itself, but idk which error. For now I fixed it with
ulm_translation_off: "[[[ return hass.resources[hass['language']]['state.default.off'] || 'Off'; ]]]"
so it will output 'Off' for any language it can't find, but that's more of a workaround than a fix. That's why I am raising this issue.