benct / lovelace-xiaomi-vacuum-card

Simple card for various robot vacuums in Home Assistant's Lovelace UI
MIT License
261 stars 38 forks source link

Show attributes based on state possible? #78

Open X1pheR opened 3 years ago

X1pheR commented 3 years ago

Great minimalistic card! As a nice finish I tried adding custom attributes per the instructions and it works nicely. But would it be possible to only show things based on the state? For example below to show the cleaned area. But if it's not running it doesn't make sense to show it. Also for buttons. It doesn't make sense to show a stop button for example if it is docked.

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  attributes:
    clean_area:
      key: 'clean_area'
      label: 'Cleaned area: '
      unit: ' m2'