Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzotek authored Aug 10, 2022
1 parent 2bef65d commit f141ca3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/nfl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ async def async_get_state(config) -> dict:
values["kickoff_in"] = arrow.get(event["date"]).humanize()
values["venue"] = event["competitions"][0]["venue"]["fullName"]
values["location"] = "%s, %s" % (event["competitions"][0]["venue"]["address"]["city"], event["competitions"][0]["venue"]["address"]["state"])
values["tv_network"] = event["competitions"][0]["broadcasts"][0]["names"][0]
try:
values["tv_network"] = event["competitions"][0]["broadcasts"][0]["names"][0]
except:
values["tv_network"] = None
if event["status"]["type"]["state"].lower() in ['pre']: # odds only exist pre-game
values["odds"] = event["competitions"][0]["odds"][0]["details"]
values["overunder"] = event["competitions"][0]["odds"][0]["overUnder"]
Expand Down

0 comments on commit f141ca3

Please sign in to comment.