rianadon / timer-bar-card

A progress bar display for Home Assistant timers
Other
371 stars 15 forks source link

Expected duratio unavailable to be a number since units is minutes #119

Closed Bascht74 closed 7 months ago

Bascht74 commented 9 months ago

Describe the bug I am getting "Expected duration unavailable to be a number since units is minutes" for one entity

Your card configuration

  - type: custom:timer-bar-card
    entities:
      - sensor.waschmaschine_timer
    invert: true
    active_state: running
    sync_issues: fix
    bar_direction: rtl
    duration:
      attribute: duration
      units: minutes
    remain_time:
      attribute: remain_time
      units: minutes
    translations:
      running: läuft ☀️
      program_ended: Fertig
      'off': Aus
    debug: true
...

Debug information Please add debug: true to your configuration and either take a screenshot or paste the output here! It is not showing anything. Here is a screenshot of my entity from the dev board:

image

I think, because I set the active state to "running" it should just show the state of the entity "not_connected" (not an active state).

Btw. Could you render translations for the state? With you card, everything is in english vs. other cards are showing the translations of the entities... But this would be a feature request, I know...

rianadon commented 9 months ago

I think, because I set the active state to "running" it should just show the state of the entity "not_connected" (not an active state).

That does sound like a bug. The card is probably parsing the duration attribute even when it's not supposed to.

Btw. Could you render translations for the state? With you card, everything is in english vs. other cards are showing the translations of the entities... But this would be a feature request, I know...

That's another issue hahaha 😄 For organization purposes it would be great if you create another one. I thought I handled localization in the card, but maybe I missed something important.

rianadon commented 7 months ago

I tried looking into the localization issue, but for me even if I change the language almost every state is untranslated.

I wonder if that's because the other cards are custom cards that have their own translations built in? If you give me an example of a card using the localizations maybe I can take a peek into the code and see if I can copy that over here.

Anyways, I'm going to close this issue since the original issue is fixed. Please open another one for the localization!