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

Interpretation of "odds:8" to "quarterfinals" is wrong or API is wrong (tennis) #60

Closed loovanloon closed 6 months ago

loovanloon commented 1 year ago

When attribute "odds" = 8 in a tennis entity, it is translated to "quarterfinals" on the card. This sounds right and logical: in quarterfinals 1 out of 8 has a chance to win the tennis tournament. However, in real life the actual match is the "semi-final" (1 out of 4).

So either the ESPN API is providing the wrong data, or the value of "odds" should be interpreted differently.

See the card of the semi final of French Open Roland Garros, match of Friday 9th of June (2023-06-09)

image

And the raw data of the entity: image

vasqued2 commented 1 year ago

I got lazy.

The 8 to “quarterfinals” is a hack that works most of the time. But not all of the time.

The 8 represents that there are 8 competitions left in the French open to be played. In a normal tournament, if there were 8 competitions left, that would mean this one is the quarterfinals.

But the French open is not a normal tournament. It is actually multiple tournaments. Singles. Doubles. Mixed. Men’s. Women’s. But the API returns all of the competitions in a single call. So now it is returning 8 competitions remaining. Which there are. But they are a combo of all of the above. So the card incorrectly interprets 8 as quarterfinals.

Opens are the worst offenders but others sometimes have multiple competition types too. I noticed it at the Australian last year but was too lazy to fix it then.

I have 3 options:

I’ll try to fix it by filtering out other events but no guarantees.

I personally thought was worth it since it worked for most events and I liked the context it provided. If you think it causes too much confusion, lmk and I’ll consider turning it off for everything.

loovanloon commented 1 year ago

Thank you for your clear explanation. Maybe you can take a fourth option into consideration: make displaying optional as a setting on the card:

loovanloon commented 1 year ago

I love your integration btw. Thank you for bringing it to us.

vasqued2 commented 6 months ago

ESPN introduced a new format for the Tennis API this year. It broke the original sensor logic and it wasn't working for a long time. I finally had time to make the changes to support the new format. The new format provides additional info and eliminates the need to do all the back-calculations. It looks like it could support doubles, but we will have to see.

v0.10.0 will process the new JSON structure used by Tennis. Let me know if there are any issues.

You can use card-mod to hide any element of the card you do not wish to display.

loovanloon commented 6 months ago

Thank you very much for this, and for notifying me!

As soon as v10.0 is available in HACS I will update and let you know my findings. I am very happy with this!

Best regards,

Ton van Loon

@.***

Van: David @.> Verzonden: maandag 18 december 2023 22:28 Aan: vasqued2/ha-teamtracker-card @.> CC: loovanloon @.>; Author @.> Onderwerp: Re: [vasqued2/ha-teamtracker-card] Interpretation of "odds:8" to "quarterfinals" is wrong or API is wrong (tennis) (Issue #60)

ESPN introduced a new format for the Tennis API this year. It broke the original sensor logic and it wasn't working for a long time. I finally had time to make the changes to support the new format. The new format provides additional info and eliminates the need to do all the back-calculations. It looks like it could support doubles, but we will have to see.

v0.10.0 will process the new JSON structure used by Tennis. Let me know if there are any issues.

You can use card-mod https://github.com/vasqued2/ha-teamtracker/wiki/Using-CARD-MOD-card-to-format-the-TEAMTRACKER-CARD to hide any element of the card you do not wish to display.

— Reply to this email directly, view it on GitHub https://github.com/vasqued2/ha-teamtracker-card/issues/60#issuecomment-1861695999 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AGA4AWECGSWKI3PLVZRVONTYKCYPRAVCNFSM6AAAAAAZAVCZJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRRGY4TKOJZHE . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AGA4AWBXBRJUZB4OCTXZSZDYKCYPRA5CNFSM6AAAAAAZAVCZJCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTO64476.gif Message ID: @. @.> >