JayBlackedOut / hass-nhlapi

NHL Stats API Integration Into Home Assistant
69 stars 18 forks source link

Expose Next Game DateTime as Attribute #47

Closed databoy2k closed 2 years ago

databoy2k commented 2 years ago

This adds a new attribute, "Next game datetime," which exposes the date and time of the next game in a single attribute. This is necessary if you want to have automations that rely on the start time.

Probably not being defined in the best place (I am a neophyte at Python); maybe there's a better place for it to be placed?

Sample automation.yaml:

ctml91 commented 2 years ago

Sweet, was hoping to have access to this attribute!

JayBlackedOut commented 2 years ago

next_game_datetime is already a key-value pair provided by the pynhl API wrapper (also written by me) that's used by this component . There's a cleaner way to do this but you have the right idea. I'll work on this once I'm back in town in a week.

databoy2k commented 2 years ago

next_game_datetime is already a key-value pair provided by the pynhl API wrapper (also written by me) that's used by this component . There's a cleaner way to do this but you have the right idea. I'll work on this once I'm back in town in a week.

Thanks. I don't mind moving it, either. I just got tired of manually editing the component for each update (haha).

Thanks, Jay.

JayBlackedOut commented 2 years ago

Changes committed directly to master branch. Will release Version 0.10.1 that incorporates changes.