vasqued2 / ha-teamtracker-card

A Home Assistant frontend custom card that will display real-time updates for teams tracked with the ha-teamtracker integration. Has custom in-game layouts for football, baseball, basketball, hockey, soccer, golf, tennis, racing, and mma.
GNU General Public License v3.0
63 stars 12 forks source link

Feature Actions #88

Open milandzuris opened 3 days ago

milandzuris commented 3 days ago

Hi please add feature when i click on Card open the Entity.

tap_action:
  action: ***
hold_action:
  action: **
double_tap_action:
  action: ***
vasqued2 commented 3 days ago

Can you give me more specifics. Do you want to click on different components of the card to have different things happen? If so, what type of things? Links to other sites, HA actions, etc? Or do you want different things to happen on different actions like you describe? Give me examples of the actions.

I am leaning towards creating 3 hot spots. One on each team icon and one at the bottom. By default they will link to each team page and the game page on ESPN but will allow each url to be overwritten in the card config.

milandzuris commented 2 days ago

I am leaning towards creating 3 hot spots. One on each team icon and one at the bottom. By default they will link to each team page and the game page on ESPN but will allow each url to be overwritten in the card config.

this sounds amazing, and add HA actions.

vasqued2 commented 2 days ago

I am not sure I understand by what you mean by HA actions. Can you share a card that has the capability so I can take a look at it?

milandzuris commented 2 days ago

I am not sure I understand by what you mean by HA actions. Can you share a card that has the capability so I can take a look at it?

https://www.home-assistant.io/dashboards/actions/

vasqued2 commented 2 days ago

Tap actions look like they are only available on some native HA components. I can't find any custom cards that have implemented them and I don't see any way for a custom card to easily leverage the HA implementation.

With that said, the only action I see that makes sense to me is a hot link to a url, which I can implement. Maybe I don't understand what all the actions are. Were you thinking of another action you wanted to take on a tap other than to navigate somewhere?

milandzuris commented 2 days ago

Tap actions look like they are only available on some native HA components. I can't find any custom cards that have implemented them and I don't see any way for a custom card to easily leverage the HA implementation.

https://github.com/maxwroc/battery-state-card?tab=readme-ov-file#tap-action

vasqued2 commented 2 days ago

I see. Thanks. They used TypeScript to implement it. That card is written in Javascript so it would require a full rewrite to incorporate the code in some fashion and I'm not familiar with TypeScript.

For now, the new version will implement HTML hotspots and allow the default URLs to be overwritten in the card config. I should be able to release a beta version later today for you to try.

If you want to submit a pull request to implement the other actions, I'll take a look at it.

vasqued2 commented 2 days ago

You should be able to download beta versions of v0.14.0 for the card and the sensor. Let me know if it works as you expected.

By default, it will populate the team and event URLs if they are provided by the API. You can overwrite them by including different URLs in the card configuration.

home_url: https://www.espn.com
opponent_url:  https://www.ticketmaster.com
bottom_url:  https://www.nfl.com
milandzuris commented 1 day ago

home_url: https://www.espn.com opponent_url: https://www.ticketmaster.com bottom_url: https://www.nfl.com

not working, and question why when is entity defined (entity:) and i click on card not open entity? image

vasqued2 commented 1 day ago

Buday isn't listed as fighting on 7/13. That is why nothing is found and the links are not active when the status is NOT_FOUND.

If you had a sensor for FREMD is should work because he is fighting in the upcoming event.

vasqued2 commented 7 hours ago

I might be able to trigger tap actions, however it looks like they won't be user configurable from the card. They would have to be hardcoded.

If so, what actions would you want and how would you want them triggered. My inclination is to keep the 3 hotspots that I already have and enable more-info with a double-click. I would not enable service calls and toggle/assist doesn't make any sense.

Lmk what you think.

vasqued2 commented 2 hours ago

I was able to get the more-info working on a double-click in areas that are not already a hotspot for a single click (i.e. the middle of the card where the score is). Lmk if this is what you are thinking and I will re-release a new beta.