In a mushroom template card there is an entry for icon, that takes the icon name to display, and can take a template. I want the card to show the default icon of the entity. The entity doesn’t have its icon defined by an attribute. It does have an entity_class attribute, and the icon is derived from it.
I’m wondering what’s the proper syntax to extract the icon name from the device class, so it can be inserted into the card definition.
- type: custom:mushroom-template-card
entity: sensor.odometer
primary: " {{ states(entity) | round(2) }} {{ state_attr(entity, 'unit_of_measurement') }} "
icon: # what goes here to show the default icon for the entity's device class?
secondary: " {{ state_attr(entity, 'friendly_name') }}"
The code I posted was a simplification. I actually need the template features to make the card more complex. It would still be nice to have access to the default icon.