Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tap_action only works on icon #68

Closed
clinta opened this issue Jan 8, 2023 · 14 comments
Closed

tap_action only works on icon #68

clinta opened this issue Jan 8, 2023 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@clinta
Copy link

clinta commented Jan 8, 2023

tap_action seems to behave strangely. It is triggered if you tap on the icon, but not on the text in the card. And if the timer is running, tap_action only works when tapping on the icon, tapping on the running bar brings up the more info dialog. I'd like to be able to make tap_action apply to the entire card, including the text and running bar.

@srodighiero
Copy link

I want to say that even with a declared "tap_action: none" for example, tapping on the icon ignores it and gives you (in my case) the "more info" popup, while doing nothing (as expected) by tapping on the running bar.

@rianadon
Copy link
Owner

Thank you for bringing this to my attention. I do not use tap_action or really even understand how it's supposed to work, so it's great to hear feedback on this.

@clinta your suggestion makes sense and would be easy to implement.

@srodighiero I tried reproducing this, but with "tap_action: none," I am not able to trigger the "more info" popup. Maybe we are doing something differently (I'm accessing home assistant through the website on a laptop).

Also, is there any reason to give a different tap_action to the running_bar than the rest of the card? Or should they both do the same thing?

@rianadon rianadon added the bug Something isn't working label Jan 30, 2023
@rianadon rianadon self-assigned this Jan 30, 2023
@clinta
Copy link
Author

clinta commented Jan 30, 2023

I don't have any need for separate actions for different parts of the card. And every other card I've used in haas, tap_action applies to the entire card.

@srodighiero
Copy link

I don't remeber if meanwhile you had make an update, atm it is no longer doing anything (as expected), on my side the only thing that I changed (added) is the "sync_issues: ignore"

@doug144
Copy link

doug144 commented Feb 3, 2023

I still see that the actions only take effect when clicking on the name or icon. Clicking on the progress bar always brings up the more-info. I would expect the action to be the same no matter where i click. This is especially problematic when using the layout: full_row option, since it means I can't define any actions.

Also, I think there is another bug in the way the action is handled. I have a card configuration as shown below and the tap action is to pause the timer, but when I click, I get the error: Failed to call service timer/pause. must contain at least one entity_id, device_id, area_id.. The same action works on any other card. Here is my lovelace card configuration:

type: custom:timer-bar-card
compressed: true
entities:
  - entity: timer.garage_lights
    bar_foreground: orange
    sync_issues: ignore
    tap_action:
      action: call-service
      service: timer.pause
      data: {}
      target:
        entity_id: timer.garage_lights
    hold_action:
      action: more-info
    double_tap_action:
      action: more-info

@JockeJ0
Copy link

JockeJ0 commented Feb 6, 2023

I still see that the actions only take effect when clicking on the name or icon. Clicking on the progress bar always brings up the more-info. I would expect the action to be the same no matter where i click. This is especially problematic when using the layout: full_row option, since it means I can't define any actions.

Also, I think there is another bug in the way the action is handled. I have a card configuration as shown below and the tap action is to pause the timer, but when I click, I get the error: Failed to call service timer/pause. must contain at least one entity_id, device_id, area_id.. The same action works on any other card. Here is my lovelace card configuration:

type: custom:timer-bar-card
compressed: true
entities:
  - entity: timer.garage_lights
    bar_foreground: orange
    sync_issues: ignore
    tap_action:
      action: call-service
      service: timer.pause
      data: {}
      target:
        entity_id: timer.garage_lights
    hold_action:
      action: more-info
    double_tap_action:
      action: more-info

I also have the latter issue: tap_action with call-service does not honor the 'target'

@rianadon
Copy link
Owner

It looks like honoring target was something added to only the last release of custom-card-helpers.

But alas, until custom-cards/custom-card-helpers#55 is solved, I cannot upgrade.
The codebase shall be growing in size as I include the module myself, but this will be solved :)

The fix for making everything for the card clickable is in the works.

@rianadon
Copy link
Owner

These issues should be fixed by the 1.25rc1 beta, if you'd like to test them out early.

However, I'll be making a release very soon.

@rianadon
Copy link
Owner

Fixed in v1.25!

@JockeJ0
Copy link

JockeJ0 commented Feb 11, 2023

Fixed in v1.25!

Brilliant! Seems to work well in initial testing

@doug144
Copy link

doug144 commented Feb 12, 2023

Fixed in v1.25!

Thanks for the quick response, but still not working for me. I upgraded to 1.25, but it only works if I remove layout: full_row. I included my configuration above:

type: custom:timer-bar-card
compressed: true
entities:
  - entity: timer.garage_lights
    bar_foreground: orange
    sync_issues: ignore
    tap_action:
      action: call-service
      service: timer.pause
      data: {}
      target:
        entity_id: timer.garage_lights
    hold_action:
      action: more-info
    double_tap_action:
      action: more-info

Any ideas @rianadon?

@rianadon
Copy link
Owner

Ah yes my bad. I just realized full_row is a special case that used a separate component than the one that handles all the actions. Fix incoming!

@rianadon rianadon reopened this Feb 12, 2023
@rianadon
Copy link
Owner

Sorry for the delay. This should now finally be fixed in v1.26.

@doug144
Copy link

doug144 commented Feb 27, 2023

Thanks @rianadon! Works great now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants