zacs / ha-nfl

NFL game scores custom component for Home Assistant
43 stars 32 forks source link

feat: add team colors as RGB color lists #26

Closed firstof9 closed 2 years ago

firstof9 commented 2 years ago
zacs commented 2 years ago

Can't check code atm, but is the colors list checkin backcompat?

firstof9 commented 2 years ago

What do you mean? Rather than dumping the HEX it dumps it in RGB list form so you can consume it in Home Assistant easier.

zacs commented 2 years ago

Right, so anyone relying on the hex value will break. I'd like to avoid making breaking changes unless there's significant added value. If you can revert that one commit, the rest look fine and I can merge. Thanks!

zacs commented 2 years ago

Alternatively I'm happy to take the new rgb values if you just give them a new property name like teamcolors_rgb and leave the hex as it is. Your call!

firstof9 commented 2 years ago

Ok, I can make it a new attribute

gonzotek commented 2 years ago

Thanks for adding it as a new property. I had created an automation+script+rest_command that ultimately calls a WLED device with the hex values of the team colors, so if they weren't available, I'd just be converting back from RGB to HEX (because I really like seeing the strip light up with the team/opponent colors when I'm following a couple games at once on Sundays). But I can also see value in having them in RGB as well, since HA lights will consume them more easily, and that's what most people will want to do.

firstof9 commented 2 years ago

It also opens it up easier for other service calls such as light.turn_on for other RGB lights as well.

zacs commented 2 years ago

Nice, thanks for the quick turnaround and appreciate the flexibility. You are brave to try linting my late night code 😂 .