1 """Define an object to manage fetching NYT Games data."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
6 from datetime
import timedelta
7 from typing
import TYPE_CHECKING
9 from nyt_games
import Connections, NYTGamesClient, NYTGamesError, SpellingBee, Wordle
14 from .const
import LOGGER
17 from .
import NYTGamesConfigEntry
22 """Class for NYT Games data."""
25 spelling_bee: SpellingBee |
None
26 connections: Connections |
None
30 """Class to manage fetching NYT Games data."""
32 config_entry: NYTGamesConfigEntry
34 def __init__(self, hass: HomeAssistant, client: NYTGamesClient) ->
None:
35 """Initialize coordinator."""
46 stats_data = await self.
clientclient.get_latest_stats()
47 connections_data = await self.
clientclient.get_connections()
48 except NYTGamesError
as error:
51 wordle=stats_data.wordle,
52 spelling_bee=stats_data.spelling_bee,
53 connections=connections_data,
None __init__(self, HomeAssistant hass, NYTGamesClient client)
NYTGamesData _async_update_data(self)