Entity icon action

On a Lovelace entities card, I have an input_boolean switch entity to which I have added an action to control another switch entity. That all works properly except that touching the entity switch icon only toggles the icon and of course the state of the entity. To run the action I must touch the entity name which does not change the state of the entity nor the icon state.
Are there actions that can be appended to the entity icon so that the icon will change the state, as it does now, and also run the related action?

Can you post the code, please?

This code utilizes a script call to accomplish the desired effect, except that clicking the icon does not work and using the icon seems more intuitive rather than the entity name label.

type: entities
entities:
  - entity: sensor.sonoff_1000xxxxxx. _temperature
    name: HW Ret
  - entity: switch.sonoff_1000xxxxxx
    name: Pump
  - entity: sensor.pump_ontime
    name: OnTime
  - entity: input_boolean.override
    tap_action:
      action: call-service
      service: script.Pump_override
title: Pump
card_mod: null
style: |
  ha-card
  {% set temp = states('sensor.sonoff_1000xxxxxx_temperature')|int %}
  {% if temp > 102 %}
      { border: 5px solid red }
  {% elif (temp <=102) and (temp >=95) %}
      { border: 5px solid yellow }
  {% elif temp < 95 %}
      { border: 5px solid blue }

    {% endif %}

I may be on the wrong track, but if the input_boolean shall execute an action, it has to be linked to an automation. Or am I understanding you completely wrong?

If the icon had an action attached, I presume the action could be any valid action such as: ‘service: switch.turn_on’