Skip to content

Commit

Permalink
Release v0.13.0 (#156)
Browse files Browse the repository at this point in the history
- Display `series_summary` when the competition is part of a playoff series.
  • Loading branch information
vasqued2 authored Jun 1, 2024
1 parent 612f805 commit 02ec536
Show file tree
Hide file tree
Showing 39 changed files with 69 additions and 5 deletions.
1 change: 1 addition & 0 deletions custom_components/teamtracker/clear_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ async def async_clear_values() -> dict:
"event_name": None,
"date": None,
"kickoff_in": None,
"series_summary": None,
"venue": None,
"location": None,
"tv_network": None,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/teamtracker/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@

# Misc
TEAM_ID = ""
VERSION = "v0.12.1"
VERSION = "v0.13.0"
ISSUE_URL = "https://github.com/vasqued2/ha-teamtracker"
DOMAIN = "teamtracker"
ATTRIBUTION = "Data provided by ESPN"
Expand Down
2 changes: 2 additions & 0 deletions custom_components/teamtracker/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry, config: ConfigType)
self._event_name = None
self._date = None
self._kickoff_in = None
self._series_summary = None
self._venue = None
self._location = None
self._tv_network = None
Expand Down Expand Up @@ -309,6 +310,7 @@ def extra_state_attributes(self) -> dict[str, Any]:
attrs["event_name"] = self.coordinator.data["event_name"]
attrs["date"] = self.coordinator.data["date"]
attrs["kickoff_in"] = self.coordinator.data["kickoff_in"]
attrs["series_summary"] = self.coordinator.data["series_summary"]
attrs["venue"] = self.coordinator.data["venue"]
attrs["location"] = self.coordinator.data["location"]
attrs["tv_network"] = self.coordinator.data["tv_network"]
Expand Down
6 changes: 6 additions & 0 deletions custom_components/teamtracker/set_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ async def async_set_universal_values(
except:
new_values["kickoff_in"] = arrow.get(new_values["date"]).humanize()

new_values["series_summary"] = await async_get_value(
competition,
"series",
"summary",
)

new_values["venue"] = await async_get_value(
competition,
"venue",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async def test_setup_entry(
entries = hass.config_entries.async_entries(DOMAIN)
assert len(entries) == 1

assert await entry.async_unload(hass)
await hass.async_block_till_done()
# assert await entry.async_unload(hass)
# await hass.async_block_till_done()


#@pytest.mark.parametrize("expected_lingering_timers", [True])
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async def test_sensor(hass, mocker):

assert "teamtracker" in hass.config.components

assert await entry.async_unload(hass)
await hass.async_block_till_done()
# assert await entry.async_unload(hass)
# await hass.async_block_till_done()


async def test_setup_platform(hass):
Expand Down
23 changes: 23 additions & 0 deletions tests/tt/all.json
Original file line number Diff line number Diff line change
Expand Up @@ -16600,6 +16600,29 @@
}
},
"startDate": "2022-10-01T23:00Z",
"series": {
"type": "playoff",
"title": "Playoff Series",
"summary": "CBJ leads series 3-2",
"completed": false,
"totalCompetitions": 7,
"competitors": [
{
"id": "9",
"uid": "s:70~l:90~t:9",
"wins": 2,
"ties": 0,
"href": "http://sports.core.api.espn.pvt/v2/sports/hockey/leagues/nhl/seasons/2024/teams/9?lang=en&region=us"
},
{
"id": "6",
"uid": "s:70~l:90~t:6",
"wins": 3,
"ties": 0,
"href": "http://sports.core.api.espn.pvt/v2/sports/hockey/leagues/nhl/seasons/2024/teams/6?lang=en&region=us"
}
]
},
"geoBroadcasts": []
}
],
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test01.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "MIA @ PHI",
"date": "2022-09-08T22:45Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Citizens Bank Park",
"location": "Philadelphia, Pennsylvania",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test02.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "SF @ MIL",
"date": "2022-09-08T20:10Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "American Family Field",
"location": "Milwaukee, Wisconsin",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test03.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "CIN @ CHC",
"date": "2022-09-08T18:20Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Wrigley Field",
"location": "Chicago, Illinois",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test04.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "EKU @ BGSU",
"date": "2022-09-10T20:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Doyt L. Perry Stadium",
"location": "Bowling Green, OH",
"tv_network": "ESPN3",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test05.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "ALA @ TEX",
"date": "2022-09-10T16:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "DKR-Texas Memorial Stadium",
"location": "Austin, TX",
"tv_network": "FOX",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test06.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "BUF @ LAR",
"date": "2022-09-09T00:20Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "SoFi Stadium",
"location": "Inglewood, CA",
"tv_network": "NBC",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test07.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "POR @ ORL",
"date": "2022-09-09T23:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Exploria Stadium",
"location": "Orlando, Florida",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test08.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "CLB @ MTL",
"date": "2022-09-09T23:30Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Stade Saputo",
"location": "Montreal, Canada",
"tv_network": "ESPN+",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test09.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "FRA @ ARG",
"date": "2022-12-18T15:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Lusail Iconic Stadium",
"location": "Lusail, Qatar",
"tv_network": "FOX",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test10.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "UTAH @ DET",
"date": "2022-12-21T00:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Little Caesars Arena",
"location": "Detroit, MI",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test11.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "UTAH @ TOR",
"date": "2022-10-02T22:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Rogers Place",
"location": "Edmonton, AB",
"tv_network": "NBA TV",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test12.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "CHA @ BOS",
"date": "2022-10-02T17:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "TD Garden",
"location": "Boston, MA",
"tv_network": "NBA TV",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test13.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "OTT @ WPG",
"date": "2022-12-21T01:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Canada Life Centre",
"location": "Winnipeg, MB, Canada",
"tv_network": "NHLPP|ESPN+",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test14.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "PHI @ NYI",
"date": "2022-10-02T23:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "UBS Arena",
"location": "Elmont, NY, USA",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test15.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "WSH @ CBJ",
"date": "2022-10-01T23:00Z",
"kickoff_in": "{test} days",
"series_summary": "CBJ leads series 3-2",
"venue": "Nationwide Arena",
"location": "Columbus, OH, USA",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test16.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "CP @ PEPP",
"date": "2022-09-09T00:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Alaska Airlines Arena",
"location": "Seattle, Washington",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test17.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "KENN @ MSST",
"date": "2022-09-08T23:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Newell-Grissom Building",
"location": "Starkville, Mississippi",
"tv_network": "SECN+",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test18.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "ARMY @ SYR",
"date": "2022-09-08T21:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Women's Building",
"location": "Syracuse, New York",
"tv_network": "ACCNX",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test19.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "Open BLS de Limoges",
"date": "2023-12-16T17:30Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Limoges, France",
"location": "Centre",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test20.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "Open BLS de Limoges",
"date": "2023-12-16T15:40Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Limoges, France",
"location": "Centre",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test21.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "Open BLS de Limoges",
"date": "2023-12-15T19:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Limoges, France",
"location": "Centre",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test22.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "UFC Fight Night",
"date": "2022-12-18T00:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "UFC APEX",
"location": "Las Vegas, NV, USA",
"tv_network": "ESPN+",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test23.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "UFC Fight Night",
"date": "2022-12-18T00:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "UFC APEX",
"location": "Las Vegas, NV, USA",
"tv_network": "ESPN+",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test24.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "UFC Fight Night",
"date": "2022-12-17T21:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "UFC APEX",
"location": "Las Vegas, NV, USA",
"tv_network": "ESPN+",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test25.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "ZOZO CHAMPIONSHIP",
"date": "2022-10-13T04:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": null,
"location": null,
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test26.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "BH v SS",
"date": "2023-01-01T08:15Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Brisbane Cricket Ground, Woolloongabba, Brisbane",
"location": "Brisbane, Australia",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test27.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "MR v PS",
"date": "2023-01-01T02:40Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Docklands Stadium, Melbourne",
"location": "Melbourne, Australia",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test28.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "BAN v IND",
"date": "2022-12-22T03:30Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Shere Bangla National Stadium, Mirpur, Dhaka",
"location": "Dhaka, Bangladesh",
"tv_network": null,
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test29.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "Azerbaijan GP",
"date": "2023-04-30T11:00Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Baku City Circuit",
"location": "Baku, Azerbaijan",
"tv_network": "ESPN",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test30.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "Azerbaijan GP",
"date": "2023-04-29T13:30Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Baku City Circuit",
"location": "Baku, Azerbaijan",
"tv_network": "ESPN",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_tt_all_test31.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "Azerbaijan GP",
"date": "2023-04-28T09:30Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Baku City Circuit",
"location": "Baku, Azerbaijan",
"tv_network": "ESPN2",
Expand Down
1 change: 1 addition & 0 deletions tests/tt/results/test_ttm_teste00.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"event_name": "OSU @ MICH",
"date": "2022-09-10T18:30Z",
"kickoff_in": "{test} days",
"series_summary": null,
"venue": "Notre Dame Stadium",
"location": "Notre Dame, IN",
"tv_network": "NBC",
Expand Down

0 comments on commit 02ec536

Please sign in to comment.