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
71 stars 16 forks source link

Swap team names #17

Closed coleburg closed 1 year ago

coleburg commented 1 year ago

Minor issue, in Europe, the order of team is Home team v Away Team, but I think in the States its, Away Team, plays at Home Team. Is there any way I could swap the teams around? Hope this makes sense and thanks again for the plug in.

vasqued2 commented 1 year ago

It makes sense and is related to the other issue. I’ve been debating the best way to handle as the side can vary by sport and country.

I think I’m landing on allowing something like home_side to optionally be specified in the card configuration yaml. That would allow you to do what you want to do,right?

coleburg commented 1 year ago

I suppose it depends how its implemented, but im thinking something like home_side_first = bool, then it should suit every option.

thanks

vasqued2 commented 1 year ago

The Team-Order-Flexibility branch has my first cut of the changes to allow the user to specify a side for the home team on the card configuration.

Because of the amount of hard-coding in the original card, this actually required a lot of restructuring under the covers so I'm going to watch the changes across several sports for a while before officially pushing it out.

If you want to try it early, you can manually install the ha-teamtracker-card.js file. If you do, let me know if you have any problems with it.

Use home_side: left or home_side: right in the card configuration to force the home team to one side or the other.

Here's a sample:

  - type: custom:teamtracker-card
    entity: sensor.test11
    outline: true
    outline_color: lightgray
    show_league: true
    home_side: right
vasqued2 commented 1 year ago

Released v0.5.2 which supports the home_side config option. Thanks for the suggestion. Let me know if you notice anything wonky.

coleburg commented 1 year ago

amazing thank you,