@@ -242,22 +242,30 @@ async def async_get_state(config) -> dict:
242
242
_LOGGER .debug ("Did not find a game with for the configured team. Checking if it's a bye week." )
243
243
found_bye = False
244
244
values = await async_clear_states (config )
245
- for bye_team in data ["week" ]["teamsOnBye" ]:
246
- if team_id .lower ()== bye_team ["abbreviation" ].lower ():
247
- _LOGGER .debug ("Bye week confirmed." )
248
- found_bye = True
249
- values ["team_abbr" ]= bye_team ["abbreviation" ]
250
- values ["team_name" ]= bye_team ["shortDisplayName" ]
251
- values ["team_logo" ]= bye_team ["logo" ]
252
- values ["state" ]= 'BYE'
253
- values ["last_update" ]= arrow .now ().format (arrow .FORMAT_W3C )
254
- if found_bye == False :
255
- _LOGGER .debug ("Team not found in active games or bye week list. Have you missed the playoffs?" )
256
- values ["team_abbr" ]= None
257
- values ["team_name" ]= None
258
- values ["team_logo" ]= None
259
- values ["state" ]= 'NOT_FOUND'
260
- values ["last_update" ]= arrow .now ().format (arrow .FORMAT_W3C )
245
+ try :# look for byes in regular season
246
+ for bye_team in data ["week" ]["teamsOnBye" ]:
247
+ if team_id .lower ()== bye_team ["abbreviation" ].lower ():
248
+ _LOGGER .debug ("Bye week confirmed." )
249
+ found_bye = True
250
+ values ["team_abbr" ]= bye_team ["abbreviation" ]
251
+ values ["team_name" ]= bye_team ["shortDisplayName" ]
252
+ values ["team_logo" ]= bye_team ["logo" ]
253
+ values ["state" ]= 'BYE'
254
+ values ["last_update" ]= arrow .now ().format (arrow .FORMAT_W3C )
255
+ if found_bye == False :
256
+ _LOGGER .debug ("Team not found in active games or bye week list. Have you missed the playoffs?" )
257
+ values ["team_abbr" ]= None
258
+ values ["team_name" ]= None
259
+ values ["team_logo" ]= None
260
+ values ["state" ]= 'NOT_FOUND'
261
+ values ["last_update" ]= arrow .now ().format (arrow .FORMAT_W3C )
262
+ except :
263
+ _LOGGER .debug ("Team not found in active games or bye week list. Have you missed the playoffs?" )
264
+ values ["team_abbr" ]= None
265
+ values ["team_name" ]= None
266
+ values ["team_logo" ]= None
267
+ values ["state" ]= 'NOT_FOUND'
268
+ values ["last_update" ]= arrow .now ().format (arrow .FORMAT_W3C )
261
269
262
270
if values ["state" ]== 'PRE' and ((arrow .get (values ["date" ])- arrow .now ()).total_seconds ()< 1200 ):
263
271
_LOGGER .debug ("Event is within 20 minutes, setting refresh rate to 5 seconds." )