Mushroom template card: How to get icon by device class?

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')  }}"

Why not use the default mushroom entity card? The result is the same as when you use a template that you have to set up all by yourself.

the first card is the template, according to the config you sent, the bottom one is the mushroom entity card…

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.

There are no default icons by class, the icons are determined by the integration creator who sets them there. :man_shrugging:

You can set your own template and determine it yourself.

type: custom:mushroom-template-card
entity: sensor.outside_temperature
primary: " {{ states(entity) | round(2) }}  {{ state_attr(entity, 'unit_of_measurement') }} "
secondary: " {{ state_attr(entity, 'device_class')  }}"
icon: |
  {% set icon = {
    'temperature': 'thermostat',
    'humidity': 'water-percent',
  } %}
  {% set deviceClass = state_attr(entity, 'device_class') %}
  mdi:{{ icon.get(deviceClass, 'alert') }}

Yes, I just want to include whatever icon the integration creator assigned for that entity, into my template card. But I don’t know how.