Skip to content

Commit 15ac15f

Browse files
authored
v0.14.7 Release Candidate (#209)
- Add `season` attribute to indicate pre-, regular, and other season types.
1 parent 9f25c12 commit 15ac15f

36 files changed

+38
-2
lines changed

custom_components/teamtracker/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ async def async_call_api(self, config, hass, lang) -> dict:
393393

394394
if file_override:
395395
_LOGGER.debug("%s: Overriding API for '%s'", sensor_name, team_id)
396-
file_path = "/share/tt/test.json"
396+
file_path = "/share/tt/all.json"
397397
if not os.path.exists(file_path):
398398
file_path = "tests/tt/all.json"
399399
async with aiofiles.open(file_path, mode="r") as f:

custom_components/teamtracker/clear_values.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ async def async_clear_values() -> dict:
1010
"sport": None,
1111
"league": None,
1212
"league_logo": None,
13+
"season": None,
1314
"team_abbr": None,
1415
"opponent_abbr": None,
1516
"event_name": None,

custom_components/teamtracker/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195

196196
# Misc
197197
TEAM_ID = ""
198-
VERSION = "v0.14.6"
198+
VERSION = "v0.14.7"
199199
ISSUE_URL = "https://github.com/vasqued2/ha-teamtracker"
200200
DOMAIN = "teamtracker"
201201
ATTRIBUTION = "Data provided by ESPN"

custom_components/teamtracker/sensor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry, config: ConfigType)
197197
self._sport = None
198198
self._league = None
199199
self._league_logo = None
200+
self._season = None
200201
self._team_abbr = None
201202
self._opponent_abbr = None
202203

@@ -304,6 +305,7 @@ def extra_state_attributes(self) -> dict[str, Any]:
304305
attrs["sport"] = self.coordinator.data["sport"]
305306
attrs["league"] = self.coordinator.data["league"]
306307
attrs["league_logo"] = self.coordinator.data["league_logo"]
308+
attrs["season"] = self.coordinator.data["season"]
307309
attrs["team_abbr"] = self.coordinator.data["team_abbr"]
308310
attrs["opponent_abbr"] = self.coordinator.data["opponent_abbr"]
309311

custom_components/teamtracker/set_values.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ async def async_set_universal_values(
201201
default=await async_get_value(event, "status", "type", "state"),
202202
)
203203
).upper()
204+
new_values["season"] = await async_get_value(event, "season", "slug")
205+
204206
new_values["event_name"] = await async_get_value(event, "shortName")
205207
new_values["event_url"] = await async_get_value(event, "links", 0, "href")
206208
new_values["date"] = await async_get_value(

tests/tt/results/test_tt_all_test01.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"sport": "baseball",
33
"league": "MLB",
44
"league_logo": "https://a.espncdn.com/i/teamlogos/leagues/500/mlb.png",
5+
"season": "regular-season",
56
"team_abbr": "MIA",
67
"opponent_abbr": "PHI",
78
"event_name": "MIA @ PHI",

tests/tt/results/test_tt_all_test02.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"sport": "baseball",
33
"league": "MLB",
44
"league_logo": "https://a.espncdn.com/i/teamlogos/leagues/500/mlb.png",
5+
"season": "regular-season",
56
"team_abbr": "MIL",
67
"opponent_abbr": "SF",
78
"event_name": "SF @ MIL",

tests/tt/results/test_tt_all_test03.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"sport": "baseball",
33
"league": "MLB",
44
"league_logo": "https://a.espncdn.com/i/teamlogos/leagues/500/mlb.png",
5+
"season": "regular-season",
56
"team_abbr": "CIN",
67
"opponent_abbr": "CHC",
78
"event_name": "CIN @ CHC",

tests/tt/results/test_tt_all_test04.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"sport": "football",
33
"league": "NCAAF",
44
"league_logo": "https://a.espncdn.com/i/teamlogos/leagues/500/mlb.png",
5+
"season": "regular-season",
56
"team_abbr": "BGSU",
67
"opponent_abbr": "EKU",
78
"event_name": "EKU @ BGSU",

tests/tt/results/test_tt_all_test05.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"sport": "football",
33
"league": "NCAAF",
44
"league_logo": "https://a.espncdn.com/i/teamlogos/leagues/500/mlb.png",
5+
"season": "regular-season",
56
"team_abbr": "ALA",
67
"opponent_abbr": "TEX",
78
"event_name": "ALA @ TEX",

0 commit comments

Comments
 (0)