fmartinou / whats-up-docker

What's up Docker ( aka WUD ) gets you notified when a new version of your Docker Container is available.
https://fmartinou.github.io/whats-up-docker
MIT License
919 stars 29 forks source link

Labels too long in homeassistant #308

Open ioull opened 10 months ago

ioull commented 10 months ago

Since the last homeassistant update, the name of the entity is concatained with the name of the device : For example instead of "adguardhome", I get "What's up docker? Adguardhome"

Here is a screenshot : image

laberning commented 9 months ago

I was struggling with the same, for now solved it with the replace filter | regex_replace('What\'s up docker\? ','')

This is how it looks in the card configuration, I'm using some custom cards, but this should work with other configurations as well:

type: custom:auto-entities
card:
  title: Available Updates
  type: entities
show_empty: false
filter:
  include:
    - entity_id: update.*
      attributes:
        update_available: true
      options:
        type: custom:template-entity-row
        name: >-
          {{ state_attr(config.entity, 'friendly_name')| regex_replace('What\'s
          up docker\? ','') }}
        state: >-
          {{ state_attr(config.entity, 'installed_version' )}} → {{
          state_attr(config.entity, 'latest_version') }}
        icon: mdi:update
Bildschirmfoto 2023-09-29 um 09 53 59
Rembock commented 3 months ago

Leaving this for the next one that has a similar issue, use the display_name attribute instead of friendly_name